Skip to content

Commit

Permalink
[bitnami/argo-cd] Add support for dynamic cluster distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Nitze committed Jul 5, 2024
1 parent d788350 commit 63cad23
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
2 changes: 2 additions & 0 deletions bitnami/argo-cd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,8 @@ As an alternative, use one of the preset configurations for pod affinity, pod an
| `controller.defaultArgs.selfHealTimeout` | Default self heal timeout for Argo CD controller | `5` |
| `controller.args` | Override default container args (useful when using custom images). Overrides the defaultArgs. | `[]` |
| `controller.extraArgs` | Add extra arguments to the default arguments for the Argo CD controller | `[]` |
| `controller.dynamicClusterDistribution.enabled` | Whether dynamic cluster distribution is enabled. | `false` |
| `controller.dynamicClusterDistribution.heartbeatDuration` | Time to update the cluster sharding (defaults to 10 seconds). | `""` |
| `controller.automountServiceAccountToken` | Mount Service Account token in pod | `true` |
| `controller.hostAliases` | Argo CD pods host aliases | `[]` |
| `controller.podLabels` | Extra labels for Argo CD pods | `{}` |
Expand Down
6 changes: 5 additions & 1 deletion bitnami/argo-cd/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,12 @@ Return the Redis® port
Validate Application Controller config
*/}}
{{- define "argocd.validateValues.controller.config" -}}
{{- if and (gt .Values.controller.replicaCount 1) (not (eq .Values.controller.kind "StatefulSet")) }}
{{- if gt .Values.controller.replicaCount 1 }}
{{- if and .Values.controller.dynamicClusterDistribution.enabled (not (eq .Values.controller.kind "Deployment")) }}
Argo CD: When running in HA mode with dynamic cluster distribution enabled, the application controller must be installed as a Deployment.
{{- else if and (not .Values.controller.dynamicClusterDistribution.enabled) (not (eq .Values.controller.kind "StatefulSet")) }}
Argo CD: When running in HA mode, the application controller must be installed as a StatefulSet.
{{- end -}}
{{- end -}}
{{- end -}}

Expand Down
8 changes: 8 additions & 0 deletions bitnami/argo-cd/templates/application-controller/_pod.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,14 @@ containers:
- name: ARGOCD_CONTROLLER_REPLICAS
value: {{ .Values.controller.replicaCount | quote }}
{{- end }}
{{- if .Values.controller.dynamicClusterDistribution.enabled }}
- name: ARGOCD_ENABLE_DYNAMIC_CLUSTER_DISTRIBUTION
value: "true"
{{- if .Values.controller.dynamicClusterDistribution.heartbeatDuration }}
- name: ARGOCD_CONTROLLER_HEARTBEAT_TIME
value: {{ .Values.controller.dynamicClusterDistribution.heartbeatDuration | quote }}
{{- end }}
{{- end }}
{{- if and .Values.redis.enabled (include "argocd.redis.auth.enabled" .) }}
- name: REDIS_PASSWORD
valueFrom:
Expand Down
10 changes: 10 additions & 0 deletions bitnami/argo-cd/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,16 @@ controller:
## @param controller.extraArgs Add extra arguments to the default arguments for the Argo CD controller
##
extraArgs: []
## ref: https://argo-cd.readthedocs.io/en/stable/operator-manual/dynamic-cluster-distribution/
##
dynamicClusterDistribution:
## @param controller.dynamicClusterDistribution.enabled Whether dynamic cluster distribution is enabled.
##
enabled: false
## @param controller.dynamicClusterDistribution.heartbeatDuration Time to update the cluster sharding (defaults to 10 seconds).
## ref: https://argo-cd.readthedocs.io/en/stable/operator-manual/dynamic-cluster-distribution/#working-of-dynamic-distribution
##
heartbeatDuration: ""
## @param controller.automountServiceAccountToken Mount Service Account token in pod
##
automountServiceAccountToken: true
Expand Down

0 comments on commit 63cad23

Please sign in to comment.