From f10234f340d4f7e2858efbc9bd7b95453c931d0e Mon Sep 17 00:00:00 2001 From: Takumi Sue <23391543+mikutas@users.noreply.github.com> Date: Fri, 17 Sep 2021 02:59:20 +0900 Subject: [PATCH] feat(argo-cd): add extraContainers to pods besides server (#927) * feat(argo-cd): add extraContainers to pods besides server Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> * Apply suggestions from code review Signed-off-by: Marco Kilchhofer Co-authored-by: Marco Kilchhofer --- charts/argo-cd/Chart.yaml | 4 ++-- charts/argo-cd/README.md | 4 ++++ .../argocd-application-controller/deployment.yaml | 5 ++++- .../templates/argocd-repo-server/deployment.yaml | 5 ++++- .../argo-cd/templates/argocd-server/deployment.yaml | 12 ++++++------ charts/argo-cd/templates/dex/deployment.yaml | 5 ++++- charts/argo-cd/templates/redis/deployment.yaml | 3 +++ charts/argo-cd/values.yaml | 11 +++++++++++ 8 files changed, 38 insertions(+), 11 deletions(-) diff --git a/charts/argo-cd/Chart.yaml b/charts/argo-cd/Chart.yaml index d52a3863..f37108cf 100644 --- a/charts/argo-cd/Chart.yaml +++ b/charts/argo-cd/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: 2.1.2 description: A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes. name: argo-cd -version: 3.17.7 +version: 3.18.0 home: https://github.com/argoproj/argo-helm icon: https://argoproj.github.io/argo-cd/assets/logo.png keywords: @@ -21,4 +21,4 @@ dependencies: condition: redis-ha.enabled annotations: artifacthub.io/changes: | - - "[Fixed]: global podLabels/podAnnotations object unexpected merge" + - "[Added]: extraContainers values were added to pods besides server" diff --git a/charts/argo-cd/README.md b/charts/argo-cd/README.md index 99114a91..0a9f5cad 100644 --- a/charts/argo-cd/README.md +++ b/charts/argo-cd/README.md @@ -188,6 +188,7 @@ NAME: my-release | controller.clusterAdminAccess.enabled | Enable RBAC for local cluster deployments. | `true` | | controller.containerPort | Controller listening port. | `8082` | | controller.extraArgs | Additional arguments for the controller. A list of flags | `[]` | +| controller.extraContainers | Additional containers for the controller. A list of containers. | `[]` | | controller.enableStatefulSet | Enable deploying the controller as a StatefulSet instead of a Deployment. Used for HA installations. | `false` | | controller.env | Environment variables for the controller. | `[]` | | controller.envFrom | `envFrom` to pass to the controller. | `[]` (See [values.yaml](values.yaml)) | @@ -243,6 +244,7 @@ NAME: my-release | repoServer.autoscaling.targetMemoryUtilizationPercentage | Average memory utilization percentage for the repo server [HPA](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) | `50` | | repoServer.containerPort | Repo server port | `8081` | | repoServer.extraArgs | Additional arguments for the repo server. A list of flags. | `[]` | +| repoServer.extraContainers | Additional containers for the repo server. A list of containers. | `[]` | | repoServer.env | Environment variables for the repo server. | `[]` | | repoServer.envFrom | `envFrom` to pass to the repo server. | `[]` (See [values.yaml](values.yaml)) | | repoServer.image.repository | Repository to use for the repo server | `global.image.repository` | @@ -402,6 +404,7 @@ NAME: my-release | dex.metrics.serviceMonitor.relabelings | Prometheus [RelabelConfigs](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config) to apply to samples before scraping | `[]` | | dex.metrics.serviceMonitor.metricRelabelings | Prometheus [MetricRelabelConfigs](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs) to apply to samples before ingestion | `[]` | | dex.name | Dex name | `"dex-server"` | +| dex.extraContainers | Additional containers for the Dex server. A list of containers. | `[]` | | dex.env | Environment variables for the Dex server. | `[]` | | dex.envFrom | `envFrom` to pass to the Dex server. | `[]` (See [values.yaml](values.yaml)) | | dex.nodeSelector | [Node selector](https://kubernetes.io/docs/user-guide/node-selection/) | `{}` | @@ -449,6 +452,7 @@ through `xxx.extraArgs` | redis.image.repository | Redis repository | `"redis"` | | redis.image.tag | Redis tag | `"6.2.1-alpine"` | | redis.extraArgs | Additional arguments for the `redis-server`. A list of flags. | `[]` | +| redis.extraContainers | Additional containers for the redis. A list of containers. | `[]` | | redis.name | Redis name | `"redis"` | | redis.env | Environment variables for the Redis server. | `[]` | | redis.envFrom | `envFrom` to pass to the Redis server. | `[]` (See [values.yaml](values.yaml)) | diff --git a/charts/argo-cd/templates/argocd-application-controller/deployment.yaml b/charts/argo-cd/templates/argocd-application-controller/deployment.yaml index b188892b..f0ab071f 100755 --- a/charts/argo-cd/templates/argocd-application-controller/deployment.yaml +++ b/charts/argo-cd/templates/argocd-application-controller/deployment.yaml @@ -105,7 +105,10 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} resources: -{{- toYaml .Values.controller.resources | nindent 10 }} + {{- toYaml .Values.controller.resources | nindent 10 }} + {{- with .Values.controller.extraContainers }} + {{- toYaml . | nindent 6 }} + {{- end }} {{- if .Values.controller.nodeSelector }} nodeSelector: {{- toYaml .Values.controller.nodeSelector | nindent 8 }} diff --git a/charts/argo-cd/templates/argocd-repo-server/deployment.yaml b/charts/argo-cd/templates/argocd-repo-server/deployment.yaml index 07553973..38cbfcb0 100755 --- a/charts/argo-cd/templates/argocd-repo-server/deployment.yaml +++ b/charts/argo-cd/templates/argocd-repo-server/deployment.yaml @@ -113,7 +113,10 @@ spec: successThreshold: {{ .Values.repoServer.readinessProbe.successThreshold }} failureThreshold: {{ .Values.repoServer.readinessProbe.failureThreshold }} resources: -{{- toYaml .Values.repoServer.resources | nindent 10 }} + {{- toYaml .Values.repoServer.resources | nindent 10 }} + {{- with .Values.controller.extraContainers }} + {{- toYaml . | nindent 6 }} + {{- end }} {{- if .Values.repoServer.nodeSelector }} nodeSelector: {{- toYaml .Values.repoServer.nodeSelector | nindent 8 }} diff --git a/charts/argo-cd/templates/argocd-server/deployment.yaml b/charts/argo-cd/templates/argocd-server/deployment.yaml index cbb31207..771e7c3b 100755 --- a/charts/argo-cd/templates/argocd-server/deployment.yaml +++ b/charts/argo-cd/templates/argocd-server/deployment.yaml @@ -120,14 +120,14 @@ spec: successThreshold: {{ .Values.server.readinessProbe.successThreshold }} failureThreshold: {{ .Values.server.readinessProbe.failureThreshold }} resources: -{{- toYaml .Values.server.resources | nindent 10 }} - {{- if .Values.server.lifecycle }} + {{- toYaml .Values.server.resources | nindent 10 }} + {{- if .Values.server.lifecycle }} lifecycle: -{{- toYaml .Values.server.lifecycle | nindent 10 }} + {{- toYaml .Values.server.lifecycle | nindent 10 }} + {{- end }} + {{- with .Values.server.extraContainers }} + {{- toYaml . | nindent 6 }} {{- end }} - {{- if .Values.server.extraContainers }} -{{- toYaml .Values.server.extraContainers | nindent 6 }} - {{- end }} {{- if .Values.server.nodeSelector }} nodeSelector: {{- toYaml .Values.server.nodeSelector | nindent 8 }} diff --git a/charts/argo-cd/templates/dex/deployment.yaml b/charts/argo-cd/templates/dex/deployment.yaml index 6eb0281b..9c409399 100755 --- a/charts/argo-cd/templates/dex/deployment.yaml +++ b/charts/argo-cd/templates/dex/deployment.yaml @@ -99,7 +99,10 @@ spec: {{- toYaml .Values.dex.volumeMounts | nindent 8 }} {{- end }} resources: -{{- toYaml .Values.dex.resources | nindent 10 }} + {{- toYaml .Values.dex.resources | nindent 10 }} + {{- with .Values.dex.extraContainers }} + {{- toYaml . | nindent 6 }} + {{- end }} {{- if .Values.dex.nodeSelector }} nodeSelector: {{- toYaml .Values.dex.nodeSelector | nindent 8 }} diff --git a/charts/argo-cd/templates/redis/deployment.yaml b/charts/argo-cd/templates/redis/deployment.yaml index 9ad7d662..77169592 100755 --- a/charts/argo-cd/templates/redis/deployment.yaml +++ b/charts/argo-cd/templates/redis/deployment.yaml @@ -64,6 +64,9 @@ spec: {{- end }} resources: {{- toYaml .Values.redis.resources | nindent 10 }} + {{- with .Values.redis.extraContainers }} + {{- toYaml . | nindent 6 }} + {{- end }} {{- if .Values.redis.nodeSelector }} nodeSelector: {{- toYaml .Values.redis.nodeSelector | nindent 8 }} diff --git a/charts/argo-cd/values.yaml b/charts/argo-cd/values.yaml index 022ecfb2..38421dad 100755 --- a/charts/argo-cd/values.yaml +++ b/charts/argo-cd/values.yaml @@ -220,6 +220,8 @@ controller: enabled: false rules: [] + ## Additional containers to be added to the controller pod. + extraContainers: [] ## Dex dex: @@ -339,6 +341,9 @@ dex: # cpu: 10m # memory: 32Mi + ## Additional containers to be added to the dex pod. + extraContainers: [] + ## Redis redis: enabled: true @@ -419,6 +424,9 @@ redis: volumeMounts: [] volumes: [] + ## Additional containers to be added to the redis pod. + extraContainers: [] + # This key configures Redis-HA subchart and when enabled (redis-ha.enabled=true) # the custom redis deployment is omitted redis-ha: @@ -992,6 +1000,9 @@ repoServer: ## Automount API credentials for the Service Account automountServiceAccountToken: true + ## Additional containers to be added to the repo server pod. + extraContainers: [] + ## Repo server rbac rules # rbac: # - apiGroups: