Skip to content

Commit b97e652

Browse files
feat(argo-cd): Add ability to annotate Deployments and StatefulSets (argoproj#1608)
* feat(argo-cd): Add ability to annotate Deployments and StatefulSets Signed-off-by: John Stewart <[email protected]> * fix: Controller and AppSet controller was mixed Signed-off-by: Marco Kilchhofer <[email protected]> Signed-off-by: John Stewart <[email protected]> Signed-off-by: Marco Kilchhofer <[email protected]> Co-authored-by: Marco Kilchhofer <[email protected]>
1 parent f25cda3 commit b97e652

File tree

11 files changed

+88
-7
lines changed

11 files changed

+88
-7
lines changed

charts/argo-cd/Chart.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ appVersion: v2.5.3
33
kubeVersion: ">=1.22.0-0"
44
description: A Helm chart for Argo CD, a declarative, GitOps continuous delivery tool for Kubernetes.
55
name: argo-cd
6-
version: 5.15.2
6+
version: 5.16.0
77
home: https://github.com/argoproj/argo-helm
88
icon: https://argo-cd.readthedocs.io/en/stable/assets/logo.png
99
sources:
@@ -23,7 +23,4 @@ dependencies:
2323
condition: redis-ha.enabled
2424
annotations:
2525
artifacthub.io/changes: |
26-
- "[Changed]: ApplicationSet now automatically detects leader election"
27-
- "[Changed]: Simplified ApplicationSet RBAC rules"
28-
- "[Removed]: Configuration option applicationset.args.debug"
29-
- "[Removed]: Configuration option applicationset.args.enableLeaderElection"
26+
- "[Added]: Ability to annotate Deployment and Statefulset objects for all components"

charts/argo-cd/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ NAME: my-release
376376
| Key | Type | Default | Description |
377377
|-----|------|---------|-------------|
378378
| global.additionalLabels | object | `{}` | Common labels for the all resources |
379+
| global.deploymentAnnotations | object | `{}` | Annotations for the all deployed Deployments |
379380
| global.hostAliases | list | `[]` | Mapping between IP and hostnames that will be injected as entries in the pod's hosts files |
380381
| global.image.imagePullPolicy | string | `"IfNotPresent"` | If defined, a imagePullPolicy applied to all Argo CD deployments |
381382
| global.image.repository | string | `"quay.io/argoproj/argocd"` | If defined, a repository applied to all Argo CD deployments |
@@ -389,6 +390,7 @@ NAME: my-release
389390
| global.podLabels | object | `{}` | Labels for the all deployed pods |
390391
| global.revisionHistoryLimit | int | `3` | Number of old deployment ReplicaSets to retain. The rest will be garbage collected. |
391392
| global.securityContext | object | `{}` (See [values.yaml]) | Toggle and define pod-level security context. |
393+
| global.statefulsetAnnotations | object | `{}` | Annotations for the all deployed Statefulsets |
392394

393395
## Argo CD Configs
394396

@@ -506,6 +508,7 @@ NAME: my-release
506508
| controller.serviceAccount.create | bool | `true` | Create a service account for the application controller |
507509
| controller.serviceAccount.labels | object | `{}` | Labels applied to created service account |
508510
| controller.serviceAccount.name | string | `"argocd-application-controller"` | Service account name |
511+
| controller.statefulsetAnnotations | object | `{}` | Annotations for the application controller StatefulSet |
509512
| controller.tolerations | list | `[]` | [Tolerations] for use with node taints |
510513
| controller.topologySpreadConstraints | list | `[]` | Assign custom [TopologySpreadConstraints] rules to the application controller |
511514
| controller.volumeMounts | list | `[]` | Additional volumeMounts to the application controller main container |
@@ -533,6 +536,7 @@ NAME: my-release
533536
| repoServer.clusterRoleRules.rules | list | `[]` | List of custom rules for the Repo server's Cluster Role resource |
534537
| repoServer.containerPort | int | `8081` | Configures the repo server port |
535538
| repoServer.containerSecurityContext | object | See [values.yaml] | Repo server container-level security context |
539+
| repoServer.deploymentAnnotations | object | `{}` | Annotations to be added to repo server Deployment |
536540
| repoServer.env | list | `[]` | Environment variables to pass to repo server |
537541
| repoServer.envFrom | list | `[]` (See [values.yaml]) | envFrom to pass to repo server |
538542
| repoServer.extraArgs | list | `[]` | Additional command line arguments to pass to repo server |
@@ -632,6 +636,7 @@ NAME: my-release
632636
| server.clusterAdminAccess.enabled | bool | `true` | Enable RBAC for local cluster deployments |
633637
| server.containerPort | int | `8080` | Configures the server port |
634638
| server.containerSecurityContext | object | See [values.yaml] | Server container-level security context |
639+
| server.deploymentAnnotations | object | `{}` | Annotations to be added to server Deployment |
635640
| server.env | list | `[]` | Environment variables to pass to Argo CD server |
636641
| server.envFrom | list | `[]` (See [values.yaml]) | envFrom to pass to Argo CD server |
637642
| server.extensions.containerSecurityContext | object | See [values.yaml] | Server UI extensions container-level security context |
@@ -775,6 +780,7 @@ server:
775780
| dex.containerPortHttp | int | `5556` | Container port for HTTP access |
776781
| dex.containerPortMetrics | int | `5558` | Container port for metrics access |
777782
| dex.containerSecurityContext | object | See [values.yaml] | Dex container-level security context |
783+
| dex.deploymentAnnotations | object | `{}` | Annotations to be added to the Dex server Deployment |
778784
| dex.enabled | bool | `true` | Enable dex |
779785
| dex.env | list | `[]` | Environment variables to pass to the Dex server |
780786
| dex.envFrom | list | `[]` (See [values.yaml]) | envFrom to pass to the Dex server |
@@ -848,6 +854,7 @@ server:
848854
| redis.affinity | object | `{}` | Assign custom [affinity] rules to the deployment |
849855
| redis.containerPort | int | `6379` | Redis container port |
850856
| redis.containerSecurityContext | object | See [values.yaml] | Redis container-level security context |
857+
| redis.deploymentAnnotations | object | `{}` | Annotations to be added to the Redis server Deployment |
851858
| redis.enabled | bool | `true` | Enable redis |
852859
| redis.env | list | `[]` | Environment variables to pass to the Redis server |
853860
| redis.envFrom | list | `[]` (See [values.yaml]) | envFrom to pass to the Redis server |
@@ -955,6 +962,7 @@ If you want to use an existing Redis (eg. a managed service from a cloud provide
955962
| applicationSet.args.policy | string | `"sync"` | How application is synced between the generator and the cluster |
956963
| applicationSet.args.probeBindAddr | string | `":8081"` | The default health check port |
957964
| applicationSet.containerSecurityContext | object | See [values.yaml] | ApplicationSet controller container-level security context |
965+
| applicationSet.deploymentAnnotations | object | `{}` | Annotations to be added to ApplicationSet controller Deployment |
958966
| applicationSet.enabled | bool | `true` | Enable ApplicationSet controller |
959967
| applicationSet.extraArgs | list | `[]` | List of extra cli args to add |
960968
| applicationSet.extraContainers | list | `[]` | Additional containers to be added to the applicationset controller pod |
@@ -1056,6 +1064,7 @@ If you want to use an existing Redis (eg. a managed service from a cloud provide
10561064
| notifications.cm.create | bool | `true` | Whether helm chart creates controller config map |
10571065
| notifications.containerSecurityContext | object | See [values.yaml] | Notification controller container-level security Context |
10581066
| notifications.context | object | `{}` | Define user-defined context |
1067+
| notifications.deploymentAnnotations | object | `{}` | Annotations to be applied to the notifications controller Deployment |
10591068
| notifications.enabled | bool | `true` | Enable notifications controller |
10601069
| notifications.extraArgs | list | `[]` | Extra arguments to provide to the controller |
10611070
| notifications.extraEnv | list | `[]` | Additional container environment variables |

charts/argo-cd/templates/argocd-application-controller/statefulset.yaml

100755100644
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
apiVersion: apps/v1
22
kind: StatefulSet
33
metadata:
4-
name: {{ include "argo-cd.controller.fullname" . }}
4+
{{- with (mergeOverwrite (deepCopy .Values.global.statefulsetAnnotations) .Values.controller.statefulsetAnnotations) }}
5+
annotations:
6+
{{- range $key, $value := . }}
7+
{{ $key }}: {{ $value | quote }}
8+
{{- end }}
9+
{{- end }}
10+
name: {{ template "argo-cd.controller.fullname" . }}
511
labels:
612
{{- include "argo-cd.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }}
713
spec:

charts/argo-cd/templates/argocd-applicationset/deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
apiVersion: apps/v1
33
kind: Deployment
44
metadata:
5+
{{- with (mergeOverwrite (deepCopy .Values.global.deploymentAnnotations) .Values.applicationSet.deploymentAnnotations) }}
6+
annotations:
7+
{{- range $key, $value := . }}
8+
{{ $key }}: {{ $value | quote }}
9+
{{- end }}
10+
{{- end }}
511
name: {{ include "argo-cd.applicationSet.fullname" . }}
612
labels:
713
{{- include "argo-cd.labels" (dict "context" . "component" .Values.applicationSet.name "name" .Values.applicationSet.name) | nindent 4 }}

charts/argo-cd/templates/argocd-notifications/bots/slack/deployment.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22
apiVersion: apps/v1
33
kind: Deployment
44
metadata:
5-
name: {{ include "argo-cd.notifications.fullname" . }}-bot
5+
{{- with (mergeOverwrite (deepCopy .Values.global.deploymentAnnotations) .Values.notifications.deploymentAnnotations) }}
6+
annotations:
7+
{{- range $key, $value := . }}
8+
{{ $key }}: {{ $value | quote }}
9+
{{- end }}
10+
{{- end }}
11+
name: {{ template "argo-cd.notifications.fullname" . }}-bot
612
labels:
713
{{- include "argo-cd.labels" (dict "context" . "component" .Values.notifications.bots.slack.name "name" .Values.notifications.bots.slack.name) | nindent 4 }}
814
spec:

charts/argo-cd/templates/argocd-notifications/deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
apiVersion: apps/v1
33
kind: Deployment
44
metadata:
5+
{{- with (mergeOverwrite (deepCopy .Values.global.deploymentAnnotations) .Values.notifications.deploymentAnnotations) }}
6+
annotations:
7+
{{- range $key, $value := . }}
8+
{{ $key }}: {{ $value | quote }}
9+
{{- end }}
10+
{{- end }}
511
name: {{ include "argo-cd.notifications.fullname" . }}
612
labels:
713
{{- include "argo-cd.labels" (dict "context" . "component" .Values.notifications.name "name" .Values.notifications.name) | nindent 4 }}

charts/argo-cd/templates/argocd-repo-server/deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
apiVersion: apps/v1
22
kind: Deployment
33
metadata:
4+
{{- with (mergeOverwrite (deepCopy .Values.global.deploymentAnnotations) .Values.repoServer.deploymentAnnotations) }}
5+
annotations:
6+
{{- range $key, $value := . }}
7+
{{ $key }}: {{ $value | quote }}
8+
{{- end }}
9+
{{- end }}
410
name: {{ template "argo-cd.repoServer.fullname" . }}
511
labels:
612
{{- include "argo-cd.labels" (dict "context" . "component" .Values.repoServer.name "name" .Values.repoServer.name) | nindent 4 }}

charts/argo-cd/templates/argocd-server/deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
apiVersion: apps/v1
22
kind: Deployment
33
metadata:
4+
{{- with (mergeOverwrite (deepCopy .Values.global.deploymentAnnotations) .Values.server.deploymentAnnotations) }}
5+
annotations:
6+
{{- range $key, $value := . }}
7+
{{ $key }}: {{ $value | quote }}
8+
{{- end }}
9+
{{- end }}
410
name: {{ template "argo-cd.server.fullname" . }}
511
labels:
612
{{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" .Values.server.name) | nindent 4 }}

charts/argo-cd/templates/dex/deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
apiVersion: apps/v1
33
kind: Deployment
44
metadata:
5+
{{- with (mergeOverwrite (deepCopy .Values.global.deploymentAnnotations) .Values.dex.deploymentAnnotations) }}
6+
annotations:
7+
{{- range $key, $value := . }}
8+
{{ $key }}: {{ $value | quote }}
9+
{{- end }}
10+
{{- end }}
511
name: {{ template "argo-cd.dex.fullname" . }}
612
labels:
713
{{- include "argo-cd.labels" (dict "context" . "component" .Values.dex.name "name" .Values.dex.name) | nindent 4 }}

charts/argo-cd/templates/redis/deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
apiVersion: apps/v1
44
kind: Deployment
55
metadata:
6+
{{- with (mergeOverwrite (deepCopy .Values.global.deploymentAnnotations) .Values.redis.deploymentAnnotations) }}
7+
annotations:
8+
{{- range $key, $value := . }}
9+
{{ $key }}: {{ $value | quote }}
10+
{{- end }}
11+
{{- end }}
612
name: {{ include "argo-cd.redis.fullname" . }}
713
labels:
814
{{- include "argo-cd.labels" (dict "context" . "component" .Values.redis.name "name" .Values.redis.name) | nindent 4 }}

0 commit comments

Comments
 (0)