Skip to content

Commit

Permalink
Image extraVars and extraSecrets (#90)
Browse files Browse the repository at this point in the history
* Added extraVars and extraSecrets

* Bumped version to 0.23.0

* Updated README.md variables
  • Loading branch information
jaywor1 authored Jun 20, 2024
1 parent 0062343 commit 8528b7d
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/vaultwarden/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ maintainers:
- name: guerzon
email: [email protected]
url: https://github.com/guerzon
version: 0.22.7
version: 0.23.0
kubeVersion: ">=1.12.0-0"
3 changes: 3 additions & 0 deletions charts/vaultwarden/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,8 @@ helm -n $NAMESPACE uninstall $RELEASE_NAME
| `image.tag` | Vaultwarden image tag | `1.30.3-alpine` |
| `image.pullPolicy` | Vaultwarden image pull policy | `IfNotPresent` |
| `image.pullSecrets` | Specify docker-registry secret names | `[]` |
| `image.extraSecrets` | Vaultwarden image extra secrets | `[]` |
| `image.extraVars` | Vaultwarden image extra vars | `[]` |
| `fullnameOverride` | String to override the application name. | `""` |
| `resourceType` | Can be either Deployment or StatefulSet | `""` |
| `commonAnnotations` | Annotations for the deployment or statefulset | `{}` |
Expand All @@ -279,6 +281,7 @@ helm -n $NAMESPACE uninstall $RELEASE_NAME
| `serviceAccount.name` | Name of the service account to create | `vaultwarden-svc` |
| `podSecurityContext` | Pod security options | `{}` |
| `securityContext` | Default security options to run vault as read only container without privilege escalation | `{}` |
| `dnsConfig` | Pod DNS options | `{}` |

### Reliability configuration

Expand Down
13 changes: 13 additions & 0 deletions charts/vaultwarden/templates/_podSpec.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@ containers:
- configMapRef:
name: {{ include "vaultwarden.fullname" . }}
env:
{{- range .Values.image.extraVars }}
- name: {{ .key }}
value: {{ .value | quote }}
{{- end }}
{{- if (.Values.image.extraSecrets) }}
{{- range .Values.image.extraSecrets }}
- name: {{ .key }}
valueFrom:
secretKeyRef:
name: {{ include "vaultwarden.fullname" . }}
key: {{ .key }}
{{- end }}
{{- end }}
{{- if or (.Values.smtp.username.value) (.Values.smtp.username.existingSecretKey )}}
- name: SMTP_USERNAME
valueFrom:
Expand Down
3 changes: 3 additions & 0 deletions charts/vaultwarden/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ metadata:
{{- include "vaultwarden.labels" $ | nindent 4 }}
type: Opaque
data:
{{- range .Values.image.extraSecrets }}
{{ .key }}: {{ .value | b64enc | quote }}
{{- end }}
{{- if not ( .Values.smtp.existingSecret ) }}
SMTP_PASSWORD: {{ .Values.smtp.password.value | b64enc | quote }}
SMTP_USERNAME: {{ .Values.smtp.username.value | b64enc | quote }}
Expand Down
14 changes: 14 additions & 0 deletions charts/vaultwarden/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ image:
## - myRegistryKeySecretName
##
pullSecrets: []
## @param image.extraSecrets Vaultwarden image extra secrets
## Example:
## extraSecrets:
## - key: SSO_CLIENT_SECRET
## value: secretStuff
##
extraSecrets: []
## @param image.extraVars Vaultwarden image extra vars
## Example:
## extraVars:
## - key: SSO_AUTHORITY
## value: https://bananaguy.com/auth
##
extraVars: []

## @param fullnameOverride String to override the application name.
##
Expand Down

0 comments on commit 8528b7d

Please sign in to comment.