High-Level Architecture & Testing Guide
HAProxy performs a two-step health check: it verifies the Patroni leader status (/primary) and the Keycloak health (/realms/master). HTTP traffic is only routed to the site whose PostgreSQL is the active primary — ensuring that Keycloak and its database are always on the same site. When the leader changes (failover or switchover), all traffic moves together.
Test credentials: any LDAP user (e.g. aragorn, gandalf) with password Test123
| Field | Meaning |
|---|---|
| ACTIVE SITE | Which Keycloak site is currently serving HTTP traffic |
| SITE-A / SITE-B | UP or DOWN based on direct health check to each Keycloak |
| Field | Meaning |
|---|---|
| Serving | Which Keycloak site served the last polled request |
| Auth status | Authenticated (green) or Not Authenticated (red) |
Scales Keycloak pods to 0 or 1 on each site.
aragorn / Test123.keycloak-b. Footer shows Serving: keycloak-b.keycloak-a.Scales Data Grid (Infinispan) pods to 0 or 1 on each site.
aragorn / Test123.Switches Keycloak between external Data Grid cache and local embedded cache.
| Mode | Behavior |
|---|---|
| External (Data Grid) | Full HA with cross-site session replication. Failover preserves sessions. |
| Local | Each Keycloak uses its own embedded cache. No cross-site replication. Failover loses sessions. |
| Button | Action |
|---|---|
| List | Shows all active sessions in realm middleearth |
| Kill My Session | Terminates your current session. You will be logged out after 2 seconds. |
Shows the Patroni cluster status in real-time.
| Badge | Meaning |
|---|---|
| Leader | This node is the PostgreSQL primary (accepts writes) |
| Replica | This node is a streaming replica (read-only) |
| Stopped | Patroni service is not running on this node |
| Button | Action |
|---|---|
| Stop | Stops Patroni service on the node (simulates failure) |
| Start | Starts Patroni service on the node |
| Switchover | Promotes the replica to leader (planned switchover) |
keycloak-b (HTTP traffic follows the database leader).Serving: keycloak-b.keycloak-b.aragorn / Test123.keycloak-a, Leader = pg-a, Serving = keycloak-a.keycloak-b, Leader = pg-b, Serving = keycloak-b.| Section | Content |
|---|---|
| Token toolbar | Expiry countdown, email, username, refresh count |
| Encoded Token | Raw JWT with color-coded header / payload / signature |
| Access Token tab | Decoded header + payload (roles, scope, session ID) |
| ID Token tab | Decoded header + payload (user profile, email) |
| Copy | Copies the raw access token to clipboard |
| Refresh Token | Forces token refresh (grant_type=refresh_token) |