Skip to content

Commit

Permalink
Add option for a custom secret (#47)
Browse files Browse the repository at this point in the history
Introducing options nested under `nextcloud.existingSecret` to allow for a deployment that does not contain the secret and instead uses an existing secret.

Signed-off-by: Michel Zimmer <[email protected]>

Co-authored-by: Jeff Billimek <[email protected]>
  • Loading branch information
michel-zimmer and billimek authored Dec 28, 2020
1 parent 33dcd42 commit c4caa17
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/nextcloud/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: nextcloud
version: 2.3.3
version: 2.4.0
appVersion: 19.0.3
description: A file sharing server that puts the control and security of your own data back into your hands.
keywords:
Expand Down
4 changes: 4 additions & 0 deletions charts/nextcloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ The following table lists the configurable parameters of the nextcloud chart and
| `nextcloud.host` | nextcloud host to create application URLs | `nextcloud.kube.home` |
| `nextcloud.username` | User of the application | `admin` |
| `nextcloud.password` | Application password | `changeme` |
| `nextcloud.existingSecret.enabled` | Whether to use an existing secret or not | `false` |
| `nextcloud.existingSecret.secretName` | Name of the existing secret | `nil` |
| `nextcloud.existingSecret.usernameKey` | Name of the key that contains the username | `nil` |
| `nextcloud.existingSecret.passwordKey` | Name of the key that contains the password | `nil` |
| `nextcloud.update` | Trigger update if custom command is used | `0` |
| `nextcloud.datadir` | nextcloud data dir location | `/var/www/html/data` |
| `nextcloud.tableprefix` | nextcloud db table prefix | `''` |
Expand Down
8 changes: 4 additions & 4 deletions charts/nextcloud/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,13 @@ spec:
- name: NEXTCLOUD_ADMIN_USER
valueFrom:
secretKeyRef:
name: {{ template "nextcloud.fullname" . }}
key: nextcloud-username
name: {{ .Values.nextcloud.existingSecret.secretName | default (include "nextcloud.fullname" .) }}
key: {{ .Values.nextcloud.existingSecret.usernameKey | default "nextcloud-username" }}
- name: NEXTCLOUD_ADMIN_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "nextcloud.fullname" . }}
key: nextcloud-password
name: {{ .Values.nextcloud.existingSecret.secretName | default (include "nextcloud.fullname" .) }}
key: {{ .Values.nextcloud.existingSecret.passwordKey | default "nextcloud-password" }}
- name: NEXTCLOUD_TRUSTED_DOMAINS
value: {{ .Values.nextcloud.host }}
{{- if ne (int .Values.nextcloud.update) 0 }}
Expand Down
2 changes: 2 additions & 0 deletions charts/nextcloud/templates/secrets.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if not .Values.nextcloud.existingSecret.enabled }}
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -19,3 +20,4 @@ data:
smtp-username: {{ default "" .Values.nextcloud.mail.smtp.name | b64enc | quote }}
smtp-password: {{ default "" .Values.nextcloud.mail.smtp.password | b64enc | quote }}
{{- end }}
{{- end }}
6 changes: 6 additions & 0 deletions charts/nextcloud/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ nextcloud:
host: nextcloud.kube.home
username: admin
password: changeme
## Use an existing secret
existingSecret:
enabled: false
# secretName: nameofsecret
# usernameKey: username
# passwordKey: password
update: 0
datadir: /var/www/html/data
tableprefix:
Expand Down

0 comments on commit c4caa17

Please sign in to comment.