diff --git a/charts/vaultwarden/Chart.yaml b/charts/vaultwarden/Chart.yaml index 31060fdc..e8fa5b91 100644 --- a/charts/vaultwarden/Chart.yaml +++ b/charts/vaultwarden/Chart.yaml @@ -13,5 +13,5 @@ maintainers: - name: guerzon email: lester@guerzon.net url: https://github.com/guerzon -version: 0.46.1 +version: 0.47.0 kubeVersion: ">=1.12.0-0" diff --git a/charts/vaultwarden/README.md b/charts/vaultwarden/README.md index 20e40209..640c989d 100644 --- a/charts/vaultwarden/README.md +++ b/charts/vaultwarden/README.md @@ -29,7 +29,7 @@ helm upgrade -i \ ## General configuration -This chart deploys `vaultwarden` from pre-built images on [Docker Hub](https://hub.docker.com/r/vaultwarden/server/tags): `vaultwarden/server`. The image can be defined by specifying the tag with `image.tag`. +This chart deploys `vaultwarden` from pre-built images on [Docker Hub](https://hub.docker.com/r/vaultwarden/server/tags): `vaultwarden/server`. The image is composed from `image.tag` and `image.flavor`, so `tag: "1.24.0"` with `flavor: "alpine"` resolves to `1.24.0-alpine`. Example that uses the Alpine-based image `1.24.0-alpine` and an existing secret that contains registry credentials: @@ -37,11 +37,20 @@ Example that uses the Alpine-based image `1.24.0-alpine` and an existing secret image: registry: ghcr.io repository: guerzon/vaultwarden - tag: "1.24.0-alpine" + tag: "1.24.0" + flavor: "alpine" pullSecrets: - name: myRegKey ``` +Upstream publishes an Alpine (musl) and a Debian (glibc) image for each release. Set `flavor: ""` to get the Debian image, which is the safer choice on clusters where musl's resolver misbehaves: + +```yaml +image: + tag: "1.24.0" + flavor: "" +``` + **Important**: specify the URL used by users with the `domain` variable, otherwise, some functionalities might not work: ```yaml @@ -380,7 +389,8 @@ helm -n $NAMESPACE uninstall $RELEASE_NAME | --------------------------- | ----------------------------------------------------------------------------------------- | -------------------- | | `image.registry` | Vaultwarden image registry | `docker.io` | | `image.repository` | Vaultwarden image repository | `vaultwarden/server` | -| `image.tag` | Vaultwarden image tag | `1.37.2-alpine` | +| `image.tag` | Vaultwarden image tag, without the flavor suffix | `1.37.2` | +| `image.flavor` | Image flavor, appended to `image.tag`. Set to `""` for the Debian (glibc) image | `alpine` | | `image.pullPolicy` | Vaultwarden image pull policy | `IfNotPresent` | | `image.pullSecrets` | Specify docker-registry secrets | `[]` | | `image.extraSecrets` | Vaultwarden image extra secrets | `[]` | diff --git a/charts/vaultwarden/ci/test-values.yaml b/charts/vaultwarden/ci/test-values.yaml index ee9528ed..5f262c09 100644 --- a/charts/vaultwarden/ci/test-values.yaml +++ b/charts/vaultwarden/ci/test-values.yaml @@ -11,6 +11,7 @@ adminToken: value: "khit9gYQV6ax9LKTTm+s6QbZi5oiuR+3s1PEn9q3IRmCl9IQn7LmBpmFCOYTb7Mr" image: + flavor: "" pullSecrets: - name: myRegKey diff --git a/charts/vaultwarden/templates/_helpers.tpl b/charts/vaultwarden/templates/_helpers.tpl index cdf5f397..af4d472f 100644 --- a/charts/vaultwarden/templates/_helpers.tpl +++ b/charts/vaultwarden/templates/_helpers.tpl @@ -31,6 +31,17 @@ Create chart name and version as used by the chart label. {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- end }} +{{/* +Fully-qualified image reference. image.flavor, when set, is appended to image.tag. +*/}} +{{- define "vaultwarden.image" -}} +{{- $tag := .Values.image.tag -}} +{{- if .Values.image.flavor -}} +{{- $tag = printf "%s-%s" $tag .Values.image.flavor -}} +{{- end -}} +{{- printf "%s/%s:%s" .Values.image.registry .Values.image.repository $tag -}} +{{- end }} + {{/* Common labels */}} diff --git a/charts/vaultwarden/templates/_podSpec.tpl b/charts/vaultwarden/templates/_podSpec.tpl index bb731676..e2b12ff2 100644 --- a/charts/vaultwarden/templates/_podSpec.tpl +++ b/charts/vaultwarden/templates/_podSpec.tpl @@ -34,7 +34,7 @@ initContainers: enableServiceLinks: false {{- end }} containers: - - image: {{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }} + - image: {{ include "vaultwarden.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy }} name: vaultwarden envFrom: diff --git a/charts/vaultwarden/values.yaml b/charts/vaultwarden/values.yaml index 90d196eb..c9365b29 100644 --- a/charts/vaultwarden/values.yaml +++ b/charts/vaultwarden/values.yaml @@ -10,10 +10,14 @@ image: ## repository: vaultwarden/server ## - ## @param image.tag Vaultwarden image tag + ## @param image.tag Vaultwarden image tag, without the flavor suffix ## Ref: https://hub.docker.com/r/vaultwarden/server/tags ## - tag: "1.37.2-alpine" + tag: "1.37.2" + ## + ## @param image.flavor Image flavor, appended to `image.tag`. Set to `""` for the Debian (glibc) image + ## + flavor: "alpine" ## @param image.pullPolicy Vaultwarden image pull policy ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images ##