argocd-helm/charts/argo-cd/templates/argocd-server/hpa.yaml
medicharlachiranjeevi 0717586410
feat(argo-cd): Added spec.behavior in HPA (#1376)
* added behavior in HPA for api version autoscaling/v2beta1

Signed-off-by: medicharlachiranjeevi <medicharlachiranjeevi@gmail.com>

* updated readme

Signed-off-by: medicharlachiranjeevi <medicharlachiranjeevi@gmail.com>

* chore: Apply changes from code review

Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>

* fix: Add missing quote

Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>

Signed-off-by: medicharlachiranjeevi <medicharlachiranjeevi@gmail.com>
Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>
Co-authored-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>
2022-08-25 08:40:50 +02:00

44 lines
1.5 KiB
YAML

{{- if .Values.server.autoscaling.enabled }}
apiVersion: {{ include "argo-cd.autoscaling.apiVersion" . }}
kind: HorizontalPodAutoscaler
metadata:
labels:
{{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" (printf "%s-hpa" .Values.server.name)) | nindent 4 }}
name: {{ template "argo-cd.server.fullname" . }}-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ template "argo-cd.server.fullname" . }}
minReplicas: {{ .Values.server.autoscaling.minReplicas }}
maxReplicas: {{ .Values.server.autoscaling.maxReplicas }}
metrics:
{{- with .Values.server.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
{{- if eq (include "argo-cd.autoscaling.apiVersion" $) "autoscaling/v2beta1" }}
targetAverageUtilization: {{ . }}
{{- else }}
target:
averageUtilization: {{ . }}
type: Utilization
{{- end }}
{{- end }}
{{- with .Values.server.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
{{- if eq (include "argo-cd.autoscaling.apiVersion" $) "autoscaling/v2beta1" }}
targetAverageUtilization: {{ . }}
{{- else }}
target:
averageUtilization: {{ . }}
type: Utilization
{{- end }}
{{- end }}
{{- with .Values.server.autoscaling.behavior }}
behavior:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}