Skip to content

Commit

Permalink
HPA are v2 since Kubernetes v1.23
Browse files Browse the repository at this point in the history
  • Loading branch information
sebagomez committed Nov 29, 2024
1 parent eb2b411 commit 8ada002
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions charts/wiremock/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2beta1
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "wiremock.fullname" . }}
Expand All @@ -14,15 +14,19 @@ spec:
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
- resource:
name: cpu
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
type: Resource
{{- end }}
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
- resource:
name: memory
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
type: Resource
{{- end }}
{{- end }}

0 comments on commit 8ada002

Please sign in to comment.