2022-10-31 15:52:45 +00:00
|
|
|
{{- if .Values.server.autoscaling.enabled }}
|
|
|
|
apiVersion: {{ include "argo-cd.apiVersion.autoscaling" . }}
|
|
|
|
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
|
2023-04-18 16:35:01 +00:00
|
|
|
namespace: {{ .Release.Namespace | quote }}
|
2022-10-31 15:52:45 +00:00
|
|
|
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.apiVersion.autoscaling" $) "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.apiVersion.autoscaling" $) "autoscaling/v2beta1" }}
|
|
|
|
targetAverageUtilization: {{ . }}
|
|
|
|
{{- else }}
|
|
|
|
target:
|
|
|
|
averageUtilization: {{ . }}
|
|
|
|
type: Utilization
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .Values.server.autoscaling.behavior }}
|
|
|
|
behavior:
|
|
|
|
{{- toYaml . | nindent 4 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|