keycloak
by CloudPirates
Open Source Identity and Access Management Solution
About this chart
Keycloak
A Helm chart for Keycloak - Open Source Identity and Access Management Solution. Keycloak provides user federation, strong authentication, user management, fine-grained authorization, and more. It supports modern standards like OpenID Connect, OAuth 2.0, and SAML.
Prerequisites
- Kubernetes 1.24+
- Helm 3.2.0+
- PV provisioner support in the underlying infrastructure (if persistence is enabled)
Installing the Chart
To install the chart with the release name my-keycloak:
helm install my-keycloak oci://registry-1.docker.io/cloudpirates/keycloak
To install with custom values:
helm install my-keycloak oci://registry-1.docker.io/cloudpirates/keycloak -f my-values.yaml
Or install directly from the local chart:
helm install my-keycloak ./charts/keycloak
The command deploys Keycloak on the Kubernetes cluster in the default configuration. The Configuration section lists the parameters that can be configured during installation.
Uninstalling the Chart
To uninstall/delete the my-keycloak deployment:
helm uninstall my-keycloak
The command removes all the Kubernetes components associated with the chart and deletes the release.
Security & Signature Verification
This Helm chart is cryptographically signed with Cosign to ensure authenticity and prevent tampering.
Public Key:
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE5U+rM2d3hDjgP5T3cLShuuQIU9vR
Z4/G+Nug6q5vRa+C3qUA1wXjbaJFAfcIrv5VjmYAYOj13shnPpp3Zh4fnQ==
-----END PUBLIC KEY-----
To verify the helm chart before installation, copy the public key to the file cosign.pub and run cosign:
cosign verify --key cosign.pub registry-1.docker.io/cloudpirates/keycloak:<version>
Configuration
The following table lists the configurable parameters of the Keycloak chart and their default values.
Global parameters
| Parameter | Description | Default |
|---|---|---|
global.imageRegistry | Global Docker image registry | "" |
global.imagePullSecrets | Global Docker registry secret names as an array | [] |
Common parameters
| Parameter | Description | Default |
|---|---|---|
nameOverride | String to partially override keycloak.fullname | "" |
fullnameOverride | String to fully override keycloak.fullname | "" |
namespaceOverride | String to override the namespace for all resources | "" |
commonLabels | Labels to add to all deployed objects | {} |
commonAnnotations | Annotations to add to all deployed objects | {} |
Keycloak image configuration
| Parameter | Description | Default |
|---|---|---|
image.registry | Keycloak image registry | docker.io |
image.repository | Keycloak image repository | keycloak/keycloak |
image.tag | Keycloak image tag (immutable tags are recommended) | "26.5.5@sha256:a7b0cb7a43a1235a61872883414d3f1d9a3ceac9df6e5907bd12202778a6265c" |
image.imagePullPolicy | Keycloak image pull policy | Always |
image.command | Keycloak container entrypoint command | "/opt/keycloak/bin/kc.sh" |
Deployment configuration
| Parameter | Description | Default |
|---|---|---|
replicaCount | Number of Keycloak replicas to deploy | 1 |
revisionHistoryLimit | Number of old StatefulSet revisions to retain for rollback | 10 |
Pod annotations and labels
| Parameter | Description | Default |
|---|---|---|
podAnnotations | Map of annotations to add to the pods | {} |
podLabels | Map of labels to add to the pods | {} |
Pod configuration
| Parameter | Description | Default |
|---|---|---|
shareProcessNamespace | Enable process namespace sharing between containers in the pod | false |
terminationGracePeriodSeconds | Seconds Kubernetes waits for the Keycloak pod to terminate. Leave empty to use the Kubernetes default | "" |
lifecycle | Lifecycle hooks for the Keycloak container | {} |
Extra volumes and volumes mount
| Parameter | Description | Default |
|---|---|---|
extraVolumes | Array of Volume to add to the keycloak pod | [] |
extraVolumeMounts | Array of VolumeMount to add to the keycloak container | [] |
preserveThemes | Disable mounting an emptyDir over /opt/keycloak/themes, preserving the themes bundled in the image | false |
preserveProviders | Disable mounting an emptyDir over /opt/keycloak/providers, preserving the providers bundled in the image | false |
Extra init containers for Keycloak pod
| Parameter | Description | Default |
|---|---|---|
extraInitContainers | Array of initContainer to add to the keycloak pod. Supports Helm template expressions (see Template Expressions in Extra Fields). | [] |
Extra containers for Keycloak pod
| Parameter | Description | Default |
|---|---|---|
extraContainers | Array of containers to add to the keycloak pod | [] |
Security
| Parameter | Description | Default |
|---|---|---|
podSecurityContext.fsGroup | Group ID for the volumes of the pod | 1001 |
podSecurityContext.seccompProfile | Seccomp profile for the pod | {type: RuntimeDefault} |
containerSecurityContext.allowPrivilegeEscalation | Enable container privilege escalation | false |
containerSecurityContext.runAsNonRoot | Configure the container to run as a non-root user | true |
containerSecurityContext.runAsUser | User ID for the Keycloak container | 1001 |
containerSecurityContext.runAsGroup | Group ID for the Keycloak container | 1001 |
containerSecurityContext.readOnlyRootFilesystem | Mount container root filesystem as read-only | false |
containerSecurityContext.capabilities.drop | Linux capabilities to be dropped | ["ALL"] |
Keycloak Configuration
| Parameter | Description | Default |
|---|---|---|
keycloak.adminUser | Keycloak admin username | admin |
keycloak.adminPassword | Keycloak admin password | "" |
keycloak.existingSecret | Name of existing secret to use for Keycloak admin credentials | "" |
keycloak.secretKeys.adminPasswordKey | Secret key for admin credentials | "admin-password" |
keycloak.hostname | Keycloak hostname including scheme (e.g. https://keycloak.example.com) | "" |
keycloak.hostnameAdmin | Keycloak admin hostname including scheme (e.g. https://keycloak.example.com) | "" |
keycloak.hostnameStrict | Enable strict hostname resolution | false |
keycloak.hostnameBackchannel | Keycloak backchannel hostname including scheme (e.g. https://keycloak.example.com) | "" |
keycloak.httpEnabled | Enable HTTP listener | true |
keycloak.httpsEnabled | Enable HTTPS listener (only when Keycloak itself terminates TLS via tls.enabled) | false |
keycloak.httpPort | HTTP port | 8080 |
keycloak.httpsPort | HTTPS port | 8443 |
keycloak.proxyHeaders | Proxy headers to trust (forwarded or xforwarded). Must be set when running behind a reverse proxy (e.g. nginx ingress). Leave empty only when Keycloak is directly exposed without a proxy. | "" |
keycloak.proxyProtocolEnabled | Whether the server should use the HA PROXY protocol when serving requests from behind a proxy. (true, false) | false |
keycloak.proxyTrustedAddresses | A comma separated list of trusted proxy addresses | "" |
keycloak.production | Enable production mode (runs start instead of start-dev). Should only be disabled for local development. | true |
keycloak.httpRelativePath | Set relative path for serving resources; must start with a / | / |
keycloak.extraArgsPrefix | Additional arguments to pass before the start command (e.g., for --config-file) | [] |
keycloak.extraArgs | Additional arguments to pass to the Keycloak startup command | [] |
TLS Configuration
| Parameter | Description | Default |
|---|---|---|
tls.enabled | Enable TLS/HTTPS support using custom certificates | false |
tls.existingSecret | Name of existing secret containing TLS certificate and key (PEM format, keys: tls.crt, tls.key) | "" |
tls.certificateFile | Path where the TLS certificate file will be mounted (internal) | "/opt/keycloak/certs/tls.crt" |
tls.certificateKeyFile | Path where the TLS certificate key file will be mounted (internal) | "/opt/keycloak/certs/tls.key" |
tls.certManager.enabled | Enable cert-manager integration for automatic certificate provisioning | false |
tls.certManager.issuerRef.name | Name of the cert-manager Issuer or ClusterIssuer | "" |
tls.certManager.issuerRef.kind | Kind of the cert-manager issuer (Issuer or ClusterIssuer) | ` |
Deploy keycloak with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has keycloak on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartkeycloak is pinned at v0.22.4 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply