Skip to content

Commit 4f8d0d9

Browse files
committed
Update Examples for the Latest Version of Keycloak
The Keycloak example now works with the latest version of Keycloak. This includes using the new env vars and settings that are now available in the latest version of Keycloak. The PostgresCluster's created for the Keycloak examples (which includes any PostgresCluster's created for use with Keycloak in the Crunchy Postgres for Kubernetes documentation) have also been updated to set the "autoCreateUserSchema" annotation to "true". Without this setting, Keycloak will crash on startup when attempting to use the public schema.
1 parent d7d4c98 commit 4f8d0d9

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

kustomize/keycloak/keycloak.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,24 @@ spec:
1919
args: ["start-dev"]
2020
name: keycloak
2121
env:
22-
- name: DB_VENDOR
22+
- name: KC_DB
2323
value: "postgres"
24-
- name: DB_ADDR
24+
- name: KC_DB_URL_HOST
2525
valueFrom: { secretKeyRef: { name: keycloakdb-pguser-keycloakdb, key: host } }
26-
- name: DB_PORT
26+
- name: KC_DB_URL_PORT
2727
valueFrom: { secretKeyRef: { name: keycloakdb-pguser-keycloakdb, key: port } }
28-
- name: DB_DATABASE
28+
- name: KC_DB_URL_DATABASE
2929
valueFrom: { secretKeyRef: { name: keycloakdb-pguser-keycloakdb, key: dbname } }
30-
- name: DB_USER
30+
- name: KC_DB_USERNAME
3131
valueFrom: { secretKeyRef: { name: keycloakdb-pguser-keycloakdb, key: user } }
32-
- name: DB_PASSWORD
32+
- name: KC_DB_PASSWORD
3333
valueFrom: { secretKeyRef: { name: keycloakdb-pguser-keycloakdb, key: password } }
34-
- name: KEYCLOAK_ADMIN
34+
- name: KC_BOOTSTRAP_ADMIN_USERNAME
3535
value: "admin"
36-
- name: KEYCLOAK_ADMIN_PASSWORD
36+
- name: KC_BOOTSTRAP_ADMIN_PASSWORD
3737
value: "admin"
38-
- name: KC_PROXY
39-
value: "edge"
38+
- name: KC_PROXY_HEADERS
39+
value: "xforwarded"
4040
ports:
4141
- name: http
4242
containerPort: 8080

kustomize/keycloak/postgres.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ apiVersion: postgres-operator.crunchydata.com/v1beta1
22
kind: PostgresCluster
33
metadata:
44
name: keycloakdb
5+
annotations:
6+
postgres-operator.crunchydata.com/autoCreateUserSchema: "true"
57
spec:
68
postgresVersion: 17
79
instances:

kustomize/postgres/postgres.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ apiVersion: postgres-operator.crunchydata.com/v1beta1
22
kind: PostgresCluster
33
metadata:
44
name: hippo
5+
annotations:
6+
postgres-operator.crunchydata.com/autoCreateUserSchema: "true"
57
spec:
68
postgresVersion: 17
79
users:
8-
- name: rhino
10+
- name: hippo
911
databases:
1012
- zoo
1113
instances:

0 commit comments

Comments
 (0)