This Helm chart deploys Keycloak on a Kubernetes cluster.
- âś… Customizable Keycloak deployment
- âś… Integrated PostgreSQL database (optional)
- âś… Ingress support with TLS
- âś… Configurable health checks
- âś… Horizontal Pod Autoscaling (HPA)
- âś… Optional data persistence
- âś… Service Account and RBAC
- âś… Proxy configuration for reverse proxy
- âś… External secrets support
- âś… Optional metrics
- Kubernetes 1.19+
- Helm 3.0+
- PersistentVolume provisioner (if persistence is enabled)
The chart is publicly available at oci://quixpublic.azurecr.io/helm/keycloak
.
Install a specific version (recommended):
helm install keycloak oci://quixpublic.azurecr.io/helm/keycloak \
--version 1.1.1 \
--namespace keycloak --create-namespace
Install latest available version:
helm install keycloak oci://quixpublic.azurecr.io/helm/keycloak \
--namespace keycloak --create-namespace
Upgrade:
helm upgrade keycloak oci://quixpublic.azurecr.io/helm/keycloak \
--version 1.1.1 \
--namespace keycloak
Note: No login is required for this public registry.
helm install keycloak .
helm install keycloak . -f custom-values.yaml
kubectl create namespace keycloak
helm install keycloak . --namespace keycloak
# Development environment
make install-dev
# Production environment
make install-prod
# Default installation
make install
Parameter | Description | Default |
---|---|---|
replicaCount |
Number of replicas | 1 |
image.repository |
Image repository | quay.io/keycloak/keycloak |
image.tag |
Image tag | 26.4.0 |
image.pullPolicy |
Pull policy | IfNotPresent |
Parameter | Description | Default |
---|---|---|
keycloak.admin.username |
Admin username | admin |
keycloak.admin.password |
Admin password | admin |
keycloak.database.vendor |
Database type | postgres |
keycloak.database.host |
Database host | postgresql |
keycloak.database.database |
Database name | keycloak |
Parameter | Description | Default |
---|---|---|
ingress.enabled |
Enable Ingress | true |
ingress.className |
Ingress class (only rendered if non-empty) | "" |
ingress.hosts[0].host |
Hostname | keycloak.url |
ingress.tls |
TLS configuration | [] |
Parameter | Description | Default |
---|---|---|
postgresql.enabled |
Deploy PostgreSQL | true |
postgresql.auth.username |
PostgreSQL username | keycloak |
postgresql.auth.password |
PostgreSQL password | keycloak |
postgresql.auth.database |
Database name | keycloak |
# values-ingress.yaml
ingress:
enabled: true
className: nginx
hosts:
- host: keycloak.mydomain.com
paths:
- path: /
pathType: Prefix
tls:
- secretName: keycloak-tls
hosts:
- keycloak.mydomain.com
keycloak:
proxy:
enabled: true
mode: edge
helm install keycloak . -f values-ingress.yaml
# values-external-db.yaml
postgresql:
enabled: false
keycloak:
database:
host: my-postgres.example.com
port: 5432
database: keycloak
username: keycloak
password: supersecret
helm install keycloak . -f values-external-db.yaml
# values-ha.yaml
replicaCount: 3
autoscaling:
enabled: true
minReplicas: 3
maxReplicas: 10
targetCPUUtilizationPercentage: 70
resources:
requests:
cpu: 1000m
memory: 1Gi
limits:
cpu: 2000m
memory: 2Gi
keycloak:
cache:
stack: kubernetes
helm install keycloak . -f values-ha.yaml
# values-secrets.yaml
keycloak:
admin:
existingSecret: keycloak-admin-secret
existingSecretKey: password
database:
existingSecret: keycloak-db-secret
existingSecretUsernameKey: username
existingSecretPasswordKey: password
First, create the secrets:
kubectl create secret generic keycloak-admin-secret \
--from-literal=password=myAdminPassword
kubectl create secret generic keycloak-db-secret \
--from-literal=username=keycloak \
--from-literal=password=myDbPassword
Then install:
helm install keycloak . -f values-secrets.yaml
# values-metrics.yaml
keycloak:
metrics:
enabled: true
helm install keycloak . -f values-metrics.yaml
helm upgrade keycloak . -f custom-values.yaml
Or using the Makefile:
make upgrade-dev # Development
make upgrade-prod # Production
make upgrade # Default
helm uninstall keycloak
Or:
make uninstall
kubectl port-forward svc/keycloak 8080:8080
Or:
make port-forward
Then access: http://localhost:8080
- Username: admin
- Password: admin (change in production!)
kubectl logs -f deployment/keycloak
Or:
make logs
kubectl get pods -l app.kubernetes.io/name=keycloak
kubectl get secrets
kubectl get secret keycloak-admin -o jsonpath="{.data.password}" | base64 --decode
Or:
make get-admin-password
kubectl exec -it deployment/keycloak -- /bin/bash
make help # Show all available targets
make install # Install with default values
make install-dev # Install with development values
make install-prod # Install with production values
make upgrade # Upgrade existing installation
make uninstall # Remove the installation
make template # Generate manifests without installing
make lint # Lint the chart
make port-forward # Port-forward to Keycloak service
make logs # Show Keycloak logs
make status # Show release status
make get-admin-password # Get admin password from secret
Use values-development.yaml
for local development:
- Single replica
- Minimal resources
- Bundled PostgreSQL without persistence
- No Ingress
- Debug logging enabled
make install-dev
Use values-production.yaml
for production:
- 3 replicas with autoscaling
- High availability configuration
- External database
- Ingress with TLS
- Metrics enabled
- Pod anti-affinity rules
make install-prod
- Change default passwords before deploying to production
- Use external secrets instead of storing passwords in
values.yaml
- Enable TLS on Ingress
- Configure appropriate resource limits
- Review pod security policies
- Use strong admin credentials
- Enable HTTPS for production deployments
- Implement network policies if required
Enable metrics in your values file:
keycloak:
metrics:
enabled: true
Metrics will be available on port 9000 and can be scraped by Prometheus.
The chart includes PostgreSQL by default:
postgresql:
enabled: true
auth:
username: keycloak
password: keycloak
database: keycloak
For production, use an external database:
postgresql:
enabled: false
keycloak:
database:
host: your-postgres-host.com
port: 5432
database: keycloak
username: keycloak
existingSecret: keycloak-db-secret
- PostgreSQL
Configure the database vendor in keycloak.database.vendor
.
For HA deployments:
- Set
replicaCount
to 3 or more - Enable
autoscaling
- Configure
cache.stack
tokubernetes
- Use external database
- Configure pod anti-affinity rules
replicaCount: 3
autoscaling:
enabled: true
minReplicas: 3
maxReplicas: 10
keycloak:
cache:
stack: kubernetes
To add custom themes, use init containers:
keycloak:
themes:
enabled: true
initContainer:
image: your-themes-image
command:
- sh
- -c
- cp -R /themes/* /opt/keycloak/themes/
This chart includes comprehensive support for Microsoft Entra ID integration. See the detailed guides:
- Microsoft Entra ID Integration Guide - Complete step-by-step configuration
- Quick Start Guide - Fast-track setup (20 minutes)
- values-microsoft-entra.yaml - Pre-configured values file
Quick deployment with Microsoft Entra ID support:
# Create secrets first
kubectl create secret generic keycloak-admin-credentials --from-literal=password='YourPassword'
kubectl create secret generic keycloak-db-credentials --from-literal=username='keycloak' --from-literal=password='DBPassword'
# Deploy
helm install keycloak . -f values-microsoft-entra.yaml --namespace keycloak --create-namespace
After deployment, follow the integration guide to configure the identity provider.
Keycloak supports integration with many identity providers:
- GitHub
- SAML providers
- LDAP/Active Directory
- Custom OpenID Connect providers
Refer to Keycloak's Identity Brokering documentation for configuration details.
Contributions are welcome! Please feel free to submit a Pull Request.
This Helm chart is open source. Keycloak is licensed under the Apache 2.0 License.
- Keycloak Official Documentation
- Keycloak GitHub Repository
- Helm Documentation
- Microsoft Entra ID Integration
For issues and questions:
- Keycloak: https://github.com/keycloak/keycloak/issues
- This Chart: Create an issue in the repository