Keycloak on OpenShift: when your platform team should run it
A platform team that already runs OpenShift and needs a self-managed identity provider inside its own clusters should deploy Keycloak with the Keycloak Operator from OperatorHub, which the Keycloak project recommends installing through Operator Lifecycle Manager. The Operator manages four custom resources: Keycloak for the server instances, KeycloakRealmImport for loading realm configuration, and KeycloakOIDCClient and KeycloakSAMLClient for declaring clients as code. That matters because it lets the platform team keep realms and clients in the same GitOps and change-control process as the rest of the cluster, instead of configuring them by hand in the admin console. The decision in front of you is less about whether Keycloak runs on OpenShift and more about which distribution you run and who supports it. You are choosing between the community build, which is Apache 2.0 licensed and maintained by the Keycloak project, and the Red Hat build of Keycloak, Red Hat's supported distribution that replaces Red Hat Single Sign-On.
Before you commit, confirm with Red Hat and your own support contracts which Keycloak version, Operator channel and OpenShift versions the Red Hat build supports for your environment, because the Red Hat product page and the upstream release line do not move in lockstep. Also confirm whether your OpenShift subscription already covers the Red Hat build, since that determines who you call when a production incident happens. The upstream project ships minor releases several times a year, so a platform team needs an Operator update policy it can defend. The Operator documentation strongly recommends manual approval mode for operator updates to avoid unintended automatic upgrades, and that recommendation should shape how you stage changes across development, test and production clusters.
Run it yourself on OpenShift when your platform team already owns cluster lifecycle, can staff on-call for the identity service, and wants identity to sit inside the same clusters, network policies and monitoring stack as the workloads it protects. Hand part of the work to a partner when the first deployment, the database and high availability design, or the upgrade runbook is new to your team, or when you need evidence of the configuration for an assessment. In either case, write down the owner of each Keycloak resource, the database you will use and the Operator channel you will track before the first Keycloak resource is applied. Those three decisions drive most of the later work on routes, TLS and realm promotion.
How a login request reaches Keycloak on OpenShift
A login starts with a browser request to the public hostname, which resolves to the OpenShift router. The route terminates TLS and re-encrypts traffic to the Keycloak pods, so the cluster sees a second TLS hop before any user data is processed. Keycloak then reads and writes its state in an external PostgreSQL database, which sits in a separate trust zone. The admin console is reached on a separate hostname through its own route, so administrative traffic never shares the public path. Check each boundary when you review the design.
Public, cluster and database trust zones, with the admin hostname as a separate path.
Community build or Red Hat build of Keycloak on OpenShift
The community build is the upstream Keycloak project, licensed under Apache 2.0, and it is the distribution the project's own release process produces. Platform teams that already operate OpenShift and have people who can read release notes, test upgrades and own patching usually choose this path. The Keycloak blog describes a cadence of four minor releases a year since Keycloak 26.0, with breaking changes in minor releases made opt-in, which means the team must schedule a regular upgrade cycle rather than waiting for a vendor to backport fixes.
- Release tracking: Your team follows each minor release, reads the upgrade notes and decides when to move the Operator-managed Keycloak custom resource to a new version. The current release listed in the supplied facts is 26.8.1.
- Operator update control: The Keycloak Operator documentation strongly recommends manual approval mode for operator updates, so upgrades happen only when your change process approves them.
- Support boundary: Community support comes through the project's public channels, not a contract with service levels, so incident response depends on your own staff and your partner's retainer if you have one.
- Image and provider ownership: You decide which image is built, which providers and themes are added, and how vulnerabilities in base images are patched.
- Database and HA ownership: You select the supported database and the high availability design, and you test failover yourself.
Before committing to this path, confirm with your security team that it can produce the patch evidence your assessors expect, and that the platform team has time reserved for each minor upgrade.
The Red Hat build of Keycloak is Red Hat's supported distribution based on the open source project, and it replaces Red Hat Single Sign-On. Organizations that already hold Red Hat subscriptions, operate under procurement rules that require a vendor to answer for the product, or must show a named support path usually evaluate this build first. Red Hat's product page showed version 26.6 as its latest at the time of the supplied research, so the supported version can lag the upstream release, which affects how quickly you can adopt new features.
- Subscription scope: The subscription covers the product and its support terms, and the scope, entitlement counts and support hours must be confirmed directly with Red Hat before purchase.
- Supported versions: Red Hat decides which versions it supports and for how long. Ask which version is current, which is the oldest supported release and what the end-of-support dates are.
- Migration from Red Hat Single Sign-On: Existing RH-SSO estates need a planned move to the new distribution, which is covered in the migration content group.
- Patch delivery: Ask how security fixes are delivered, through which images or channels, and what notice you receive before a fix is released.
- Operator and image source: Confirm which catalog, registry and Operator channel the subscription grants access to, because your mirroring and air-gapped plans depend on it.
Before signing, request the current support terms in writing from Red Hat and compare them with the release pace your team can sustain.
The decision is rarely about features, since both builds run the same core server. It is about who answers for defects, how fast security fixes reach production and whether your organization requires a contracted party. Platform teams with mature change management and an upgrade calendar can work well with the community build. Risk committees, regulated institutions and public sector buyers often ask for a vendor relationship, documented support windows and a single escalation path, which points toward the Red Hat build.
- Platform teams: Choose the community build when your team can absorb four minor releases a year and maintain its own test environments.
- Regulated organizations: Choose the Red Hat build when the control evidence requires a supported product with published lifecycle dates.
- Mixed estates: Some organizations run the community build in non-production for early testing and the supported build in production, which requires keeping the two configurations aligned.
- Cost components: The community build has no license fee, but it carries staff time, testing environments and possibly an implementation partner. The Red Hat build adds a subscription, and it also carries those internal costs.
- Exit criteria: Document how you would switch distributions later, since configuration exported from one should load into the other.
Ask your security, procurement and platform leads to write down the support and patch expectations they require, then test the chosen build against them.
Which options fit which OpenShift setup
This table compares the route and TLS pattern, database choice and schema migration mode for Keycloak on OpenShift, with the setups each one suits. Read each row against your own network policy, database standard and change process, and treat the confirmation column as the list to take to your platform and database teams before you pick.
| Option | Best fit | Trade-off | What to confirm |
|---|---|---|---|
| Route with TLS re-encrypt | Clusters where the router must inspect or terminate public TLS and Keycloak still receives encrypted traffic internally | The router holds a certificate for the public hostname, and certificates must be renewed and trusted on both hops | Which certificate authority issues the public certificate and whether the internal trust chain is configured in Keycloak |
| Route with TLS passthrough | Setups where the security team requires end-to-end TLS to the Keycloak pod and no TLS termination at the router | The router cannot apply edge policies to the traffic, and proxy header handling must be verified in Keycloak | Whether your OpenShift ingress controller supports passthrough routes and how client IP and forwarded headers reach Keycloak |
| PostgreSQL (14 to 18) | Most OpenShift deployments, since it is the commonly chosen supported database for Keycloak | Requires a synchronously replicated setup for high availability designs, which adds database operations work | Which PostgreSQL versions your database team supports and whether a managed or operator-run instance is available |
| MariaDB, MySQL, Microsoft SQL Server, Oracle Database | Organizations that already run and support one of these engines under their own standards | Driver and image choices differ, and Oracle drivers are not bundled with Keycloak, so they must be added to a custom image | Whether the engine version is on the supported list and who supplies and licenses the JDBC driver |
| EnterpriseDB Advanced, Amazon Aurora PostgreSQL, Azure SQL | Teams standardized on these managed or enterprise database offerings | Vendor-specific features and failover behavior must be checked against the high availability design | Which database offering and version your organization has approved, and the failover and backup behavior it provides |
| Dev-file database | Local development and testing only | Not supported for production, so it cannot serve a production OpenShift deployment | Replace it with a supported database before any shared or production environment is created |
| Schema migration at startup | Smaller or lower-risk environments where the operator applies schema changes automatically on start | Schema changes run as part of pod startup, so a failed migration can block the rollout | Whether change control allows automatic schema changes and how you will test them in a non-production environment first |
| Manual schema migration | Large deployments or regulated change processes that require reviewed SQL before each upgrade | Adds a step to every Keycloak upgrade and needs a documented runbook and database access | Who reviews and applies the SQL, and how the team verifies the schema matches the running release |
How routes and TLS re-encryption shape the Keycloak hostname
The production guide asks for TLS on all communication, and on OpenShift that requirement shapes how the Route and the Keycloak hostname are designed together. The OpenShift router terminates the public connection and, with re-encryption, opens a second TLS session to the Keycloak pod. Each leg needs a certificate the other side trusts, so decide early which certificate the router presents to browsers, which certificate Keycloak presents to the router, and whether the internal CA is trusted by the router. A mismatch here usually shows up later as login redirects to the wrong scheme or as failed backchannel calls, not as an obvious TLS error.
Keycloak builds its issuer, redirect and endpoint URLs from its configured frontend hostname, so the value the Route exposes must match what clients and tokens expect. Keep the frontend URL public and the admin console and Administration REST API on a separate hostname or context path, as the production guide recommends, and block the admin paths on the public Route. The production guide also calls for a reverse proxy with path restrictions, and on OpenShift that role is shared between the router, Route configuration and any additional ingress you add. Confirm in your cluster which paths the public Route reaches, and test that /admin and the admin REST paths return errors from the public hostname.
Operator field names for hostnames, TLS secrets and Route settings change between releases, so do not copy them from older examples. Check the Keycloak Operator reference for your installed version, and confirm how the Operator creates the Route and whether it manages re-encryption or leaves it to you. Plan a test that changes the frontend hostname in a non-production realm of the same version, then confirm that issuer values, redirect URIs and the discovery document all match before any client points at production. Also confirm how internal services reach Keycloak, since in-cluster calls may need a backchannel URL rather than the public hostname.
Deploying Keycloak with the Operator on OpenShift
This sequence takes a cluster from version checks and a supported external database to a running Keycloak instance, with realms imported and the admin console, metrics endpoint and database schema verified. Each step closes with a check so the team knows it can move on.
Confirm OpenShift and Kubernetes version support
The platform team confirms the OpenShift release in use, its underlying Kubernetes version and the Keycloak release they plan to run, then checks each against the vendor and project support statements before anything is installed. Kubernetes publishes its supported minor releases on its releases page, and the version skew policy limits how far node components can lag the API server, so the cluster should be on a supported minor version before the Operator is added. Red Hat's build of Keycloak and the community release have different support terms, so confirm which build the organization is entitled to run. The check is a written record of the cluster version, the Keycloak build and version, and the support end dates that apply to each.
Provision a supported external database
The database team creates a production database from Keycloak's supported list, usually PostgreSQL, in a place the cluster can reach over the network, and creates a dedicated database user with rights limited to that database. The dev-file database bundled for development cannot be used in production, so this step is not optional. Confirm the database version against the Keycloak database guide before you create it, and plan for replication if the high availability design requires synchronous replication. The check is a successful test connection from a pod on the same network segment as the planned Keycloak namespace, using the credentials that will be stored in a secret.
Install the Operator from OperatorHub in manual approval mode
A cluster administrator installs the Keycloak Operator from OperatorHub through Operator Lifecycle Manager, which the Keycloak Operator documentation recommends, and selects manual approval for operator updates. Manual approval stops an operator upgrade from happening on its own, so each new Operator version is reviewed against the Keycloak upgrade notes before it is approved. The Operator installs the custom resources for Keycloak, KeycloakRealmImport and the client types. The check is an installed Operator with a healthy status in the target namespace, and the Keycloak, KeycloakRealmImport and client custom resource definitions visible through the cluster API.
Create TLS secrets, hostnames and database credentials
The platform team creates the public hostname for the Keycloak frontend, a separate hostname or path for the admin console and Administration REST API, and the TLS certificates for each, following the production guide that calls for TLS on all communication. Store the database credentials and the admin bootstrap credentials as Kubernetes secrets in the Keycloak namespace, never in plain manifests. Confirm with the certificate authority and the DNS team which names the router will serve and whether the internal backchannel needs its own name. The check is that each secret exists in the namespace, the certificates chain to a trusted root, and DNS resolves each hostname to the router address.
Deploy the Keycloak custom resource
The engineer applies a Keycloak custom resource that references the database secret, the hostnames, the TLS secret and the number of instances the design calls for, and sets the admin console to a path or hostname that the public frontend does not expose. The Operator starts the pods, runs the schema migration at startup unless the team has chosen manual migration for a large database, and reports status on the resource. Confirm the routing and TLS re-encryption choices with the cluster networking team before exposing the route. The check is a Keycloak resource reporting ready, with all pods running and the logs showing a completed database migration without errors.
Import realms with KeycloakRealmImport
The identity team applies a KeycloakRealmImport resource that points at a realm export stored in version control, with secrets removed from the file and supplied through the cluster instead. Realm exports omit or mask some secret values, so client secrets and identity provider credentials must be restored separately before users sign in. Run the import in a non-production namespace first, then repeat it in production once the realm content has been reviewed. The check is that the import resource reports completed, the realm appears in the admin console, and a test client can complete a login against it.
Verify the admin console, metrics and database schema
The engineer signs in to the admin console through its separate hostname, confirms the public frontend does not serve admin paths, and checks that the Prometheus endpoint at /metrics responds on the management interface after metrics have been enabled with the documented setting. The DBA confirms that the schema version recorded in the database matches the Keycloak release that was deployed. Record the results with the Operator version, Keycloak version and database version in the change record. The check is a successful admin login, a metrics scrape from the monitoring system, a schema version that matches the deployed release, and a note in the change record that the verification is complete.
Security controls to set before go-live
Six controls cover the path a request takes into Keycloak, the secrets it depends on, and the workload and operator settings that run it. Each one has a check you can verify before users sign in. Review them together, because a strong TLS setup does not help if the admin console is reachable from the public hostname or if the database password sits in a realm export.
Separate the admin hostname
Keycloak's production guide calls for exposing the admin console and Administration REST API on a different hostname or context path from public frontend URLs. On OpenShift, that means a second Route or a restricted path on the reverse proxy, with network policy or an IP allow list limiting who can reach it. Check that the public Route returns nothing for admin paths and that admin login works only from the管理 network you intend.
Keycloak production guideTLS on every hop
Keycloak's production guide calls for TLS on all communication. On OpenShift, a Route with re-encrypt termination keeps the edge certificate public while the router re-encrypts traffic to the Keycloak pod, which then needs its own certificate. Confirm that the backchannel URLs used by internal clients also use HTTPS and that the truststores your applications rely on are current, since certificate mismatches are a common source of sign-in failures.
Keycloak production guideKeep secrets out of realm exports
Database credentials and the initial admin credentials should come from Kubernetes Secrets, not from realm JSON files or Git. Realm exports and KeycloakRealmImport resources can carry client secrets, so review them before they are stored or promoted. Kubernetes Secrets are stored unencrypted in etcd by default, so enable encryption at rest for the cluster or source the values from an external store through the Secrets Store CSI Driver. Ask your cluster team which option is in place.
Kubernetes Secrets practicesLeast-privilege RBAC on the namespace
Limit who can read Secrets, edit the Keycloak custom resources and exec into pods in the Keycloak namespace. Bind roles to named groups rather than individual users, and keep list and watch access on Secrets to a small set of service accounts, since those verbs expose values as readily as get. Review the operator's service account permissions as well, because the operator creates and changes the objects that run Keycloak.
Pod Security Standards for Keycloak pods
Apply the restricted Pod Security Standard to the Keycloak namespace where your workloads allow it. In practice this means non-root users, no privilege escalation, dropped Linux capabilities and a read-only root filesystem where Keycloak can run with it. Test the pods against the policy in a staging namespace first, because a custom image that writes to unexpected paths will fail admission. Record the policy level in your namespace configuration so auditors can see it.
Pod Security StandardsManual approval for operator updates
The Keycloak Operator documentation strongly recommends manual approval mode for operator updates to avoid unintended automatic upgrades. Under Operator Lifecycle Manager, set the subscription to manual, then review the release notes and upgrade notes for each Keycloak version before approving. A Keycloak minor upgrade can change defaults, so schedule the change, run it in staging first and keep the database backed up before approval.
Operator installation guideQuestions buyers ask before deploying Keycloak on OpenShift
What drives the cost of deploying Keycloak on OpenShift?
Cost follows the scope you agree in writing, and the largest drivers are cluster readiness, the database, the high availability design, realm migration and the support model. A cluster that already has an ingress controller, storage classes, a working certificate process and an approved Operator catalog takes less effort to build on than one that needs those first. The database is a separate cost: Keycloak supports several production databases, and provisioning, backup and replication for it are often the largest variable. Realm migration adds work when existing applications, identity sources and client configurations must be moved and tested. Each cost component is paid for in different ways: your team's time, a partner's fixed-scope work, cloud or licensing for the database, and any subscription for a supported distribution. Ask for a quote that lists each component separately so you can see what recurs and what is one time. See the Keycloak Operator installation guide for the components involved.
How long does a Keycloak on OpenShift deployment take?
Duration depends on scope, and no fixed timeline applies to every environment. A proof of concept on a cluster you already run is much shorter than a production build with a clustered database, multiple identity sources, realm migration and a tested rollback. The biggest schedule risks are waiting for cluster access, DNS records, certificates and database provisioning, not the Operator install itself. Migration work and testing of each application's sign-in flow often take longer than expected. Ask any provider to break the schedule into phases (readiness, build, migration, testing, cutover) and to state which of your dependencies each phase assumes. Dates are only meaningful once those dependencies are confirmed.
What must our internal team provide before the work starts?
Your team usually provides the inputs that a partner cannot create alone. Before the build starts, confirm the following:
- Cluster access, with rights to install Operators and create namespaces, routes and secrets
- DNS records for the public and admin hostnames, and an agreed hostname plan
- TLS certificates and the CA chain used for re-encryption to the pods
- A supported database instance, with credentials, backup and network access from the cluster
- Identity sources such as LDAP, Active Directory or upstream identity providers, with service accounts
- Named owners for approvals, change windows and the application teams that will test sign-in
When any of these is missing, the work stops or shifts to workarounds that later need rework.
Can our own team deploy Keycloak on OpenShift without a partner?
Yes, many teams do, provided they have engineers who already run OpenShift and understand OpenID Connect and SAML. The Operator handles much of the lifecycle, and Keycloak's documentation covers the Keycloak, KeycloakRealmImport and client resources. The questions to weigh are capacity and skills: whether the team can design the high availability architecture, validate database failover, manage realm configuration as code and test every application's login path before cutover. Keep Operator updates on manual approval, as the Operator documentation recommends, so that someone reviews each upgrade. If your team can cover those tasks, building in-house is a reasonable choice. If not, a fixed-scope partner engagement can cover the gaps, with knowledge transfer written into the scope.
Do we need a Red Hat subscription to run Keycloak on OpenShift?
A subscription is not required to run the open source Keycloak project, which is licensed under Apache 2.0, and the Operator can deploy the upstream Keycloak images. A Red Hat build of Keycloak subscription changes what you receive: Red Hat's supported distribution, its support terms, and its release and lifecycle commitments. Whether that support is worth the cost depends on your internal support obligations, your regulator's expectations for vendor support and how quickly you need fixes backported. Red Hat's product page lists the current supported version, and the support terms and pricing come from Red Hat or a reseller. Ask Red Hat for the exact entitlements and support dates before you choose a build.
Which database should we choose for Keycloak on OpenShift?
Choose a database that Keycloak supports for production and that your organization can operate, back up and restore. Keycloak's database guide lists MariaDB, Microsoft SQL Server, MySQL, Oracle Database, PostgreSQL (14 to 18), EnterpriseDB Advanced, Amazon Aurora PostgreSQL and Azure SQL. The default dev-file database is for development only. The choice affects licensing, operating skills and the replication you must build for high availability, since both supported multi-node designs need a synchronously replicated database. Confirm the database version and driver support with the Keycloak documentation before you provision it, and check whether your database platform is run by a team that already has backup and restore procedures tested.
How should a Keycloak on OpenShift deployment handle upgrades safely?
Plan upgrades as a repeatable change with a tested rollback, not as a one-off Operator update. Keep Operator approval in manual mode, as the Operator documentation strongly recommends, so that each upgrade is reviewed. Keycloak can migrate its database schema automatically at startup, and the upgrade guide also supports manual migration, which the documentation suggests for large deployments. Read the release notes for each target version, since the 26.8 notes include changes such as enforced SMTP StartTLS and mandatory signature validation of backchannel logout tokens from external providers. Keycloak plans four minor releases a year, so budget recurring effort for upgrades in your support model.
Upgrading the Operator and Keycloak without surprises
Set the Operator to manual approval mode before anything else. The Keycloak Operator documentation strongly recommends this for operator updates, because an automatic update can move the controller to a new version without a change window, a test run or a rollback plan. With manual approval, the platform team reviews each Operator update in a staging namespace, checks the Keycloak version the new Operator deploys, and approves the install in the production cluster on a planned date. Confirm who holds the approval step, where the decision is recorded, and how the Operator and the Keycloak custom resource versions are pinned in your Git repository.
Decide how the database schema changes before the first upgrade. Keycloak migrates its schema automatically at startup by default, which is convenient for small environments but means a rolling restart can run a migration on the first pod that starts. For large deployments, the upgrading guide suggests manual migration, where your database team reviews and applies the SQL, then Keycloak starts against a schema it already accepts. Ask your database owner to take a verified backup and restore point before any migration, and rehearse the migration against a copy of production data. Note that the Red Hat build may follow its own support matrix for upgrades, so confirm the supported path with Red Hat before you commit to a sequence.
Read the Keycloak 26.8 upgrade notes against your current configuration before you change the version. Four changes need an owner: SMTP connections must use StartTLS with no plaintext fallback, so confirm your relay supports it; backchannel logout tokens from external providers must pass signature validation; login failures are persisted to the database by default, which adds write load and retention questions for your DBA; and the deprecated multi-site feature should move to the stateless approach. Finally, enable metrics with --metrics-enabled=true in a pre-production environment and confirm that Prometheus can scrape /metrics on the management interface before the upgrade, so you have a baseline for latency, errors and cache behavior to compare afterward.
How DeployOpen scopes and delivers Keycloak on OpenShift
DeployOpen plans, implements, hardens, documents and supports self-hosted Keycloak inside your own OpenShift clusters and network. Work starts from a written scope that fixes the deliverables for your route, TLS, database and realm configuration before any build begins.
How we scope
- We confirm the OpenShift version, cluster topology and whether you run Keycloak or the Red Hat build of Keycloak.
- We agree the database choice, high availability design and the hostnames for public and admin access in writing.
- We list the realms, clients, identity providers and realm import resources that the written scope will cover.
How we build
- We install the Keycloak Operator through Operator Lifecycle Manager with manual approval mode for operator updates.
- We configure routes with TLS re-encryption, the production database connection and the admin hostname separate from public frontend URLs.
- We test login, token issuance, logout, metrics exposure and failover against the scope before any handover.
How we hand over
- You receive the deployed configuration, Operator resources and realm import definitions stored in your own version control.
- We document the build sequence, configuration decisions, secrets locations and the steps to upgrade the Operator and Keycloak.
- We walk your platform, security and identity teams through the runbooks and the verification results for their review.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers after the initial handover.
- We plan Keycloak minor and major release upgrades, including database schema migration and the upgrade notes for each release.
- We prepare configuration and evidence that your compliance and security teams can review during their own assessments.

