diff --git a/helm/charts/hydra/templates/hpa.yaml b/helm/charts/hydra/templates/hpa.yaml index 67a231a0a..10d68aa00 100644 --- a/helm/charts/hydra/templates/hpa.yaml +++ b/helm/charts/hydra/templates/hpa.yaml @@ -14,20 +14,34 @@ spec: minReplicas: {{ .Values.deployment.autoscaling.minReplicas }} maxReplicas: {{ .Values.deployment.autoscaling.maxReplicas }} metrics: - {{- if .Values.deployment.autoscaling.cpuAverageValue }} + {{- if .Values.deployment.autoscaling.targetCPUUtilizationPercentage }} - type: Resource resource: name: cpu - target: - type: AverageValue - averageValue: {{ .Values.deployment.autoscaling.cpuAverageValue }} + target: + type: Utilization + averageUtilization: {{ .Values.deployment.autoscaling.targetCPUUtilizationPercentage }} + {{- else if .Values.deployment.autoscaling.targetCPUAverageValue }} + - type: Resource + resource: + name: cpu + target: + type: AverageValue + averageValue: {{ .Values.deployment.autoscaling.targetCPUAverageValue }} {{- end }} - {{- if .Values.deployment.autoscaling.memoryAverageValue }} + {{- if .Values.deployment.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: {{ .Values.deployment.autoscaling.targetMemoryUtilizationPercentage }} + {{- else if .Values.deployment.autoscaling.targetMemoryAverageValue }} - type: Resource resource: name: memory target: type: AverageValue - averageValue: {{ .Values.deployment.autoscaling.memoryAverageValue }} + averageValue: {{ .Values.deployment.autoscaling.targetMemoryAverageValue }} {{- end }} {{- end }} diff --git a/helm/charts/hydra/values.yaml b/helm/charts/hydra/values.yaml index 9c068df1a..5c8b83bab 100644 --- a/helm/charts/hydra/values.yaml +++ b/helm/charts/hydra/values.yaml @@ -165,8 +165,8 @@ deployment: enabled: false # minReplicas: 1 # maxReplicas: 3 - # cpuAverageValue: 200m - # memoryAverageValue: 0.5Gi + # targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 # Configure node affinity affinity: {}