Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(helm): Make Jena passwords optional in values file. #3389

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions helm-chart/renku/templates/graph/jena-secret.yaml

This file was deleted.

40 changes: 38 additions & 2 deletions helm-chart/renku/templates/graph/jena-shiro-ini.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
{{- $jenaAdminPwd := .Values.jena.users.admin.password | default (randAlphaNum 64) | b64enc }}
{{- $jenaRenkuPwd := .Values.jena.users.renku.password | default (randAlphaNum 64) | b64enc }}

# Check if the secret already exist. If it does then overwrite the passwords with the existing ones.
{{- $secretName := include "renku.graph.jena.fullname" . }}
{{- if not .Values.jena.users.admin.password -}}
{{- $secret := (lookup "v1" "Secret" .Release.Namespace $secretName) }}
{{- if $secret }}
{{- $jenaAdminPwd = index $secret.data "jena-users-admin-password" }}
{{- end -}}
{{- end -}}

{{- if not .Values.jena.users.renku.password -}}
{{- $secret := (lookup "v1" "Secret" .Release.Namespace $secretName) }}
{{- if $secret }}
{{- $jenaRenkuPwd = index $secret.data "jena-users-renku-password" }}
{{- end -}}
{{- end -}}

---
apiVersion: v1
kind: Secret
metadata:
name: {{ template "renku.graph.jena.fullname" . }}
labels:
app: {{ template "renku.graph.jena.name" . }}
chart: {{ template "renku.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
annotations:
"helm.sh/hook": "pre-install,pre-upgrade,pre-rollback"
type: Opaque
data:
jena-users-admin-password: {{ $jenaAdminPwd}}
jena-users-renku-password: {{ $jenaRenkuPwd}}

---
apiVersion: v1
kind: ConfigMap
Expand All @@ -18,8 +54,8 @@ data:
iniRealm.credentialsMatcher = $plainMatcher

[users]
admin={{ .Values.jena.users.admin.password }}
renku={{ .Values.jena.users.renku.password }}
admin={{ $jenaAdminPwd | b64dec | trim }}
renku={{ $jenaRenkuPwd | b64dec | trim }}

[roles]

Expand Down