feat: Add pre defined values for HPA in Argo Rollouts controller

Signed-off-by: vitor.cassiano <vitor.cassiano@picpay.com>
This commit is contained in:
vitor.cassiano 2024-05-16 12:50:26 -03:00
parent d71c2a214a
commit cbc2b89815
3 changed files with 30 additions and 13 deletions

View file

@ -109,11 +109,3 @@ Return the appropriate apiVersion for pod disruption budget
{{- print "policy/v1" -}}
{{- end -}}
{{- end -}}
{{/*
Expand the namespace of the release.
Allows overriding it for multi-namespace deployments in combined charts.
*/}}
{{- define "argo-rollouts.namespace" -}}
{{- default .Release.Namespace .Values.namespaceOverride | trunc 63 | trimSuffix "-" -}}
{{- end }}

View file

@ -3,9 +3,10 @@ apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "argo-rollouts.fullname" . }}
namespace: {{ include "argo-rollouts.namespace" . }}
namespace: {{ .Release.Namespace | quote }}
labels:
{{- include "argo-rollouts.labels" (dict "context" .) | nindent 4 }}
app.kubernetes.io/component: {{ .Values.controller.component }}
{{- include "argo-rollouts.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1

View file

@ -61,12 +61,36 @@ controller:
tolerations: []
# -- Assign custom [affinity] rules to the deployment
affinity: {}
# -- Argo Rollouts controller HPA
autoscaling:
enabled: true
minReplicas: 1
maxReplicas: 2
# -- Enable Horizontal Pod Autoscaler ([HPA]) for the Argo Rollouts controller
enabled: false
# -- Minimum number of replicas for the Argo Rollouts controller [HPA]
minReplicas: 2
# -- Maximum number of replicas for the Argo Rollouts controller [HPA]
maxReplicas: 10
# -- Average CPU utilization percentage for the Argo Rollouts controller [HPA]
targetCPUUtilizationPercentage: 80
# -- Average memory utilization percentage for the Argo Rollouts controller [HPA]
targetMemoryUtilizationPercentage: 80
# -- Configures the scaling behavior of the target in both Up and Down directions.
behavior: {}
# scaleDown:
# stabilizationWindowSeconds: 300
# policies:
# - type: Pods
# value: 1
# periodSeconds: 180
# scaleUp:
# stabilizationWindowSeconds: 300
# policies:
# - type: Pods
# value: 2
# periodSeconds: 60
# -- Configures custom HPA metrics for the Argo Rollouts controller
# Ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/
metrics: []
logging:
# -- Set the logging level (one of: `debug`, `info`, `warn`, `error`)
level: info