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

Allowing for custom config path #85

Open
wants to merge 6 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
4 changes: 2 additions & 2 deletions charts/dex/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
type: application
name: dex
version: 0.14.0
version: 0.15.0
appVersion: "2.36.0"
kubeVersion: ">=1.14.0-0"
description: OpenID Connect (OIDC) identity and OAuth 2.0 provider with pluggable connectors.
Expand All @@ -22,7 +22,7 @@ maintainers:
annotations:
artifacthub.io/changes: |
- kind: added
description: "Common labels to all resources created by the chart"
description: "Added volumes and volumeMounts helpers to only mount secret if a secret is needed"
artifacthub.io/images: |
- name: dex
image: ghcr.io/dexidp/dex:v2.36.0
24 changes: 24 additions & 0 deletions charts/dex/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,27 @@ Create the name of the secret containing the config file to use
{{- default "default" .Values.configSecret.name }}
{{- end }}
{{- end }}

{{/*
Create Volumes
*/}}
{{- define "dex.volumes" -}}
{{- if or .Values.configSecret.create .Values.configSecret.name }}
{{- $defaultVolume := list (dict "name" "config" "secret" (dict "secretName" (include "dex.configSecretName" .))) -}}
{{ concat $defaultVolume .Values.volumes | toYaml }}
{{- else -}}
{{ .Values.volumes | toYaml }}
{{- end }}
{{- end }}

{{/*
Create Volume Mounts
*/}}
{{- define "dex.volumeMounts" -}}
{{- if or .Values.configSecret.create .Values.configSecret.name }}
{{- $defaultMount := list (dict "name" "config" "mountPath" "/etc/dex" "readOnly" "true") -}}
{{ concat $defaultMount .Values.volumeMounts | toYaml }}
{{- else -}}
{{ .Values.volumeMounts | toYaml }}
{{- end }}
{{- end }}
14 changes: 2 additions & 12 deletions charts/dex/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,9 @@ spec:
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: config
mountPath: /etc/dex
readOnly: true
{{- with .Values.volumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- (include "dex.volumeMounts" .) | nindent 12 }}
volumes:
- name: config
secret:
secretName: {{ include "dex.configSecretName" . }}
{{- with .Values.volumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- (include "dex.volumes" .) | nindent 8 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down