OpenTenant / Marketplace / sammyeby / keycloak
Helm chart v1.4.2 App 26.7.4 Verified publisher
A Helm chart for Keycloak using SamSoft hardened Docker image (runs as UID 1001)
About this chart
Keycloak Helm Chart
A Helm chart for deploying Keycloak using SamSoft hardened Docker images.
Overview
This chart deploys Keycloak, an open-source Identity and Access Management solution, on Kubernetes. It uses SamSoft's hardened container images that run as non-root with security best practices.
Features
Hardened Images : Uses SamSoft's security-hardened Keycloak images
Non-root Execution : Runs as UID 1001 for enhanced security
Optimized Image Support : Automatic detection of pre-built optimized and debug images
PostgreSQL Integration : Bundled PostgreSQL subchart for database
High Availability : Support for clustered deployments with Infinispan caching
Metrics & Monitoring : Prometheus ServiceMonitor and metrics endpoint
Security : Network policies, PodDisruptionBudget, and securityContext configuration
Ingress : Built-in ingress support with TLS
Prerequisites
Kubernetes 1.23+
Helm 3.8+
PV provisioner support in the underlying infrastructure (for persistence)
Installing the Chart From OCI Registry
helm install keycloak oci://ghcr.io/sammyeby/charts/keycloak \
--namespace keycloak \
--create-namespace \
--set auth.adminPassword=your-admin-password \
--set postgresql.auth.postgresPassword=your-postgres-password \
--set postgresql.auth.password=your-keycloak-db-password
From Source
helm dependency update keycloak
helm install keycloak ./keycloak \
--namespace keycloak \
--create-namespace
Configuration
The following tables document all available configuration options in values.yaml.
Global Parameters Parameter Type Default Description
global.imageRegistrystring ""Global Docker Image registry
global.imagePullSecretsarray []Global Docker registry secret names as an array
global.defaultStorageClassstring ""Global default StorageClass for Persistent Volume(s)
global.security.allowInsecureImagesboolean falseAllows skipping image verification
global.compatibility.openshift.adaptSecurityContextstring "auto"Adapt the securityContext sections. Values: auto, force, disabled
Common Parameters Parameter Type Default Description
kubeVersionstring ""Override Kubernetes version reported by .Capabilities
apiVersionsarray []Override Kubernetes API versions reported by .Capabilities
nameOverridestring ""String to partially override common.names.name
fullnameOverridestring ""String to fully override common.names.fullname
namespaceOverridestring ""String to fully override common.names.namespace
commonLabelsobject {}Labels to add to all deployed objects
commonAnnotationsobject {}Annotations to add to all deployed objects
clusterDomainstring "cluster.local"Default Kubernetes cluster domain
extraDeployarray []Array of extra objects to deploy with the release
diagnosticMode.enabledboolean falseEnable diagnostic mode (all probes disabled, command overridden)
diagnosticMode.commandarray ["sleep"]Command to override all containers in diagnostic mode
diagnosticMode.argsarray ["infinity"]Args to override all containers in diagnostic mode
useHelmHooksboolean trueEnable use of Helm hooks if needed (e.g., on post-install jobs)
usePasswordFilesboolean falseMount credentials as files in addition to env vars (for init scripts/sidecars)
Image Parameters Parameter Type Default Description
image.registrystring "ghcr.io"Keycloak image registry
image.repositorystring "sammyeby/keycloak"Keycloak image repository
image.tagstring "26.7.4"Keycloak image tag (immutable tags are recommended)
image.digeststring ""Keycloak image digest (sha256:...). Overrides tag if set
image.pullPolicystring "IfNotPresent"Keycloak image pull policy
image.pullSecretsarray []Keycloak image pull secrets
image.debugboolean falseEnable Keycloak image debug mode
Image Variants : ghcr.io/sammyeby/keycloak publishes three variants per version:
Variant Tag Base Image UID Startup Runtime providers/SPIs
Flexible (default) 26.7.4Alpine 1001 Auto-builds when providers change Yes
Optimized 26.7.4-optimizedDistroless 65532 Pre-built (~5s) No — build-time only
Debug 26.7.4-debugDistroless + busybox 65532 Pre-built (~5s) No — build-time only
The chart detects the pre-built variants from the tag — 26.7.4-optimized, 26.7.4-debug, and the floating optimized/debug tags (immutable versioned tags are still recommended). For those tags it:
passes start --optimized instead of start
keeps containerSecurityContext.readOnlyRootFilesystem at its configured value (default true)
skips the prepare-write-dirs init container and the writable lib overlay (distroless has no /bin/sh)
omits build-time env vars (KC_HTTP_RELATIVE_PATH, KC_CACHE*), which are already baked into the image
Flexible tags get the inverse: readOnlyRootFilesystem is forced to false so the Quarkus auto-build can write.
containerSecurityContext.runAsUser defaults to 1001 and works with all three variants — /opt/keycloak is world-readable and the pre-built variants never write to it. Set it (and runAsGroup/podSecurityContext.fsGroup) to 65532 if you want the pod to match the distroless image's own user.
Authentication Parameters Parameter Type Default Description
auth.adminUserstring "user"Keycloak administrator username
auth.adminPasswordstring ""Keycloak administrator password (auto-generated if empty)
auth.existingSecretstring ""Existing secret containing Keycloak admin password
auth.passwordSecretKeystring ""Key in existing secret for admin password
auth.annotationsobject {}Additional custom annotations for Keycloak auth secret object
Keycloak Configuration Parameters Parameter Type Default Description
productionboolean falseRun Keycloak in production mode (TLS required unless using proxy)
httpRelativePathstring "/"Path relative to '/' for serving resources
proxyHeadersstring ""Proxy headers configuration
configurationstring ""Keycloak configuration (auto-generated if empty)
existingConfigmapstring ""Name of existing ConfigMap with Keycloak configuration
trustedCertsExistingSecretstring ""Name of existing Secret with trusted certificates
adminRealmstring "master"Name of the admin realm
hostnamestring ""Keycloak server hostname. Falls back to ingress.hostname if empty
hostnameStrictboolean trueReject dynamically resolved hostnames (Keycloak default)
httpEnabledboolean falseForce enabling HTTP endpoint
extraStartupArgsstring ""Extra default startup args
initdbScriptsobject {}Dictionary of initdb scripts to run at first boot
initdbScriptsConfigMapstring ""ConfigMap with initdb scripts (overrides initdbScripts)
commandarray []Override default container command
argsarray []Override default container args
extraEnvVarsarray []Extra environment variables
extraEnvVarsCMstring ""Name of existing ConfigMap containing extra env vars
extraEnvVarsSecretstring ""Name of existing Secret containing extra env vars
TLS/SSL Parameters Parameter Type Default Description
tls.enabledboolean falseEnable TLS in Keycloak
tls.usePemCertsboolean falseUse PEM certificates instead of PKS12/JKS stores
tls.autoGenerated.enabledboolean trueEnable automatic TLS certificate generation
tls.autoGenerated.enginestring "helm"Certificate generation mechanism (helm or cert-manager)
tls.autoGenerated.certManager.existingIssuerstring ""Name of existing Issuer (cert-manager only)
tls.autoGenerated.certManager.existingIssuerKindstring ""Existing Issuer kind (cert-manager only)
tls.autoGenerated.certManager.keySizenumber 2048Key size for certificates (cert-manager only)
tls.autoGenerated.certManager.keyAlgorithmstring "RSA"Key algorithm for certificates (cert-manager only)
tls.autoGenerated.certManager.durationstring "2160h"Duration for certificates (cert-manager only)
tls.autoGenerated.certManager.renewBeforestring "360h"Renewal period for certificates (cert-manager only)
tls.existingSecretstring ""Name of existing Secret with TLS certificates
tls.certFilenamestring "tls.crt"Certificate filename in existing secret (PEM mode)
tls.certKeyFilenamestring "tls.key"Certificate key filename in existing secret (PEM mode)
tls.keystoreFilenamestring "keycloak.keystore.jks"Keystore filename in existing secret
tls.truststoreFilenamestring "keycloak.truststore.jks"Truststore filename in existing secret
tls.keystorePasswordstring ""Password for keystore
tls.truststorePasswordstring ""Password for truststore
tls.passwordsSecretstring ""Name of existing Secret with keystore/truststore passwords
Cache Parameters Parameter Type Default Description
cache.enabledboolean trueEnable Keycloak distributed cache for Kubernetes
cache.stackstring "jdbc-ping"Cache stack to use
cache.configFilestring "cache-ispn.xml"Path to file for cache configuration
cache.useHeadlessServiceWithAppVersionboolean falseCreate headless service with app version for ispn
cache.javaOptsAppendExtrastring ""Extra java options to append
Logging Parameters Parameter Type Default Description
logging.outputstring "default"Log output format (default or json)
logging.levelstring "INFO"Log level (FATAL, ERROR, WARN, INFO, DEBUG, TRACE, ALL, OFF)
Container Configuration Parameters Parameter Type Default Description
containerPorts.httpnumber 8080Keycloak HTTP container port
containerPorts.httpsnumber 8443Keycloak HTTPS container port
containerPorts.managementnumber 9000Keycloak management container port
extraContainerPortsarray []Extra list of additional ports for container
extraVolumesarray []Extra list of additional volumes for pods
extraVolumeMountsarray []Extra list of additional volumeMounts for container
initContainersarray []Add additional init containers to pods
sidecarsarray []Add additional sidecar containers to pods
Security Context Parameters Parameter Type Default Description
podSecurityContext.enabledboolean trueEnable pods' Security Context
podSecurityContext.fsGroupnumber 1001Pod Security Context fsGroup
podSecurityContext.fsGroupChangePolicystring "Always"Filesystem group change policy
podSecurityContext.sysctlsarray []Set kernel settings using sysctl interface
podSecurityContext.supplementalGroupsarray []Set filesystem extra groups
containerSecurityContext.enabledboolean trueEnable containers' Security Context
containerSecurityContext.runAsUsernumber 1001Containers' Security Context runAsUser. Works with all variants; use 65532 to match the distroless image user on -optimized/-debug tags
containerSecurityContext.runAsGroupnumber 1001Containers' Security Context runAsGroup
containerSecurityContext.runAsNonRootboolean trueRun containers as non-root
containerSecurityContext.privilegedboolean falseSet container privileged
containerSecurityContext.readOnlyRootFilesystemboolean trueRead-only root filesystem. Automatically overridden to false for flexible images (kept for -optimized/-debug tags)
containerSecurityContext.allowPrivilegeEscalationboolean falseAllow privilege escalation
containerSecurityContext.capabilities.droparray ["ALL"]List of capabilities to drop
containerSecurityContext.seccompProfile.typestring "RuntimeDefault"Set seccomp profile type
containerSecurityContext.seLinuxOptionsobject {}Set SELinux options in container
Resource Management Parameters Parameter Type Default Description
resourcesPresetstring "small"Resource preset (none, nano, micro, small, medium, large, xlarge, 2xlarge)
resourcesobject {}Container resource requests and limits (overrides resourcesPreset)
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 server Connect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.Place the chart keycloak is pinned at v1.4.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.Apply Save 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 Copy