feat(argo-cd): Set ARGOCD_CONTROLLER_REPLICAS automatically (#1413)

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>
pull/1424/head argo-cd-5.3.1
Petr Drastil 2022-08-25 13:35:17 +02:00 committed by GitHub
parent 31e0156992
commit 4e9663c747
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 41 additions and 47 deletions

View File

@ -2,7 +2,7 @@ apiVersion: v2
appVersion: v2.4.11
description: A Helm chart for Argo CD, a declarative, GitOps continuous delivery tool for Kubernetes.
name: argo-cd
version: 5.3.0
version: 5.3.1
home: https://github.com/argoproj/argo-helm
icon: https://argo-cd.readthedocs.io/en/stable/assets/logo.png
keywords:
@ -21,5 +21,4 @@ dependencies:
condition: redis-ha.enabled
annotations:
artifacthub.io/changes: |
- "[Added]: Global configuration for logging"
- "[Added]: ApplicationSet configuration for logging"
- "[Changed]: Env variable ARGOCD_CONTROLLER_REPLICAS is now automatically set by replica count"

View File

@ -437,7 +437,7 @@ NAME: my-release
| controller.readinessProbe.periodSeconds | int | `10` | How often (in seconds) to perform the [probe] |
| controller.readinessProbe.successThreshold | int | `1` | Minimum consecutive successes for the [probe] to be considered successful after having failed |
| controller.readinessProbe.timeoutSeconds | int | `1` | Number of seconds after which the [probe] times out |
| controller.replicas | int | `1` | The number of application controller pods to run. If changing the number of replicas you must pass the number as `ARGOCD_CONTROLLER_REPLICAS` as an environment variable |
| controller.replicas | int | `1` | The number of application controller pods to run. Additional replicas will cause sharding of managed clusters across number of replicas. |
| controller.resources | object | `{}` | Resource limits and requests for the application controller pods |
| controller.service.annotations | object | `{}` | Application controller service annotations |
| controller.service.labels | object | `{}` | Application controller service labels |

View File

@ -265,17 +265,13 @@ Return the default Argo CD app version
{{- end -}}
{{- define "argo-cd.redisPasswordEnv" -}}
{{- if or .Values.externalRedis.password .Values.externalRedis.existingSecret }}
{{- if or .Values.externalRedis.password .Values.externalRedis.existingSecret -}}
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
{{- if .Values.externalRedis.existingSecret }}
name: {{ .Values.externalRedis.existingSecret }}
{{- else }}
name: {{ template "argo-cd.redis.fullname" . }}
{{- end }}
name: {{ default (include "argo-cd.redis.fullname" .) .Values.externalRedis.existingSecret }}
key: redis-password
{{- end }}
{{- end -}}
{{- end -}}
{{/*

View File

@ -68,23 +68,25 @@ spec:
- {{ .Values.externalRedis.host }}:{{ .Values.externalRedis.port }}
{{- end }}
{{- with .Values.controller.extraArgs }}
{{- . | toYaml | nindent 8 }}
{{- toYaml . | nindent 8 }}
{{- end }}
image: {{ default .Values.global.image.repository .Values.controller.image.repository }}:{{ default (include "argo-cd.defaultTag" .) .Values.controller.image.tag }}
imagePullPolicy: {{ default .Values.global.image.imagePullPolicy .Values.controller.image.imagePullPolicy }}
name: {{ .Values.controller.name }}
{{- if .Values.controller.containerSecurityContext }}
securityContext: {{- toYaml .Values.controller.containerSecurityContext | nindent 10 }}
{{- with .Values.controller.containerSecurityContext }}
securityContext:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- if or .Values.controller.env .Values.externalRedis.password .Values.externalRedis.existingSecret }}
env:
{{- include "argo-cd.redisPasswordEnv" . | nindent 8 }}
{{- with .Values.controller.env }}
{{- toYaml . | nindent 8 }}
{{- toYaml . | nindent 10 }}
{{- end }}
{{- end }}
- name: ARGOCD_CONTROLLER_REPLICAS
value: {{ .Values.controller.replicas | quote }}
{{- include "argo-cd.redisPasswordEnv" . | nindent 10 }}
{{- with .Values.controller.envFrom }}
envFrom: {{- toYaml . | nindent 8 }}
envFrom:
{{- toYaml . | nindent 10 }}
{{- end }}
ports:
- name: controller
@ -121,29 +123,29 @@ spec:
{{- with .Values.controller.extraContainers }}
{{- toYaml . | nindent 6 }}
{{- end }}
{{- if .Values.controller.nodeSelector }}
{{- with .Values.controller.nodeSelector }}
nodeSelector:
{{- toYaml .Values.controller.nodeSelector | nindent 8 }}
{{- end }}
{{- if .Values.controller.tolerations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.controller.tolerations }}
tolerations:
{{- toYaml .Values.controller.tolerations | nindent 8 }}
{{- end }}
{{- if .Values.controller.affinity }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.controller.affinity }}
affinity:
{{- toYaml .Values.controller.affinity | nindent 8 }}
{{- end }}
{{- with .Values.controller.topologySpreadConstraints }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.controller.topologySpreadConstraints }}
topologySpreadConstraints:
{{- range $constraint := . }}
- {{ toYaml $constraint | nindent 8 | trim }}
{{- if not $constraint.labelSelector }}
labelSelector:
matchLabels:
{{- include "argo-cd.selectorLabels" (dict "context" $ "name" $.Values.controller.name) | nindent 12 }}
{{- range $constraint := . }}
- {{ toYaml $constraint | nindent 8 | trim }}
{{- if not $constraint.labelSelector }}
labelSelector:
matchLabels:
{{- include "argo-cd.selectorLabels" (dict "context" $ "name" $.Values.controller.name) | nindent 12 }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
serviceAccountName: {{ template "argo-cd.controllerServiceAccountName" . }}
{{- with .Values.global.hostAliases }}
hostAliases:
@ -164,12 +166,12 @@ spec:
optional: true
secretName: argocd-repo-server-tls
{{- with .Values.controller.volumes }}
{{- toYaml . | nindent 6 }}
{{- toYaml . | nindent 6 }}
{{- end }}
{{- if .Values.controller.initContainers }}
{{- with .Values.controller.initContainers }}
initContainers:
{{- toYaml .Values.controller.initContainers | nindent 6 }}
{{- toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.controller.priorityClassName }}
priorityClassName: {{ . }}
{{- end }}
{{- if .Values.controller.priorityClassName }}
priorityClassName: {{ .Values.controller.priorityClassName }}
{{- end }}

View File

@ -119,7 +119,7 @@ controller:
imagePullPolicy: ""
# -- The number of application controller pods to run.
# If changing the number of replicas you must pass the number as `ARGOCD_CONTROLLER_REPLICAS` as an environment variable
# Additional replicas will cause sharding of managed clusters across number of replicas.
replicas: 1
## Application controller commandline flags
@ -146,10 +146,7 @@ controller:
extraArgs: []
# -- Environment variables to pass to application controller
env:
[]
# - name: "ARGOCD_CONTROLLER_REPLICAS"
# value: ""
env: []
# -- envFrom to pass to application controller
# @default -- `[]` (See [values.yaml])