28 lines
952 B
YAML
28 lines
952 B
YAML
{{- if .Values.server.autoscaling.enabled }}
|
|
apiVersion: autoscaling/v2beta1
|
|
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
|
|
targetAverageUtilization: {{ . }}
|
|
{{- end }}
|
|
{{- with .Values.server.autoscaling.targetCPUUtilizationPercentage }}
|
|
- type: Resource
|
|
resource:
|
|
name: cpu
|
|
targetAverageUtilization: {{ . }}
|
|
{{- end }}
|
|
{{- end }}
|