Skip to content

Commit

Permalink
support for extra configMaps and Secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
g10f committed Feb 18, 2023
1 parent 30851ed commit fc02d55
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 6 deletions.
4 changes: 2 additions & 2 deletions charts/sso/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ maintainers:
email: [email protected]
url: https://gunnar-scherf.de
type: application
version: 1.0.12
appVersion: "3.3.33"
version: 1.0.13
appVersion: "3.3.34"
icon: https://sso.g10f.de/apple-touch-icon.png
dependencies:
- name: memcached
Expand Down
14 changes: 14 additions & 0 deletions charts/sso/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,17 @@ data:
{{- if .Values.memcached.enabled }}
CACHES_LOCATION: {{ .Release.Name }}-memcached:11211
{{- end }}
{{- $fullName := include "sso.fullname" . -}}
{{- range $nameSuffix, $values := .Values.configMaps }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ $fullName }}-{{ $nameSuffix }}
labels:
{{- include "sso.labels" $ | nindent 4 }}
{{- with $values.data }}
data:
{{- toYaml . | nindent 2 }}
{{- end }}
{{- end -}}
3 changes: 3 additions & 0 deletions charts/sso/templates/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ spec:
name: {{ $.Release.Name }}-configmap
- secretRef:
name: {{ $.Release.Name }}-secret
{{- with $.Values.extraEnvFrom }}
{{- tpl . $ | nindent 16 }}
{{- end }}
volumeMounts:
- mountPath: /opt/g10f/sso/htdocs/media
name: media
Expand Down
21 changes: 21 additions & 0 deletions charts/sso/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,24 @@ stringData:
{{- end }}
RECAPTCHA_PRIVATE_KEY: {{ .Values.recaptchaPrivateKey | quote}}
SSO_GOOGLE_GEO_API_KEY: {{ .Values.ssoGoogleGeoApiKey | quote}}
{{- $fullName := include "sso.fullname" . -}}
{{- range $nameSuffix, $values := .Values.secrets }}
---
apiVersion: v1
kind: Secret
metadata:
name: {{ $fullName }}-{{ $nameSuffix }}
labels:
{{- include "sso.labels" $ | nindent 4 }}
type: {{ default "Opaque" $values.type }}
{{- with $values.data }}
data:
{{- toYaml . | nindent 2 }}
{{- end }}
{{- with $values.stringData }}
stringData:
{{- range $key, $value := . }}
{{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 2 }}
{{- end }}
{{- end }}
{{- end -}}
20 changes: 16 additions & 4 deletions charts/sso/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ allowedHosts: ""
siteName: "G10F"
serverEmail: '"G10F SSO" <[email protected]>'
secretKey: "changeme"
recaptchaPrivateKey: ""
ssoGoogleGeoApiKey: ""
celeryBrokerURL: ""
django:
loadInitialData: "on"
migrate: "on"
Expand All @@ -28,11 +31,20 @@ extraEnv: ""
# - name: EMAIL_PORT
# value: 587

# Additional environment variables for sso mapped from Secret or ConfigMap
# Configuration for secrets that should be created
secrets: {}
# mysecret:
# type: {}
# stringData: {}
# data: {}

configMaps: {}
# myconfig:
# data: {}

# Additional environment variables for the wiki mapped from Secret or ConfigMap
extraEnvFrom: ""
recaptchaPrivateKey: ""
ssoGoogleGeoApiKey: ""
celeryBrokerURL: ""

entryPoint: |
{{- .Files.Get "scripts/docker-entrypoint.sh" }}
Expand Down

0 comments on commit fc02d55

Please sign in to comment.