Last changed
Be the first to hear about exciting product updates, critical vulnerability alerts, compare alternative images, and more.
Sign UpA Kubernetes Operator based on the Operator SDK for installing and managing Keycloak.
Chainguard Containers are regularly-updated, secure-by-default container images.
For those with access, this container image is available on cgr.dev
:
Be sure to replace the ORGANIZATION
placeholder with the name used for your organization's private repository within the Chainguard Registry.
You can install the Operator on a vanilla Kubernetes cluster by using kubectl commands:
Install the CRDs by entering the following commands:
Next, install the Keycloak operator with Chainguard images using following steps:
curl -o keycloak-operator.yml https://raw.githubusercontent.com/keycloak/keycloak-k8s-resources/24.0.4/kubernetes/kubernetes.yml
sed -i '' 's|quay.io/keycloak/keycloak:.*|cgr.dev/chainguard/keycloak:latest|' keycloak-operator.yml
sed -i '' 's|quay.io/keycloak/keycloak-operator:.*|cgr.dev/chainguard/keycloak-operator:latest|' keycloak-operator.yml
kubectl apply -f keycloak-operator.yml
NOTE : The above sed commands were for MacOS (BSD based), for Linux GNU based, replace sed -i '' 's
with sed -i 's
Currently the Operator watches only the namespace where the Operator is installed.
Once the Keycloak Operator is installed and running in the cluster namespace, you can set up the other deployment prerequisites.
Database
Hostname
TLS Certificate and associated keys
For development purposes, you can use an ephemeral PostgreSQL pod installation. To provision it, follow the approach below:
Create YAML file example-postgres.yaml
:
Apply the changes:
For a production ready installation, you need a hostname that can be used to contact Keycloak. See Configuring the hostname for the available configurations.
For development purposes, this guide will use test.keycloak.org
.
See your Certification Authority to obtain the certificate and the key.
For development purposes, you can enter this command to obtain a self-signed certificate:
You should install it in the cluster namespace as a Secret by entering this command:
Consider storing the Database credentials in a separate Secret. Enter the following commands:
For a basic deployment, you can stick to the following approach:
Create YAML file example-kc.yaml
:
Apply the changes:
To check that the Keycloak instance has been provisioned in the cluster, check the status of the created CR by entering the following command:
When the deployment is ready, look for output similar to the following:
For further reference, please refer to official documentation of the project
Chainguard Containers are minimal container images that are secure by default.
In many cases, the Chainguard Containers tagged as :latest
contain only an open-source application and its runtime dependencies. These minimal container images typically do not contain a shell or package manager. Chainguard Containers are built with Wolfi, our Linux undistro designed to produce container images that meet the requirements of a more secure software supply chain.
The main features of Chainguard Containers include:
For cases where you need container images with shells and package managers to build or debug, most Chainguard Containers come paired with a -dev
variant.
Although the -dev
container image variants have similar security features as their more minimal versions, they feature additional software that is typically not necessary in production environments. We recommend using multi-stage builds to leverage the -dev
variants, copying application artifacts into a final minimal container that offers a reduced attack surface that won’t allow package installations or logins.
To better understand how to work with Chainguard Containers, please visit Chainguard Academy and Chainguard Courses.
In addition to Containers, Chainguard offers VMs and Libraries. Contact Chainguard to access additional products.
This software listing is packaged by Chainguard. The trademarks set forth in this offering are owned by their respective companies, and use of them does not imply any affiliation, sponsorship, or endorsement by such companies.
Chainguard container images contain software packages that are direct or transitive dependencies. The following licenses were found in the "latest" tag of this image:
Apache-2.0
BSD-3-Clause
Bitstream-Vera
FTL
GCC-exception-3.1
GPL-2.0-or-later
GPL-2.0-with-classpath-exception
For a complete list of licenses, please refer to this Image's SBOM.
Software license agreement