Skip to content

Commit

Permalink
BAH-3911 | Upgrade HPA to stable API (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
mohan-13 authored Jun 19, 2024
1 parent add5191 commit 888bbb0
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions package/helm/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2beta1
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ .Chart.Name }}
labels:
app: {{ .Chart.Name }}
environment: {{ .Values.metadata.labels.environment }}

spec:
scaleTargetRef:
apiVersion: apps/v1
Expand All @@ -19,12 +18,16 @@ spec:
- type: Resource
resource:
name: cpu
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
{{- end }}

0 comments on commit 888bbb0

Please sign in to comment.