From 32d86666beca6f7584a6f7b8f6d29a6f06ce0c70 Mon Sep 17 00:00:00 2001 From: Marc Brugger Date: Wed, 12 Oct 2022 00:19:24 +0200 Subject: [PATCH] Add support for additional initContainers and additional volume/volumeMounts (#1542) fix github action to handle crd installation correctly Signed-off-by: bakito Signed-off-by: bakito --- .github/workflows/lint-and-test.yml | 4 +++- charts/argocd-image-updater/Chart.yaml | 4 ++-- charts/argocd-image-updater/README.md | 3 +++ .../templates/deployment.yaml | 10 ++++++++ charts/argocd-image-updater/values.yaml | 23 +++++++++++++++++++ 5 files changed, 41 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint-and-test.yml b/.github/workflows/lint-and-test.yml index 147f0b6b..e29b4871 100644 --- a/.github/workflows/lint-and-test.yml +++ b/.github/workflows/lint-and-test.yml @@ -64,7 +64,9 @@ jobs: if: | contains(steps.list-changed.outputs.changed_charts, 'argocd-image-updater') run: | - kubectl apply -f charts/argo-cd/templates/crds + helm repo add dandydeveloper https://dandydeveloper.github.io/charts/ + helm dependency build charts/argo-cd/ + helm template charts/argo-cd/ -s templates/crds/* | kubectl apply -f - - name: Skip HPA tests of ArgoCD if: contains(steps.list-changed.outputs.changed_charts, 'argo-cd') diff --git a/charts/argocd-image-updater/Chart.yaml b/charts/argocd-image-updater/Chart.yaml index a5b2ecd7..049ed8ce 100644 --- a/charts/argocd-image-updater/Chart.yaml +++ b/charts/argocd-image-updater/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: argocd-image-updater description: A Helm chart for Argo CD Image Updater, a tool to automatically update the container images of Kubernetes workloads which are managed by Argo CD type: application -version: 0.8.0 +version: 0.8.1 appVersion: v0.12.0 home: https://github.com/argoproj-labs/argocd-image-updater icon: https://argocd-image-updater.readthedocs.io/en/stable/assets/logo.png @@ -15,4 +15,4 @@ maintainers: url: https://argoproj.github.io/ annotations: artifacthub.io/changes: | - - "[Changed]: Update to argocd-image-updater v0.12" + - "[Added]: Add support for additional initContainers and additional volume/volumeMounts" diff --git a/charts/argocd-image-updater/README.md b/charts/argocd-image-updater/README.md index 7d80daac..10259e19 100644 --- a/charts/argocd-image-updater/README.md +++ b/charts/argocd-image-updater/README.md @@ -91,6 +91,7 @@ The `config.registries` value can be used exactly as it looks in the documentati | image.repository | string | `"quay.io/argoprojlabs/argocd-image-updater"` | Default image repository | | image.tag | string | `""` | Overrides the image tag whose default is the chart appVersion | | imagePullSecrets | list | `[]` | ImagePullSecrets for the image updater deployment | +| initContainers | list | `[]` | Init containers to add to the image updater pod | | metrics.enabled | bool | `false` | Deploy metrics service | | metrics.service.annotations | object | `{}` | Metrics service annotations | | metrics.service.labels | object | `{}` | Metrics service labels | @@ -115,6 +116,8 @@ The `config.registries` value can be used exactly as it looks in the documentati | serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template | | tolerations | list | `[]` | Kubernetes toleration settings for the deployment | | updateStrategy | object | `{"type":"Recreate"}` | The deployment strategy to use to replace existing pods with new ones | +| volumeMounts | list | `[]` | Additional volumeMounts to the image updater main container | +| volumes | list | `[]` | Additional volumes to the image updater pod | ---------------------------------------------- Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/helm-docs) diff --git a/charts/argocd-image-updater/templates/deployment.yaml b/charts/argocd-image-updater/templates/deployment.yaml index a80d26be..61136fb8 100644 --- a/charts/argocd-image-updater/templates/deployment.yaml +++ b/charts/argocd-image-updater/templates/deployment.yaml @@ -138,6 +138,9 @@ spec: - mountPath: /scripts name: authscripts {{- end }} + {{- with .Values.volumeMounts }} + {{- toYaml . | nindent 10}} + {{- end }} volumes: - configMap: items: @@ -164,6 +167,9 @@ spec: name: argocd-image-updater-ssh-config optional: true name: ssh-config + {{- with .Values.volumes }} + {{- toYaml . | nindent 6}} + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} @@ -176,3 +182,7 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} + {{- with .Values.initContainers }} + initContainers: + {{- toYaml . | nindent 6 }} + {{- end }} diff --git a/charts/argocd-image-updater/values.yaml b/charts/argocd-image-updater/values.yaml index d6ebd232..9ac3e1ef 100644 --- a/charts/argocd-image-updater/values.yaml +++ b/charts/argocd-image-updater/values.yaml @@ -42,6 +42,29 @@ extraEnv: [] # - name: AWS_REGION # value: "us-west-1" +# -- Init containers to add to the image updater pod +initContainers: [] + # - name: download-tools + # image: alpine:3.8 + # command: [sh, -c] + # args: + # - wget -qO- https://get.helm.sh/helm-v2.16.1-linux-amd64.tar.gz | tar -xvzf - && + # mv linux-amd64/helm /custom-tools/ + # volumeMounts: + # - mountPath: /custom-tools + # name: custom-tools + +# -- Additional volumeMounts to the image updater main container +volumeMounts: [] + +# -- Additional volumes to the image updater pod +volumes: [] + ## Use init containers to configure custom tooling + ## https://argo-cd.readthedocs.io/en/stable/operator-manual/custom_tools/ + ## When using the volumes & volumeMounts section bellow, please comment out those above. + # - name: custom-tools + # emptyDir: {} + config: # -- API kind that is used to manage Argo CD applications (`kubernetes` or `argocd`) applicationsAPIKind: ""