feat: add Dex as oidc issuer - #3522
Draft
CasLubbers wants to merge 24 commits into
Draft
Conversation
j-zimnowoda
marked this pull request as ready for review
August 11, 2026 13:50
j-zimnowoda
requested review from
Ani1357,
ferruhcihan,
j-zimnowoda and
merll
as code owners
August 11, 2026 13:50
j-zimnowoda
marked this pull request as draft
August 11, 2026 13:50
Contributor
There was a problem hiding this comment.
Pull request overview
Introduces Dex as an alternative (and default) OIDC issuer for the platform by making OIDC consumers issuer-agnostic (using fully formed derived endpoints), wiring Dex into Helmfile/core namespaces, and adding a vendored Dex Helm chart plus templates/fixtures to support installation and secrets flow.
Changes:
- Add Dex app (values templates, schema, defaults, helmfile releases, core namespace, chart dependency) and document the architectural decision/migration path.
- Refactor OIDC URL handling to use derived, issuer-specific endpoints (auth/token/userinfo/jwks/logout/discovery) rather than appending Keycloak-specific paths.
- Centralize OIDC client secret store coordinates via
_derived.oidcClientSecretKey/_derived.oidcClientSecretPropertyand update consumers to read from them.
Reviewed changes
Copilot reviewed 49 out of 49 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| values/team-secrets/team-secrets-raw.gotmpl | Use derived secret-store coordinates for the shared OIDC client secret |
| values/team-ns/team-ns.gotmpl | Switch SSO config to derived issuer/jwks/logout URLs |
| values/prometheus-operator/prometheus-operator.gotmpl | Update Grafana OIDC endpoint wiring and gate Keycloak DB backup rule |
| values/prometheus-operator/prometheus-operator-team.gotmpl | Use derived OIDC auth/token/userinfo URLs for Grafana team config |
| values/prometheus-operator/prometheus-operator-raw.gotmpl | Read OIDC client secret via derived secret-store coordinates |
| values/otomi-api/otomi-api.gotmpl | Use derived JWKS URL env var for API SSO |
| values/oauth2-proxy/oauth2-proxy.gotmpl | Poll OIDC discovery URL instead of issuer root |
| values/oauth2-proxy/oauth2-proxy-raw.gotmpl | Read OIDC client secret via derived secret-store coordinates |
| values/kubernetes-gateways/kubernetes-gateways-raw.gotmpl | Use derived backchannel JWKS URL and issuer-agnostic logout destination |
| values/dex/dex.gotmpl | New Dex values template (image pinning, HTTPRoute, RBAC, resources) |
| values/dex/dex-raw.gotmpl | New Dex ExternalSecret assembling config.yaml + redirectURIs + secrets refs |
| values/argocd/argocd-raw.gotmpl | Read OIDC client secret via derived secret-store coordinates |
| values/apl-harbor-operator/apl-harbor-operator-raw.gotmpl | Read OIDC client secret via derived secret-store coordinates |
| values/apl-gitea-operator/apl-gitea-operator-raw.gotmpl | Read OIDC client secret via derived secret-store coordinates |
| values-schema.yaml | Add Dex app schema + add apps.keycloak.enabled switch |
| tests/fixtures/env/apps/dex.yaml | Add Dex fixture app config |
| src/common/values.ts | Derive Dex admin bcrypt hash from generated admin password |
| helmfile.d/snippets/routes.gotmpl | Use derived logout destination (issuer-specific) |
| helmfile.d/snippets/grafana.gotmpl | Accept full OIDC endpoint URLs (no Keycloak-specific path appends) |
| helmfile.d/snippets/derived.gotmpl | Derive issuer-specific OIDC endpoints + secret-store coordinates + logout URLs |
| helmfile.d/snippets/defaults.yaml | Enable Dex by default and disable Keycloak by default |
| helmfile.d/helmfile-05.init.yaml.gotmpl | Add Dex releases and gate Keycloak releases on apps.keycloak.enabled |
| helmfile.d/helmfile-04.init.yaml.gotmpl | Gate Keycloak operator releases on apps.keycloak.enabled |
| helmfile.d/helmfile-03.databases.yaml.gotmpl | Gate Keycloak database release on Keycloak enablement |
| core.yaml | Add dex namespace |
| charts/dex/values.yaml | Vendored Dex chart values |
| charts/dex/templates/tests/no-config-secret.yaml | Vendored chart test hook template |
| charts/dex/templates/servicemonitor.yaml | Vendored ServiceMonitor template |
| charts/dex/templates/serviceaccount.yaml | Vendored ServiceAccount template |
| charts/dex/templates/service.yaml | Vendored Service template |
| charts/dex/templates/secret.yaml | Vendored config Secret template |
| charts/dex/templates/rbac.yaml | Vendored RBAC templates |
| charts/dex/templates/poddisruptionbudget.yaml | Vendored PDB template |
| charts/dex/templates/NOTES.txt | Vendored chart notes |
| charts/dex/templates/networkpolicy.yaml | Vendored NetworkPolicy template |
| charts/dex/templates/ingress.yaml | Vendored Ingress template |
| charts/dex/templates/httproute.yaml | Vendored Gateway API HTTPRoute template |
| charts/dex/templates/hpa.yaml | Vendored HPA template |
| charts/dex/templates/deployment.yaml | Vendored Deployment template |
| charts/dex/templates/_helpers.tpl | Vendored helpers for naming/namespace/secret/SA |
| charts/dex/README.md | Vendored chart README |
| charts/dex/LICENSE | Vendored chart license |
| charts/dex/Chart.yaml | Vendored chart metadata (appVersion/annotations) |
| charts/dex/.helmignore | Vendored Helm ignore file |
| chart/chart-index/Chart.yaml | Add Dex dependency to chart index |
| adr/index.md | Add ADR entries for Dex issuer + migration path |
| adr/2026-08-06-keycloak-to-dex-migration-path.md | New ADR describing migration options/constraints |
| adr/2026-08-06-dex-as-issuer.md | New ADR accepting Dex as issuer for new clusters |
Suppressed comments (1)
charts/dex/Chart.yaml:9
appVersionis set to 2.44.0, but APL pins Dex to v2.45.1 viavalues/dex/dex.gotmpl. If the pinned image version is intentional, aligningappVersionavoids confusion and keeps the default image tag consistent when overrides are removed later.
appVersion: 2.44.0
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
321
to
323
| keycloak: | ||
| enabled: false | ||
| adminUsername: otomi-admin |
| {{- if .Values.configSecret.create }} | ||
| {{- default (include "dex.fullname" .) .Values.configSecret.name }} | ||
| {{- else }} | ||
| {{- default "default" .Values.configSecret.name }} |
| NOTE: It may take a few minutes for the LoadBalancer IP to be available. | ||
| You can watch the status of by running 'kubectl get --namespace {{ include "dex.namespace" . }} svc -w {{ include "dex.fullname" . }}' | ||
| export SERVICE_IP=$(kubectl get svc --namespace {{ include "dex.namespace" . }} {{ include "dex.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") | ||
| echo http://$SERVICE_IP:{{ .Values.service.port }} |
Comment on lines
+3
to
+7
| - kind: changed | ||
| description: "Update Dex to 2.44.0" | ||
| artifacthub.io/images: | | ||
| - name: dex | ||
| image: ghcr.io/dexidp/dex:v2.44.0 |
Comment on lines
+144
to
+148
| const dexAdminPasswordHash = (await $`htpasswd -nbBC 10 "" ${adminPassword}`).stdout | ||
| .trim() | ||
| .replace(/^:/, '') | ||
| .replace(/^\$2y\$/, () => '$2a$') | ||
| set(secrets, 'apps.dex.adminPasswordHash', dexAdminPasswordHash) |
| jwksUri: "{{ $keycloakRealm }}/protocol/openid-connect/certs" | ||
| issuer: "{{ $v._derived.oidcBaseUrl }}" | ||
| jwksUri: "{{ $v._derived.oidcJwksUrl }}" | ||
| clientId: {{ $a.keycloak.idp.clientID }} |
Comment on lines
113
to
115
| audiences: | ||
| - {{ $v.apps.keycloak.idp.clientID }} | ||
| fromHeaders: |
Comment on lines
138
to
+142
| data: | ||
| - secretKey: client_secret | ||
| remoteRef: | ||
| key: keycloak-secrets | ||
| property: idp_clientSecret | ||
| key: {{ $v._derived.oidcClientSecretKey }} | ||
| property: {{ $v._derived.oidcClientSecretProperty }} |
Comment on lines
54
to
+57
| - secretKey: clientSecret | ||
| remoteRef: | ||
| key: keycloak-secrets | ||
| property: idp_clientSecret | ||
| key: {{ $v._derived.oidcClientSecretKey }} | ||
| property: {{ $v._derived.oidcClientSecretProperty }} |
This reverts commit 361f44e.
…budget, and new config file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 Summary
🔍 Reviewer Notes
🧹 Checklist