keycloak
Open Source Identity and Access Management For Modern Applications and Services
About this chart
Keycloak
Keycloak is an open source identity and access management for modern applications and services.
TL;DR;
$ helm install keycloak codecentric/keycloak
Introduction
This chart bootstraps a Keycloak StatefulSet on a Kubernetes cluster using the Helm package manager. It provisions a fully featured Keycloak installation. For more information on Keycloak and its capabilities, see its documentation.
Prerequisites Details
The chart has an optional dependency on the PostgreSQL chart. By default, the PostgreSQL chart requires PV support on underlying infrastructure (may be disabled).
Important
Since Version v16.0.0 the support for Helm v2 is dropped in favor of to support also the latest postgres Helm Chart Version which requires Helm v3 only.
Installing the Chart
To install the chart with the release name keycloak:
$ helm install keycloak codecentric/keycloak
Uninstalling the Chart
To uninstall the keycloak deployment:
$ helm uninstall keycloak
Configuration
The following table lists the configurable parameters of the Keycloak chart and their default values.
| Parameter | Description | Default |
|---|---|---|
fullnameOverride | Optionally override the fully qualified name | "" |
nameOverride | Optionally override the name | "" |
replicas | The number of replicas to create | 1 |
image.repository | The Keycloak image repository | quay.io/keycloak/keycloak |
image.tag | Overrides the Keycloak image tag whose default is the chart version. Note versions after 16.1.1 need to use the -legacy suffix, e.g. 17.0.1-legacy | "" |
image.pullPolicy | The Keycloak image pull policy | IfNotPresent |
imagePullSecrets | Image pull secrets for the Pod | [] |
hostAliases | Mapping between IPs and hostnames that will be injected as entries in the Pod's hosts files | [] |
enableServiceLinks | Indicates whether information about services should be injected into Pod's environment variables, matching the syntax of Docker links | true |
podManagementPolicy | Pod management policy. One of Parallel or OrderedReady | Parallel |
updateStrategy | StatefulSet update strategy. One of RollingUpdate or OnDelete | RollingUpdate |
restartPolicy | Pod restart policy. One of Always, OnFailure, or Never | Always |
serviceAccount.create | Specifies whether a ServiceAccount should be created | true |
serviceAccount.name | The name of the service account to use. If not set and create is true, a name is generated using the fullname template | "" |
serviceAccount.annotations | Additional annotations for the ServiceAccount | {} |
serviceAccount.labels | Additional labels for the ServiceAccount | {} |
serviceAccount.imagePullSecrets | Image pull secrets that are attached to the ServiceAccount | [] |
rbac.create | Specifies whether RBAC resources are to be created | false |
rbac.rules | Custom RBAC rules, e. g. for KUBE_PING | [] |
podSecurityContext | SecurityContext for the entire Pod. Every container running in the Pod will inherit this SecurityContext. This might be relevant when other components of the environment inject additional containers into running Pods (service meshes are the most prominent example for this) | {"fsGroup":1000} |
securityContext | SecurityContext for the Keycloak container | {"runAsNonRoot":true,"runAsUser":1000} |
extraInitContainers | Additional init containers, e. g. for providing custom themes | [] |
skipInitContainers | Skip all init containers (to avoid issues with service meshes which require sidecar proxies for connectivity) | false |
extraContainers | Additional sidecar containers, e. g. for a database proxy, such as Google's cloudsql-proxy | [] |
lifecycleHooks | Lifecycle hooks for the Keycloak container | {} |
terminationGracePeriodSeconds | Termination grace period in seconds for Keycloak shutdown. Clusters with a large cache might need to extend this to give Infinispan more time to rebalance | 60 |
clusterDomain | The internal Kubernetes cluster domain | cluster.local |
command | Overrides the default entrypoint of the Keycloak container | [] |
args | Overrides the default args for the Keycloak container | [] |
extraEnv | Additional environment variables for Keycloak | "" |
extraEnvFrom | Additional environment variables for Keycloak mapped from a Secret or ConfigMap | "" |
priorityClassName | Pod priority class name | "" |
affinity | Pod affinity | Hard node and soft zone anti-affinity |
topologySpreadConstraints | Topology spread constraints | Constraints used to spread pods |
nodeSelector | Node labels for Pod assignment | {} |
tolerations | Node taints to tolerate | [] |
podLabels | Additional Pod labels | {} |
podAnnotations | Additional Pod annotations | {} |
livenessProbe | Liveness probe configuration |
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 v18.4.5 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