From 5c4acc8d77d9c6e00dc5f9f63da4a12fbeeab716 Mon Sep 17 00:00:00 2001 From: Lester Guerzon Date: Mon, 9 Sep 2024 10:36:37 +0800 Subject: [PATCH] feat: imagePullSecrets support Signed-off-by: Lester Guerzon --- charts/vaultwarden/Chart.yaml | 2 +- charts/vaultwarden/README.md | 6 ++++-- charts/vaultwarden/ci/test-values.yaml | 2 +- charts/vaultwarden/templates/_podSpec.tpl | 4 ++++ charts/vaultwarden/values.yaml | 4 ++-- demo.yaml | 2 +- 6 files changed, 13 insertions(+), 7 deletions(-) diff --git a/charts/vaultwarden/Chart.yaml b/charts/vaultwarden/Chart.yaml index cf9fad3..528c121 100644 --- a/charts/vaultwarden/Chart.yaml +++ b/charts/vaultwarden/Chart.yaml @@ -13,5 +13,5 @@ maintainers: - name: guerzon email: guerzon@proton.me url: https://github.com/guerzon -version: 0.28.0 +version: 0.29.0 kubeVersion: ">=1.12.0-0" diff --git a/charts/vaultwarden/README.md b/charts/vaultwarden/README.md index 06bfd8e..5b28a68 100644 --- a/charts/vaultwarden/README.md +++ b/charts/vaultwarden/README.md @@ -35,9 +35,11 @@ Example that uses the Alpine-based image `1.24.0-alpine` and an existing secret ```yaml image: + registry: ghcr.io + repository: guerzon/vaultwarden tag: "1.24.0-alpine" pullSecrets: - - myRegKey + - name: myRegKey ``` **Important**: specify the URL used by users with the `domain` variable, otherwise, some functionalities might not work: @@ -318,7 +320,7 @@ helm -n $NAMESPACE uninstall $RELEASE_NAME | `image.repository` | Vaultwarden image repository | `vaultwarden/server` | | `image.tag` | Vaultwarden image tag | `1.32.0-alpine` | | `image.pullPolicy` | Vaultwarden image pull policy | `IfNotPresent` | -| `image.pullSecrets` | Specify docker-registry secret names | `[]` | +| `image.pullSecrets` | Specify docker-registry secrets | `[]` | | `image.extraSecrets` | Vaultwarden image extra secrets | `[]` | | `image.extraVars` | Vaultwarden image extra vars | `[]` | | `fullnameOverride` | String to override the application name. | `""` | diff --git a/charts/vaultwarden/ci/test-values.yaml b/charts/vaultwarden/ci/test-values.yaml index ca70b59..1e5e6a7 100644 --- a/charts/vaultwarden/ci/test-values.yaml +++ b/charts/vaultwarden/ci/test-values.yaml @@ -12,7 +12,7 @@ adminToken: image: pullSecrets: - - myRegKey + - name: myRegKey yubico: clientId: "ABCDE" diff --git a/charts/vaultwarden/templates/_podSpec.tpl b/charts/vaultwarden/templates/_podSpec.tpl index a870664..9defccc 100644 --- a/charts/vaultwarden/templates/_podSpec.tpl +++ b/charts/vaultwarden/templates/_podSpec.tpl @@ -174,4 +174,8 @@ containers: {{- if .Values.serviceAccount.create }} serviceAccountName: {{ .Values.serviceAccount.name }} {{- end }} +{{- with .Values.image.pullSecrets }} +imagePullSecrets: + {{- toYaml . | nindent 2 }} +{{- end }} {{- end }} diff --git a/charts/vaultwarden/values.yaml b/charts/vaultwarden/values.yaml index 121bfac..fcce78b 100644 --- a/charts/vaultwarden/values.yaml +++ b/charts/vaultwarden/values.yaml @@ -18,11 +18,11 @@ image: ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images ## pullPolicy: IfNotPresent - ## @param image.pullSecrets Specify docker-registry secret names + ## @param image.pullSecrets Specify docker-registry secrets ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ ## Example: ## pullSecrets: - ## - myRegistryKeySecretName + ## - name: myRegistryKeySecretName ## pullSecrets: [] ## @param image.extraSecrets Vaultwarden image extra secrets diff --git a/demo.yaml b/demo.yaml index e487164..fe1e594 100644 --- a/demo.yaml +++ b/demo.yaml @@ -15,4 +15,4 @@ adminToken: image: pullSecrets: - - myRegKey + - name: myRegKey