From 8c5c88b303d6d625184efa1f75b13d5c10ddbbf3 Mon Sep 17 00:00:00 2001 From: Sebastien RIBIERE Date: Tue, 13 Aug 2024 16:13:46 +0000 Subject: [PATCH 1/2] feat(argocd-image-updater): add a parameter to chose namespaced or clusterwide mode for AIU Signed-off-by: Sebastien RIBIERE --- charts/argocd-image-updater/README.md | 1 + .../templates/clusterrole.yaml | 36 +++++++++++++++++++ .../templates/clusterrolebinding.yaml | 17 +++++++++ .../templates/configmap.yaml | 1 + .../templates/deployment.yaml | 6 ++++ charts/argocd-image-updater/values.yaml | 3 ++ 6 files changed, 64 insertions(+) create mode 100644 charts/argocd-image-updater/templates/clusterrole.yaml create mode 100644 charts/argocd-image-updater/templates/clusterrolebinding.yaml diff --git a/charts/argocd-image-updater/README.md b/charts/argocd-image-updater/README.md index 5e51a8cd5..52a841b95 100644 --- a/charts/argocd-image-updater/README.md +++ b/charts/argocd-image-updater/README.md @@ -85,6 +85,7 @@ The `config.registries` value can be used exactly as it looks in the documentati | config.gitCommitTemplate | string | `""` | Changing the Git commit message | | config.gitCommitUser | string | `""` | Username to use for Git commits | | config.logLevel | string | `"info"` | Argo CD Image Update log level | +| config.namespaced | string | `"true"` | Check annotations in ArgoCD namespace only (if true) or in all namespaces (if false) | | config.registries | list | `[]` | Argo CD Image Updater registries list configuration. More information [here](https://argocd-image-updater.readthedocs.io/en/stable/configuration/registries/) | | config.sshConfig | object | `{}` | Argo CD Image Updater ssh client parameter configuration. | | extraArgs | list | `[]` | Extra arguments for argocd-image-updater not defined in `config.argocd`. If a flag contains both key and value, they need to be split to a new entry | diff --git a/charts/argocd-image-updater/templates/clusterrole.yaml b/charts/argocd-image-updater/templates/clusterrole.yaml new file mode 100644 index 000000000..4137219d9 --- /dev/null +++ b/charts/argocd-image-updater/templates/clusterrole.yaml @@ -0,0 +1,36 @@ +{{- if .Values.rbac.enabled }} +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: argocd-image-updater-clusterrole + labels: + {{ include "argocd-image-updater.labels" . | nindent 4 }} +rules: + - apiGroups: + - '*' + resources: + - '*' + verbs: + - delete + - get + - patch + - list + - watch + - apiGroups: + - "" + resources: + - applications + - applicationsets + verbs: + - get + - list + - update + - patch + - apiGroups: + - "" + resources: + - events + verbs: + - create +{{- end }} \ No newline at end of file diff --git a/charts/argocd-image-updater/templates/clusterrolebinding.yaml b/charts/argocd-image-updater/templates/clusterrolebinding.yaml new file mode 100644 index 000000000..dceb41e99 --- /dev/null +++ b/charts/argocd-image-updater/templates/clusterrolebinding.yaml @@ -0,0 +1,17 @@ +{{- if .Values.rbac.enabled }} +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: argocd-image-updater-clusterrolebinding + labels: + {{ include "argocd-image-updater.labels" . | nindent 4 }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: argocd-image-updater-clusterrole +subjects: + - kind: ServiceAccount + name: {{ include "argocd-image-updater.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} +{{- end }} diff --git a/charts/argocd-image-updater/templates/configmap.yaml b/charts/argocd-image-updater/templates/configmap.yaml index 46ee3b80a..77322079f 100644 --- a/charts/argocd-image-updater/templates/configmap.yaml +++ b/charts/argocd-image-updater/templates/configmap.yaml @@ -46,3 +46,4 @@ data: registries: {{- toYaml . | nindent 6 }} {{- end }} + namespaced: {{ .Values.config.namespaced | quote }} \ No newline at end of file diff --git a/charts/argocd-image-updater/templates/deployment.yaml b/charts/argocd-image-updater/templates/deployment.yaml index 4aaa83b3b..e0ce21683 100644 --- a/charts/argocd-image-updater/templates/deployment.yaml +++ b/charts/argocd-image-updater/templates/deployment.yaml @@ -118,6 +118,12 @@ spec: key: git.commit-sign-off name: argocd-image-updater-config optional: true + - name: IMAGE_UPDATER_NAMESPACED + valueFrom: + configMapKeyRef: + key: namespaced + name: argocd-image-updater-config + optional: true {{- with .Values.extraEnv }} {{- toYaml . | nindent 10 }} {{- end }} diff --git a/charts/argocd-image-updater/values.yaml b/charts/argocd-image-updater/values.yaml index 19291de93..c543d96a3 100644 --- a/charts/argocd-image-updater/values.yaml +++ b/charts/argocd-image-updater/values.yaml @@ -145,6 +145,9 @@ config: # -- Argo CD Image Update log level logLevel: "info" + # -- Check annotations in ArgoCD namespace only (if true) or in all namespaces (if false) + namespaced : "true" + # -- Argo CD Image Updater registries list configuration. More information [here](https://argocd-image-updater.readthedocs.io/en/stable/configuration/registries/) registries: [] # - name: Docker Hub From 8cc472838b53060b3ac9411b938176a500daa409 Mon Sep 17 00:00:00 2001 From: Sebastien RIBIERE Date: Tue, 13 Aug 2024 16:24:23 +0000 Subject: [PATCH 2/2] fix(argocd-image-updater): versionning and changelog Signed-off-by: Sebastien RIBIERE --- charts/argocd-image-updater/Chart.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/argocd-image-updater/Chart.yaml b/charts/argocd-image-updater/Chart.yaml index c358515f7..298338f33 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.11.0 +version: 0.11.1 appVersion: v0.14.0 home: https://github.com/argoproj-labs/argocd-image-updater icon: https://argocd-image-updater.readthedocs.io/en/stable/assets/logo.png @@ -18,5 +18,5 @@ annotations: fingerprint: 2B8F22F57260EFA67BE1C5824B11F800CD9D2252 url: https://argoproj.github.io/argo-helm/pgp_keys.asc artifacthub.io/changes: | - - kind: changed - description: Bump argocd-image-updater to v0.14.0 + - kind: added + description: parameter for namespaced/clusterwide behavior