Skip to content

Commit

Permalink
Dex static connector override (#5955)
Browse files Browse the repository at this point in the history
* Make static connector configurable

* Fix indent
  • Loading branch information
Piotr Mścichowski authored Oct 10, 2019
1 parent 68abbad commit 600dd72
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 12 deletions.
18 changes: 9 additions & 9 deletions docs/security/08-03-add-connector.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ metadata:
kyma-project.io/installation: ""
data:
connectors: |-
- type: github
id: github
name: GitHub
config:
clientID: {GITHUB_CLIENT_ID}
clientSecret: {GITHUB_CLIENT_SECRET}
redirectURI: https://dex.{{ .Values.global.domainName }}/callback
orgs:
- name: {GITHUB_ORGANIZATION}
- type: github
id: github
name: GitHub
config:
clientID: {GITHUB_CLIENT_ID}
clientSecret: {GITHUB_CLIENT_SECRET}
redirectURI: https://dex.{{ .Values.global.domainName }}/callback
orgs:
- name: {GITHUB_ORGANIZATION}
EOF
```

Expand Down
3 changes: 2 additions & 1 deletion resources/dex/templates/dex-config-map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ data:
{{- with .Values.oidc.staticClientsExtra }}
{{- tpl . $ | nindent 4 }}
{{- end }}

{{ if .Values.dex.useStaticConnector }}
enablePasswordDB: true
#__STATIC_PASSWORDS__
{{ end }}
13 changes: 11 additions & 2 deletions resources/dex/templates/dex-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,13 @@ spec:
ports:
- name: http
containerPort: {{ .Values.containerPort }}

volumeMounts:
- name: config
mountPath: /etc/dex/cfg
{{- with .Values.volumeMountsExtra }}
{{- tpl . $ | nindent 8 }}
{{- end }}

{{ if .Values.dex.useStaticConnector }}
initContainers:
- name: dex-users-configurator
image: {{ .Values.global.containerRegistry.path }}/{{ .Values.global.dex_static_user_configurer.dir }}dex-static-user-configurer:{{ .Values.global.dex_static_user_configurer.version }}
Expand All @@ -58,6 +57,16 @@ spec:
path: config.yaml
- name: config
emptyDir: {}
{{ else }}
volumes:
- name: config
configMap:
name: dex-config
items:
- key: config.yaml
path: config.yaml
{{ end }}
{{- with .Values.volumesExtra }}
{{- tpl . $ | nindent 6 }}
{{- end }}

2 changes: 2 additions & 0 deletions resources/dex/templates/dex-rbac-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ rules:
- apiGroups: ["apiextensions.k8s.io"]
resources: ["customresourcedefinitions"]
verbs: ["create"]
{{ if .Values.dex.useStaticConnector }}
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "list"]
{{ end }}
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
Expand Down
1 change: 1 addition & 0 deletions resources/dex/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ dex:
expiry:
signingKeys: "720h"
idTokens: "8h"
useStaticConnector: true

resources:
limits:
Expand Down

0 comments on commit 600dd72

Please sign in to comment.