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(charts/dex): add extraObjects #132

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
9 changes: 6 additions & 3 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.18.0
version: 0.19.0
appVersion: "2.40.0"
kubeVersion: ">=1.14.0-0"
description: OpenID Connect (OIDC) identity and OAuth 2.0 provider with pluggable connectors.
Expand All @@ -21,8 +21,11 @@ maintainers:
url: https://sagikazarmark.hu
annotations:
artifacthub.io/changes: |
- kind: changed
description: "Dex 2.40.0 release"
- kind: added
description: Add extraObjects
links: # Optional
- name: Github PR
url: https://github.com/dexidp/helm-charts/pull/132
artifacthub.io/images: |
- name: dex
image: ghcr.io/dexidp/dex:v2.40.0
3 changes: 2 additions & 1 deletion charts/dex/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# dex

![version: 0.18.0](https://img.shields.io/badge/version-0.18.0-informational?style=flat-square) ![type: application](https://img.shields.io/badge/type-application-informational?style=flat-square) ![app version: 2.40.0](https://img.shields.io/badge/app%20version-2.40.0-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)
![version: 0.19.0](https://img.shields.io/badge/version-0.19.0-informational?style=flat-square) ![type: application](https://img.shields.io/badge/type-application-informational?style=flat-square) ![app version: 2.40.0](https://img.shields.io/badge/app%20version-2.40.0-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)

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

Expand Down Expand Up @@ -181,6 +181,7 @@ ingress:
| strategy | object | `{}` | Deployment [strategy](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy) configuration. |
| networkPolicy.enabled | bool | `false` | Create [Network Policies](https://kubernetes.io/docs/concepts/services-networking/network-policies/) |
| networkPolicy.egressRules | list | `[]` | A list of network policy egress rules |
| extraObjects | string | `nil` | extra objects to deploy (passed through tpl). Can be defined as a list or dictionary. List objects can template keys, but doesn't support merging from multiple values files. Dictionaries can't template keys, but can merge values files which makes it better suited for use with encrypted and unencrypted values files. |

## Migrating from stable/dex (or banzaicloud-stable/dex) chart

Expand Down
24 changes: 24 additions & 0 deletions charts/dex/templates/extraObjects.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{- /* Define extraObjects to handle both list and map scenarios */ -}}
{{- $extraObjects := .Values.extraObjects }}

{{- if not (kindIs "slice" .Values.extraObjects) }}
{{- if kindIs "map" .Values.extraObjects }}
{{- $extraObjects = list }}
{{- range $key, $value := .Values.extraObjects }}
{{- $extraObjects = append $extraObjects $value }}
{{- end }}
{{- else }}
{{- fail ".Values.extraObjects must be a list or dictionary object" }}
{{- end }}
{{- end }}

{{- range $extraObjects }}
---
{{- if kindIs "map" . }}
{{ tpl (toYaml .) $ }}
{{- else if kindIs "string" . }}
{{ tpl . $ }}
{{- else }}
{{- fail "grandchilden of .Values.extraObjects must be a dictionary or string" }}
{{- end }}
{{- end }}
27 changes: 27 additions & 0 deletions charts/dex/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -334,3 +334,30 @@ networkPolicy:
# ports:
# - port: 636
# protocol: TCP

# -- extra objects to deploy (passed through tpl).
# Can be defined as a list or dictionary.
# List objects can template keys, but doesn't support merging from multiple values files.
# Dictionaries can't template keys, but can merge values files which makes it better suited for use with encrypted and unencrypted values files.
extraObjects: []
# meaningless_key:
# apiVersion: v1
# kind: Secret
# type: Opaque
# metadata:
# name: google-serviceaccount
# data:
# token: |
# {{ print "super secret JSON file" | b64enc }}
# - |
# {{- range (list "1" "2" "3") }}
# ---
# apiVersion: v1
# kind: Secret
# type: Opaque
# metadata:
# name: google-serviceaccount
# data:
# {{ printf "serviceaccount-%s" . }}: |
# {{ print "super secret JSON file" | b64enc }}
# {{- end }}