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: add keycloak sso realm values #352

Merged
merged 6 commits into from
Apr 19, 2024
Merged
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
16 changes: 16 additions & 0 deletions src/keycloak/chart/templates/secret-kc-realm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ include "keycloak.fullname" . }}-realm-env
namespace: {{ .Release.Namespace }}
labels:
{{- include "keycloak.labels" . | nindent 4 }}
type: Opaque
data:
{{- range $key, $value := .Values.realmInitEnv }}
{{- if eq (typeOf $value) "bool" }}
REALM_{{ $key }}: {{ toString $value | b64enc }}
{{- else }}
REALM_{{ $key }}: {{ $value | b64enc }}
{{- end }}
{{- end }}
3 changes: 3 additions & 0 deletions src/keycloak/chart/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ spec:
# This will only import the realm if it does not exist
- "--import-realm"
- "--features=preview"
envFrom:
- secretRef:
name: {{ include "keycloak.fullname" . }}-realm-env
env:
# Common configuration
- name: UDS_DOMAIN
Expand Down
7 changes: 7 additions & 0 deletions src/keycloak/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ domain: "###ZARF_VAR_DOMAIN###"
# The primary Keycloak realm
realm: uds

# UDS Identity Config Environment Variables. More info here: https://github.com/defenseunicorns/uds-identity-config/blob/main/docs/CUSTOMIZE.md#override-default-realm
realmInitEnv:
GOOGLE_IDP_ENABLED: false
# Other UDS Identity Config fields that will be used in the realm.json initalization of keycloak
# GOOGLE_IDP_CLIENTID: ""
# GOOGLE_IDP_CLIENT_SECRET: ""

# Generates an initial password for first admin user - only use if install is headless
# (i.e. cannot hit keycloak UI with `zarf connect keycloak`), password should be changed after initial login
insecureAdminPasswordGeneration:
Expand Down