You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/book/modules/admin/pages/infrastructure.adoc
+5-148Lines changed: 5 additions & 148 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -361,153 +361,10 @@ Install the following Red Hat services:
361
361
362
362
=== Red Hat Build of Keycloak Operator
363
363
364
-
* Install Red Hat Build of Keycloak Operator with deployment https://docs.redhat.com/en/documentation/red_hat_build_of_keycloak/26.2/html/operator_guide/installation-[guide].
365
-
366
-
==== Prerequisites
367
-
The Prerequisites for the Keycloak operator configuration are,
368
-
369
-
* Database
370
-
* Hostname
371
-
* TLS certificate and keys
372
-
373
-
[[_keycloak_postgres]]
374
-
===== Create PostgreSQL instance
375
-
* Login to `registry.redhat.io` using podman or docker cli
376
-
* Create Image pull secret for `registry.redhat.io` using the below command
* Create PostgreSQL database instance for Keycloak persistent storage with the below `StatefulSet` and `Service`
384
-
+
385
-
[source,yaml]
386
-
----
387
-
apiVersion: apps/v1
388
-
kind: StatefulSet
389
-
metadata:
390
-
name: postgres-tpa
391
-
namespace: <Installation Namespace>
392
-
spec:
393
-
serviceName: postgres-tpa-service
394
-
selector:
395
-
matchLabels:
396
-
app: postgres-tpa
397
-
replicas: 1
398
-
template:
399
-
metadata:
400
-
labels:
401
-
app: postgres-tpa
402
-
spec:
403
-
imagePullSecrets:
404
-
- name: docker-cred # Image pull secret
405
-
containers:
406
-
- name: postgres-tpa
407
-
image: registry.redhat.io/rhel9/postgresql-16 # Postgres image provided by Red Hat
408
-
volumeMounts:
409
-
- mountPath: /data
410
-
name: cache-volume
411
-
env:
412
-
- name: POSTGRESQL_USER
413
-
value: trustify
414
-
- name: POSTGRESQL_PASSWORD
415
-
value: trustify1234
416
-
- name: POSTGRESQL_DATABASE
417
-
value: trustify
418
-
volumes:
419
-
- name: cache-volume
420
-
emptyDir: {}
421
-
---
422
-
apiVersion: v1
423
-
kind: Service
424
-
metadata:
425
-
name: postgres-tpa
426
-
spec:
427
-
selector:
428
-
app: postgres-tpa
429
-
type: ClusterIP
430
-
ports:
431
-
- port: 5432
432
-
targetPort: 5432
433
-
----
434
-
435
-
[[_keycloak_hostname_]]
436
-
===== Hostname
437
-
* Keycloak can be exposed using OpenShift's DNS and wildcard routes. Retrieve the wild card with the below command,
438
-
+
439
-
[source, bash]
440
-
----
441
-
oc login
442
-
export NAMESPACE=<Installation Namespace>
443
-
export APP_DOMAIN=-$NAMESPACE.$(kubectl -n openshift-ingress-operator get ingresscontrollers.operator.openshift.io default -o jsonpath='{.status.domain}')
444
-
----
445
-
446
-
The value in `APP_DOMAIN` can be used for keycloak `hostname`
447
-
448
-
===== TLS certs and keys
449
-
* Retrieve the default router's TLS key and certificate, which will be used as a trust anchor for Keycloak. Then, create a Kubernetes `Secret` from these files.
* Make sure the Red Hat Build of Keycloak Operator is installed. Refer - Deployment https://docs.redhat.com/en/documentation/red_hat_build_of_keycloak/26.2/html/operator_guide/installation-[guide]
463
-
* Create a `Secret` to store the PostgreSQL database <<_keycloak_postgres,credentials>> that Keycloak will use to connect to the database.
* Define the `Keycloak` Custom Resource (CR) that the Keycloak Operator will use to deploy and configure your Keycloak instance.
471
-
+
472
-
[source,yaml]
473
-
----
474
-
apiVersion: k8s.keycloak.org/v2alpha1
475
-
kind: Keycloak
476
-
metadata:
477
-
name: example-kc
478
-
spec:
479
-
instances: 1
480
-
db:
481
-
vendor: postgres
482
-
usernameSecret:
483
-
name: keycloak-db-secret
484
-
key: username
485
-
passwordSecret:
486
-
name: keycloak-db-secret
487
-
key: password
488
-
host: postgres-tpa
489
-
database: trustify
490
-
port: 5432
491
-
http:
492
-
httpEnabled: true
493
-
httpPort: 8180
494
-
httpsPort: 8543
495
-
tlsSecret: my-tls-secret
496
-
hostname:
497
-
hostname: https://sso<Replace with$APP_DOAMIN> # APP_DOMAIN value --> 1
498
-
strict: false
499
-
backchannelDynamic: true
500
-
transaction:
501
-
xaEnabled: false
502
-
----
503
-
+
504
-
**References:**
505
-
+
506
-
. _APP_DOMAIN value:_ Replace the hostname with the APP_DOMAIN value retrieved from <<_keycloak_hostname_,Hostname>> step. The example would be something like this,
507
-
`hostname: https://sso-tpa.apps.ocp.cluster.net`
364
+
* Install and Deploy Red Hat Build of Keycloak Operator with https://docs.redhat.com/en/documentation/red_hat_build_of_keycloak/26.2/html/operator_guide/index[guide].
508
365
509
366
[[_keycloak_usage_]]
510
-
===== Usage
367
+
==== Retrieve Admin Credentials
511
368
* Retrieve the Admin console username and password using the below commands,
0 commit comments