feat(argocd-image-updater): Make cm and secret names configurable (#2998)

* feat: made argocd image updater cm and secret name templated

Signed-off-by: AvivGuiser <avivguiser@gmail.com>

* fix indention

Signed-off-by: AvivGuiser <avivguiser@gmail.com>

* update Chart.yaml

Signed-off-by: AvivGuiser <avivguiser@gmail.com>

* chore: Apply changes from code review

Signed-off-by: Marco Maurer <mkilchhofer@users.noreply.github.com>

* chore: Reflect changes from review inside changelog

Signed-off-by: Marco Maurer (-Kilchhofer) <mkilchhofer@users.noreply.github.com>

---------

Signed-off-by: AvivGuiser <avivguiser@gmail.com>
Signed-off-by: Marco Maurer <mkilchhofer@users.noreply.github.com>
Signed-off-by: Marco Maurer (-Kilchhofer) <mkilchhofer@users.noreply.github.com>
Co-authored-by: Marco Maurer <mkilchhofer@users.noreply.github.com>
This commit is contained in:
AvivGuiser 2025-01-25 15:31:37 +02:00 committed by GitHub
parent bf9830c670
commit 79ec8fdb94
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 44 additions and 26 deletions

View file

@ -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.4
version: 0.12.0
appVersion: v0.15.2
home: https://github.com/argoproj-labs/argocd-image-updater
icon: https://argocd-image-updater.readthedocs.io/en/stable/assets/logo.png
@ -19,4 +19,4 @@ annotations:
url: https://argoproj.github.io/argo-helm/pgp_keys.asc
artifacthub.io/changes: |
- kind: changed
description: Bump argocd-image-updater to v0.15.2
description: ConfigMap and Secret names are now configurable

View file

@ -70,6 +70,7 @@ The `config.registries` value can be used exactly as it looks in the documentati
|-----|------|---------|-------------|
| affinity | object | `{}` | Kubernetes affinity settings for the deployment |
| authScripts.enabled | bool | `false` | Whether to mount the defined scripts that can be used to authenticate with a registry, the scripts will be mounted at `/scripts` |
| authScripts.name | string | `"argocd-image-updater-authscripts"` | Name of the authentication scripts ConfigMap |
| authScripts.scripts | object | `{}` | Map of key-value pairs where the key consists of the name of the script and the value the contents |
| config.applicationsAPIKind | string | `""` | API kind that is used to manage Argo CD applications (`kubernetes` or `argocd`) |
| config.argocd.grpcWeb | bool | `true` | Use the gRPC-web protocol to connect to the Argo CD API |
@ -77,6 +78,7 @@ The `config.registries` value can be used exactly as it looks in the documentati
| config.argocd.plaintext | bool | `false` | If specified, use an unencrypted HTTP connection to the Argo CD API instead of TLS. |
| config.argocd.serverAddress | string | `""` | Connect to the Argo CD API server at server address |
| config.argocd.token | string | `""` | If specified, the secret with Argo CD API key will be created. |
| config.argocd.tokenSecretName | string | `"argocd-image-updater-secret"` | Name of the Secret containing the token |
| config.disableKubeEvents | bool | `false` | Disable kubernetes events |
| config.gitCommitMail | string | `""` | E-Mail address to use for Git commits |
| config.gitCommitSignOff | bool | `false` | Enables sign off on commits |
@ -85,8 +87,10 @@ 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.name | string | `"argocd-image-updater-config"` | Name of the ConfigMap |
| 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. |
| config.sshConfig.config | string | `""` | Argo CD Image Updater ssh client parameter configuration. |
| config.sshConfig.name | string | `"argocd-image-updater-ssh-config"` | Name of the sshConfig ConfigMap |
| createClusterRoles | bool | `true` | Create cluster roles for cluster-wide installation. |
| 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 |
| extraEnv | list | `[]` | Extra environment variables for argocd-image-updater |

View file

@ -4,7 +4,7 @@ kind: ConfigMap
metadata:
labels:
{{- include "argocd-image-updater.labels" . | nindent 4 }}
name: argocd-image-updater-authscripts
name: {{ .Values.authScripts.name }}
namespace: {{ include "argocd-image-updater.namespace" . | quote }}
data:
{{- toYaml .Values.authScripts.scripts | nindent 2}}

View file

@ -1,11 +1,17 @@
{{- $sshConfig := omit .Values.config.sshConfig "name" }}
{{- range $key, $val := $sshConfig }}
{{- if not $val }}
{{ $_ := unset $sshConfig $key }}
{{- end }}
{{- end }}
apiVersion: v1
kind: ConfigMap
metadata:
labels:
{{- include "argocd-image-updater.labels" . | nindent 4 }}
name: argocd-image-updater-ssh-config
name: {{ .Values.config.sshConfig.name }}
namespace: {{ include "argocd-image-updater.namespace" . | quote }}
{{- with .Values.config.sshConfig }}
{{- with $sshConfig }}
data:
{{- toYaml . | nindent 2 }}
{{- end }}

View file

@ -4,7 +4,7 @@ kind: ConfigMap
metadata:
labels:
{{- include "argocd-image-updater.labels" . | nindent 4 }}
name: argocd-image-updater-config
name: {{ .Values.config.name }}
namespace: {{ include "argocd-image-updater.namespace" . | quote }}
data:
{{- with .Values.config.applicationsAPIKind }}

View file

@ -44,79 +44,79 @@ spec:
valueFrom:
configMapKeyRef:
key: applications_api
name: argocd-image-updater-config
name: {{ .Values.config.name }}
optional: true
- name: ARGOCD_GRPC_WEB
valueFrom:
configMapKeyRef:
key: argocd.grpc_web
name: argocd-image-updater-config
name: {{ .Values.config.name }}
optional: true
- name: ARGOCD_SERVER
valueFrom:
configMapKeyRef:
key: argocd.server_addr
name: argocd-image-updater-config
name: {{ .Values.config.name }}
optional: true
- name: ARGOCD_INSECURE
valueFrom:
configMapKeyRef:
key: argocd.insecure
name: argocd-image-updater-config
name: {{ .Values.config.name }}
optional: true
- name: ARGOCD_PLAINTEXT
valueFrom:
configMapKeyRef:
key: argocd.plaintext
name: argocd-image-updater-config
name: {{ .Values.config.name }}
optional: true
- name: ARGOCD_TOKEN
valueFrom:
secretKeyRef:
key: argocd.token
name: argocd-image-updater-secret
name: {{ .Values.config.argocd.tokenSecretName }}
optional: true
- name: IMAGE_UPDATER_LOGLEVEL
valueFrom:
configMapKeyRef:
key: log.level
name: argocd-image-updater-config
name: {{ .Values.config.name }}
optional: true
- name: GIT_COMMIT_USER
valueFrom:
configMapKeyRef:
key: git.user
name: argocd-image-updater-config
name: {{ .Values.config.name }}
optional: true
- name: GIT_COMMIT_EMAIL
valueFrom:
configMapKeyRef:
key: git.email
name: argocd-image-updater-config
name: {{ .Values.config.name }}
optional: true
- name: IMAGE_UPDATER_KUBE_EVENTS
valueFrom:
configMapKeyRef:
key: kube.events
name: argocd-image-updater-config
name: {{ .Values.config.name }}
optional: true
- name: GIT_COMMIT_SIGNING_KEY
valueFrom:
configMapKeyRef:
key: git.commit-signing-key
name: argocd-image-updater-config
name: {{ .Values.config.name }}
optional: true
- name: GIT_COMMIT_SIGNING_METHOD
valueFrom:
configMapKeyRef:
key: git.commit-signing-method
name: argocd-image-updater-config
name: {{ .Values.config.name }}
optional: true
- name: GIT_COMMIT_SIGN_OFF
valueFrom:
configMapKeyRef:
key: git.commit-sign-off
name: argocd-image-updater-config
name: {{ .Values.config.name }}
optional: true
{{- with .Values.extraEnv }}
{{- toYaml . | nindent 10 }}
@ -177,13 +177,13 @@ spec:
path: registries.conf
- key: git.commit-message-template
path: commit.template
name: argocd-image-updater-config
name: {{ .Values.config.name }}
optional: true
name: image-updater-conf
{{- if .Values.authScripts.enabled }}
- configMap:
defaultMode: 0777
name: argocd-image-updater-authscripts
name: {{ .Values.authScripts.name }}
name: authscripts
{{- end }}
- configMap:
@ -191,7 +191,7 @@ spec:
optional: true
name: ssh-known-hosts
- configMap:
name: argocd-image-updater-ssh-config
name: {{ .Values.config.sshConfig.name }}
optional: true
name: ssh-config
- name: ssh-signing-key

View file

@ -2,7 +2,7 @@
apiVersion: v1
kind: Secret
metadata:
name: argocd-image-updater-secret
name: {{ .Values.config.argocd.tokenSecretName }}
namespace: {{ include "argocd-image-updater.namespace" . | quote }}
labels:
{{- include "argocd-image-updater.labels" . | nindent 4 }}

View file

@ -109,6 +109,8 @@ volumes: []
# emptyDir: {}
config:
# -- Name of the ConfigMap
name: argocd-image-updater-config
# -- API kind that is used to manage Argo CD applications (`kubernetes` or `argocd`)
applicationsAPIKind: ""
@ -125,6 +127,8 @@ config:
plaintext: false
# -- If specified, the secret with Argo CD API key will be created.
token: ""
# -- Name of the Secret containing the token
tokenSecretName: "argocd-image-updater-secret"
# -- Disable kubernetes events
disableKubeEvents: false
@ -175,9 +179,11 @@ config:
# credentials: ext:/scripts/auth1.sh
# credsexpire: 10h
# -- Argo CD Image Updater ssh client parameter configuration.
sshConfig:
{}
# -- Name of the sshConfig ConfigMap
name: argocd-image-updater-ssh-config
# -- Argo CD Image Updater ssh client parameter configuration.
config: ""
# config: |
# Host *
# PubkeyAcceptedAlgorithms +ssh-rsa
@ -188,6 +194,8 @@ config:
authScripts:
# -- Whether to mount the defined scripts that can be used to authenticate with a registry, the scripts will be mounted at `/scripts`
enabled: false
# -- Name of the authentication scripts ConfigMap
name: argocd-image-updater-authscripts
# -- Map of key-value pairs where the key consists of the name of the script and the value the contents
scripts: {}
# auth1.sh: |