Files
charts/bitnami/argo-cd/templates/server/hpa.yaml
Miguel Ángel Cabrera Miñagorri 712c4fa8e6 [bitnami/argo-cd] Use the new helper for HPA API version (#10193)
* Use the new helper for HPA API version

Signed-off-by: Miguel A. Cabrera Minagorri <devgorri@gmail.com>

* Contemplate targetAverageUtilization

Signed-off-by: Miguel A. Cabrera Minagorri <devgorri@gmail.com>

* Bump common and update HPA

Signed-off-by: Miguel A. Cabrera Minagorri <devgorri@gmail.com>
2022-05-23 18:15:33 +02:00

48 lines
1.8 KiB
YAML

{{- if .Values.server.autoscaling.enabled }}
apiVersion: {{ include "common.capabilities.hpa.apiVersion" ( dict "context" $ ) }}
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "argocd.server" . }}
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: server
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
scaleTargetRef:
apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
kind: Deployment
name: {{ include "argocd.server" . }}
minReplicas: {{ .Values.server.autoscaling.minReplicas }}
maxReplicas: {{ .Values.server.autoscaling.maxReplicas }}
metrics:
{{- if .Values.server.autoscaling.targetCPU }}
- type: Resource
resource:
name: cpu
{{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }}
targetAverageUtilization: {{ .Values.server.autoscaling.targetCPU }}
{{- else }}
target:
type: Utilization
averageUtilization: {{ .Values.server.autoscaling.targetCPU }}
{{- end }}
{{- end }}
{{- if .Values.server.autoscaling.targetMemory }}
- type: Resource
resource:
name: memory
{{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }}
targetAverageUtilization: {{ .Values.server.autoscaling.targetMemory }}
{{- else }}
target:
type: Utilization
averageUtilization: {{ .Values.server.autoscaling.targetMemory }}
{{- end }}
{{- end }}
{{- end }}