summaryrefslogtreecommitdiff
path: root/astroshop-platform/argocd-helmchart/templates/argocd-server/hpa.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'astroshop-platform/argocd-helmchart/templates/argocd-server/hpa.yaml')
-rw-r--r--astroshop-platform/argocd-helmchart/templates/argocd-server/hpa.yaml41
1 files changed, 41 insertions, 0 deletions
diff --git a/astroshop-platform/argocd-helmchart/templates/argocd-server/hpa.yaml b/astroshop-platform/argocd-helmchart/templates/argocd-server/hpa.yaml
new file mode 100644
index 0000000..51fe559
--- /dev/null
+++ b/astroshop-platform/argocd-helmchart/templates/argocd-server/hpa.yaml
@@ -0,0 +1,41 @@
+{{- if .Values.server.autoscaling.enabled }}
+apiVersion: autoscaling/v2
+kind: HorizontalPodAutoscaler
+metadata:
+ name: {{ include "argo-cd.server.fullname" . }}
+ namespace: {{ include "argo-cd.namespace" . }}
+ labels:
+ {{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" .Values.server.name) | nindent 4 }}
+spec:
+ scaleTargetRef:
+ apiVersion: apps/v1
+ kind: Deployment
+ name: {{ include "argo-cd.server.fullname" . }}
+ minReplicas: {{ .Values.server.autoscaling.minReplicas }}
+ maxReplicas: {{ .Values.server.autoscaling.maxReplicas }}
+ metrics:
+ {{- with .Values.server.autoscaling.metrics }}
+ {{- toYaml . | nindent 4 }}
+ {{- else }}
+ {{- with .Values.server.autoscaling.targetMemoryUtilizationPercentage }}
+ - type: Resource
+ resource:
+ name: memory
+ target:
+ type: Utilization
+ averageUtilization: {{ . }}
+ {{- end }}
+ {{- with .Values.server.autoscaling.targetCPUUtilizationPercentage }}
+ - type: Resource
+ resource:
+ name: cpu
+ target:
+ type: Utilization
+ averageUtilization: {{ . }}
+ {{- end }}
+ {{- end }}
+ {{- with .Values.server.autoscaling.behavior }}
+ behavior:
+ {{- toYaml . | nindent 4 }}
+ {{- end }}
+{{- end }}