From 8ea4d554be88fc9282880bca45e01b4ce10c6ff0 Mon Sep 17 00:00:00 2001 From: Lester Guerzon Date: Mon, 9 Sep 2024 10:50:29 +0800 Subject: [PATCH] feat: imagePullSecrets support (#119) * feat: imagePullSecrets support Signed-off-by: Lester Guerzon * chore: venv gitignore Signed-off-by: Lester Guerzon --------- Signed-off-by: Lester Guerzon --- .gitignore | 3 ++- 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 +- 7 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 0e3da38..42340ff 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ .vscode .DS_Store testing-values.yaml -readme-generator-for-helm \ No newline at end of file +readme-generator-for-helm +venv \ No newline at end of file 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