Skip to content

Commit 3c4fcd5

Browse files
committed
feat: Otional configMap for config
feat: Optional configMap for config feat: Optional configMap for config feat: Optional configMap for config chore: Updated version and docs chore: working on release action Revert "chore: Updated version and docs" This reverts commit 78e551c. chore: Updated version and docs Revert "chore: working on release action" This reverts commit 7d68e18.
1 parent 2d1a060 commit 3c4fcd5

7 files changed

Lines changed: 55 additions & 5 deletions

File tree

charts/dex/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
type: application
33
name: dex
4-
version: 0.8.2
4+
version: 0.9.0
55
appVersion: "2.31.1"
66
kubeVersion: ">=1.14.0-0"
77
description: OpenID Connect (OIDC) identity and OAuth 2.0 provider with pluggable connectors.

charts/dex/README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# dex
22

3-
![version: 0.8.2](https://img.shields.io/badge/version-0.8.2-informational?style=flat-square) ![type: application](https://img.shields.io/badge/type-application-informational?style=flat-square) ![app version: 2.31.1](https://img.shields.io/badge/app%20version-2.31.1-informational?style=flat-square) ![kube version: >=1.14.0-0](https://img.shields.io/badge/kube%20version->=1.14.0--0-informational?style=flat-square) [![artifact hub](https://img.shields.io/badge/artifact%20hub-dex-informational?style=flat-square)](https://artifacthub.io/packages/helm/dex/dex)
3+
![version: 0.9.0](https://img.shields.io/badge/version-0.9.0-informational?style=flat-square) ![type: application](https://img.shields.io/badge/type-application-informational?style=flat-square) ![app version: 2.31.1](https://img.shields.io/badge/app%20version-2.31.1-informational?style=flat-square) ![kube version: >=1.14.0-0](https://img.shields.io/badge/kube%20version->=1.14.0--0-informational?style=flat-square) [![artifact hub](https://img.shields.io/badge/artifact%20hub-dex-informational?style=flat-square)](https://artifacthub.io/packages/helm/dex/dex)
44

55
OpenID Connect (OIDC) identity and OAuth 2.0 provider with pluggable connectors.
66

@@ -120,8 +120,11 @@ ingress:
120120
| hostAliases | list | `[]` | A list of hosts and IPs that will be injected into the pod's hosts file if specified. See the [API reference](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#hostname-and-name-resolution) |
121121
| https.enabled | bool | `false` | Enable the HTTPS endpoint. |
122122
| grpc.enabled | bool | `false` | Enable the gRPC endpoint. Read more in the [documentation](https://dexidp.io/docs/api/). |
123-
| configSecret.create | bool | `true` | Enable creating a secret from the values passed to `config`. If set to false, name must point to an existing secret. |
124-
| configSecret.name | string | `""` | The name of the secret to mount as configuration in the pod. If not set and create is true, a name is generated using the fullname template. Must point to secret that contains at least a `config.yaml` key. |
123+
| configType | string | `"secret"` | The manifest type from which the content of the `config` should be resolved from. Can be `secret` or `configMap`. |
124+
| configSecret.create | bool | `true` | Enable creating a secret from the values passed to `config`. If set to false, name must point to an existing secret. Only active when `configType` is `secret`. |
125+
| configSecret.name | string | `""` | The name of the secret to mount as configuration in the pod. If not set and create is true, a name is generated using the fullname template. Must point to secret that contains at least a `config.yaml` key. Only active when `configType` is `secret`. |
126+
| configMap.create | bool | `true` | Enable creating a configMap from the values passed to `config`. If set to false, name must point to an existing config map. Only active when `configType` is `configMap`. |
127+
| configMap.name | string | `""` | The name of the configMap to mount as configuration in the pod. If not set and create is true, a name is generated using the fullname template. Must point to configMap that contains at least a `config.yaml` key. Only active when `configType` is `configMap`. |
125128
| config | object | `{}` | Application configuration. See the [official documentation](https://dexidp.io/docs/). |
126129
| volumes | list | `[]` | Additional storage [volumes](https://kubernetes.io/docs/concepts/storage/volumes/). See the [API reference](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#volumes-1) for details. |
127130
| volumeMounts | list | `[]` | Additional [volume mounts](https://kubernetes.io/docs/tasks/configure-pod-container/configure-volume-storage/). See the [API reference](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#volumes-1) for details. |

charts/dex/templates/_helpers.tpl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,14 @@ Create the name of the secret containing the config file to use
7171
{{- default "default" .Values.configSecret.name }}
7272
{{- end }}
7373
{{- end }}
74+
75+
{{/*
76+
Create the name of the configMap containing the config file to use
77+
*/}}
78+
{{- define "dex.configMapName" -}}
79+
{{- if .Values.configMap.create }}
80+
{{- default (include "dex.fullname" .) .Values.configMap.name }}
81+
{{- else }}
82+
{{- default "default" .Values.configMap.name }}
83+
{{- end }}
84+
{{- end }}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{{- if and (eq .Values.configType "configMap") .Values.configSecret.create -}}
2+
apiVersion: v1
3+
kind: ConfigMap
4+
metadata:
5+
name: {{ include "dex.configMapName" . }}
6+
labels:
7+
{{- include "dex.labels" . | nindent 4 }}
8+
data:
9+
config.yaml: |
10+
{{ .Values.config | toYaml | indent 4 }}
11+
{{- end }}

charts/dex/templates/deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,15 @@ spec:
110110
{{- toYaml . | nindent 12 }}
111111
{{- end }}
112112
volumes:
113+
{{- if eq .Values.configType "secret" }}
113114
- name: config
114115
secret:
115116
secretName: {{ include "dex.configSecretName" . }}
117+
{{- else if eq .Values.configType "configMap" }}
118+
- name: config
119+
configMap:
120+
mame: {{ include "dex.configMapName" . }}
121+
{{- end }}
116122
{{- with .Values.volumes }}
117123
{{- toYaml . | nindent 8 }}
118124
{{- end }}

charts/dex/templates/secret.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if .Values.configSecret.create -}}
1+
{{- if and (eq .Values.configType "secret") .Values.configSecret.create -}}
22
apiVersion: v1
33
kind: Secret
44
metadata:

charts/dex/values.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,33 @@ grpc:
3737
# Read more in the [documentation](https://dexidp.io/docs/api/).
3838
enabled: false
3939

40+
41+
# -- The manifest type from which the content of the `config` should be resolved from.
42+
# Can be `secret` or `configMap`.
43+
configType: secret
44+
4045
configSecret:
4146
# -- Enable creating a secret from the values passed to `config`.
4247
# If set to false, name must point to an existing secret.
48+
# Only active when `configType` is `secret`.
4349
create: true
4450

4551
# -- The name of the secret to mount as configuration in the pod.
4652
# If not set and create is true, a name is generated using the fullname template.
4753
# Must point to secret that contains at least a `config.yaml` key.
54+
# Only active when `configType` is `secret`.
55+
name: ""
56+
57+
configMap:
58+
# -- Enable creating a configMap from the values passed to `config`.
59+
# If set to false, name must point to an existing config map.
60+
# Only active when `configType` is `configMap`.
61+
create: true
62+
63+
# -- The name of the configMap to mount as configuration in the pod.
64+
# If not set and create is true, a name is generated using the fullname template.
65+
# Must point to configMap that contains at least a `config.yaml` key.
66+
# Only active when `configType` is `configMap`.
4867
name: ""
4968

5069
# -- Application configuration.

0 commit comments

Comments
 (0)