argocd-helm/charts/argo-workflows/templates/server/server-deployment-hpa.yaml
ryanpark0203 c8b47cf060
fix(argo-workflows): Fix Helm chart to correctly reference Kubernetes version in conditional check for HPA apiVersion (#2029)
* add a fix for argo workflows hpa

Signed-off-by: ryanpark0203 <108246291+ryanpark0203@users.noreply.github.com>

* add description for the fix

Signed-off-by: ryanpark0203 <108246291+ryanpark0203@users.noreply.github.com>

* update readme

Signed-off-by: ryanpark0203 <108246291+ryanpark0203@users.noreply.github.com>

* remove apiVersionOverrides from readme

Signed-off-by: ryanpark0203 <108246291+ryanpark0203@users.noreply.github.com>

* fix linting

Signed-off-by: ryanpark0203 <108246291+ryanpark0203@users.noreply.github.com>

---------

Signed-off-by: ryanpark0203 <108246291+ryanpark0203@users.noreply.github.com>
Co-authored-by: Aikawa <yu.croco@gmail.com>
Co-authored-by: Jason Meridth <jmeridth@gmail.com>
2023-05-09 12:41:54 +09:00

45 lines
1.6 KiB
YAML

{{- if and .Values.server.enabled .Values.server.autoscaling.enabled }}
apiVersion: {{ include "argo-workflows.apiVersion.autoscaling" . }}
kind: HorizontalPodAutoscaler
metadata:
name: {{ template "argo-workflows.server.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
labels:
{{- include "argo-workflows.labels" (dict "context" . "component" .Values.server.name "name" .Values.server.name) | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ template "argo-workflows.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-workflows.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-workflows.apiVersion.autoscaling" $) "autoscaling/v2beta1" }}
targetAverageUtilization: {{ . }}
{{- else }}
target:
averageUtilization: {{ . }}
type: Utilization
{{- end }}
{{- end }}
{{- with .Values.server.autoscaling.behavior }}
behavior:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}