diff --git a/charts/keycloak/CHANGELOG.md b/charts/keycloak/CHANGELOG.md index a1d8464..fac5a48 100644 --- a/charts/keycloak/CHANGELOG.md +++ b/charts/keycloak/CHANGELOG.md @@ -1,8 +1,37 @@ # Changelog -## 24.9.1 (2025-08-07) +## 25.2.0 (2025-08-21) -* [bitnami/keycloak] :zap: :arrow_up: Update dependency references ([#35578](https://github.com/bitnami/charts/pull/35578)) +* [bitnami/keycloak] Add externalDatabase.extraParams for custom JDBC connection parameters ([#35770](https://github.com/bitnami/charts/pull/35770)) + +## 25.1.2 (2025-08-20) + +* [bitnami/keycloak] :zap: :arrow_up: Update dependency references (#36151) ([be87b21](https://github.com/bitnami/charts/commit/be87b21456910bc3a0c8731be470b48fb5ed32d3)), closes [#36151](https://github.com/bitnami/charts/issues/36151) + +## 25.1.1 (2025-08-19) + +* [bitnami/keycloak] docs: remove reference to deprecated parameter on README (#36095) ([88de5cf](https://github.com/bitnami/charts/commit/88de5cfe0cda1f49d53b1ba8cda84b0baada6676)), closes [#36095](https://github.com/bitnami/charts/issues/36095) +* [bitnami/keycloak] Fix trailing dash in Config CLI Job (#35784) ([aff4631](https://github.com/bitnami/charts/commit/aff46317d0a8a86a4e5eb1d91bc384ff4ea2c42b)), closes [#35784](https://github.com/bitnami/charts/issues/35784) + +## 25.1.0 (2025-08-15) + +* [bitnami/keycloak] feat: add parameter to enable HTTP endpoint (#35881) ([90b385c](https://github.com/bitnami/charts/commit/90b385cfee09574633fe229881a000a088ef986c)), closes [#35881](https://github.com/bitnami/charts/issues/35881) + +## 25.0.2 (2025-08-12) + +* [bitnami/keycloak] bugfix: validation when production is enabled (#35757) ([14e2c8a](https://github.com/bitnami/charts/commit/14e2c8a3030bd82ac7ba9d843cfa4f09a5645dc2)), closes [#35757](https://github.com/bitnami/charts/issues/35757) + +## 25.0.1 (2025-08-11) + +* [bitnami/keycloak] bugfix: wrong number of arguments passed to tpl (#35726) ([25b6602](https://github.com/bitnami/charts/commit/25b6602175afaed1c1becce833463d4005e24598)), closes [#35726](https://github.com/bitnami/charts/issues/35726) + +## 25.0.0 (2025-08-08) + +* [bitnami/keycloak] feat: native metrics & refactor (#35568) ([0941bbc](https://github.com/bitnami/charts/commit/0941bbcbeca0b8b8d487e710701628e1f22e9f61)), closes [#35568](https://github.com/bitnami/charts/issues/35568) + +## 24.9.1 (2025-08-07) + +* [bitnami/keycloak] :zap: :arrow_up: Update dependency references (#35578) ([6f18b10](https://github.com/bitnami/charts/commit/6f18b10318ec5c39d3a0dab34ae93efa90d70884)), closes [#35578](https://github.com/bitnami/charts/issues/35578) ## 24.9.0 (2025-08-04) diff --git a/charts/keycloak/Chart.lock b/charts/keycloak/Chart.lock index 4ecf9d1..bb6dc5d 100644 --- a/charts/keycloak/Chart.lock +++ b/charts/keycloak/Chart.lock @@ -1,9 +1,9 @@ dependencies: - name: postgresql repository: oci://registry-1.docker.io/bitnamicharts - version: 16.7.24 + version: 16.7.26 - name: common repository: oci://registry-1.docker.io/bitnamicharts - version: 2.31.3 -digest: sha256:d8069a70d0f19ff31989b0755d92997aae49301596058d679b002f678315ab9e -generated: "2025-08-10T11:18:09.390206634+02:00" + version: 2.31.4 +digest: sha256:d92824e04bd8b3d71ee395ef556c8476badbf15ee7fca655e503933dc90df3eb +generated: "2025-08-20T12:56:42.787734637Z" diff --git a/charts/keycloak/Chart.yaml b/charts/keycloak/Chart.yaml index b39cd13..ccab872 100644 --- a/charts/keycloak/Chart.yaml +++ b/charts/keycloak/Chart.yaml @@ -5,36 +5,35 @@ annotations: category: DeveloperTools images: | - name: keycloak - image: docker.io/bitnami/keycloak:26.3.2-debian-12-r1 + image: docker.io/bitnami/keycloak:26.3.3-debian-12-r0 - name: keycloak-config-cli image: docker.io/bitnami/keycloak-config-cli:6.4.0-debian-12-r11 licenses: Apache-2.0 tanzuCategory: application apiVersion: v2 -appVersion: 26.3.2 +appVersion: 26.3.3 dependencies: - - condition: postgresql.enabled - name: postgresql - repository: oci://registry-1.docker.io/bitnamicharts - version: 16.x.x - - name: common - repository: oci://registry-1.docker.io/bitnamicharts - tags: - - bitnami-common - version: 2.x.x -description: - Keycloak is a high performance Java-based identity and access management +- condition: postgresql.enabled + name: postgresql + repository: oci://registry-1.docker.io/bitnamicharts + version: 16.x.x +- name: common + repository: oci://registry-1.docker.io/bitnamicharts + tags: + - bitnami-common + version: 2.x.x +description: Keycloak is a high performance Java-based identity and access management solution. It lets developers add an authentication layer to their applications with minimum effort. home: https://bitnami.com icon: https://dyltqmyl993wv.cloudfront.net/assets/stacks/keycloak/img/keycloak-stack-220x234.png keywords: - - keycloak - - access-management +- keycloak +- access-management maintainers: - - name: Broadcom, Inc. All Rights Reserved. - url: https://github.com/bitnami/charts +- name: Broadcom, Inc. All Rights Reserved. + url: https://github.com/bitnami/charts name: keycloak sources: - - https://github.com/bitnami/charts/tree/main/bitnami/keycloak -version: 24.9.1 +- https://github.com/bitnami/charts/tree/main/bitnami/keycloak +version: 25.2.0 \ No newline at end of file diff --git a/charts/keycloak/README.md b/charts/keycloak/README.md index fea98b8..4ec4e6e 100644 --- a/charts/keycloak/README.md +++ b/charts/keycloak/README.md @@ -31,7 +31,7 @@ These changes aim to improve the security posture of all Bitnami users by promot Bitnami charts for Helm are carefully engineered, actively maintained and are the quickest and easiest way to deploy containers on a Kubernetes cluster that are ready to handle production workloads. -This chart bootstraps a [Keycloak](https://github.com/bitnami/containers/tree/main/bitnami/keycloak) deployment on a [Kubernetes](https://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. +This chart bootstraps a [Keycloak](https://www.keycloak.org/) deployment on a [Kubernetes](https://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. ## Prerequisites @@ -54,12 +54,6 @@ These commands deploy a Keycloak application on the Kubernetes cluster in the de ## Configuration and installation details -### Resource requests and limits - -Bitnami charts allow setting resource requests and limits for all containers inside the chart deployment. These are inside the `resources` value (check parameter table). Setting requests is essential for production workloads and these should be adapted to your specific use case. - -To make this process easier, the chart contains the `resourcesPreset` values, which automatically sets the `resources` section according to different presets. Check these presets in [the bitnami/common chart](https://github.com/bitnami/charts/blob/main/bitnami/common/templates/_resources.tpl#L15). However, in production workloads using `resourcesPreset` is discouraged as it may not fully adapt to your specific needs. Find more information on container resource management in the [official Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/). - ### Prometheus metrics This chart can be integrated with Prometheus by setting `metrics.enabled` to `true`. This will expose Keycloak native Prometheus endpoint in a `metrics` service, which can be configured under the `metrics.service` section. It will have the necessary annotations to be automatically scraped by Prometheus. @@ -84,17 +78,6 @@ It is strongly recommended to use immutable tags in a production environment. Th Bitnami will release a new chart updating its containers if a new version of the main container, significant changes, or critical vulnerabilities exist. -### Update credentials - -Bitnami charts configure credentials at first boot. Any further change in the secrets or credentials require manual intervention. Follow these instructions: - -- Update the user password following [the upstream documentation](https://www.keycloak.org/server/configuration) -- Update the password secret with the new values (replace the SECRET_NAME and PASSWORD placeholders) - -```shell -kubectl create secret generic SECRET_NAME --from-literal=admin-password=PASSWORD --dry-run -o yaml | kubectl apply -f - -``` - ### Use an external database Sometimes, you may want to have Keycloak connect to an external PostgreSQL database rather than a database within your cluster - for example, when using a managed database service, or when running a single database server for all your applications. To do this, set the `postgresql.enabled` parameter to `false` and specify the credentials for the external database using the `externalDatabase.*` parameters. Here is an example: @@ -133,9 +116,7 @@ extraEnvVars: You can import a realm by setting the `KEYCLOAK_EXTRA_ARGS` to contain the `--import-realm` argument. -This will import all `*.json` under `/opt/bitnami/keycloak/data/import` files as a realm into keycloak as per the -official documentation [here](https://www.keycloak.org/server/importExport#_importing_a_realm_from_a_directory). You -can supply the files by mounting a volume e.g. with docker compose as follows: +This will import all `*.json` under `/opt/bitnami/keycloak/data/import` files as a realm into keycloak as per the official documentation [here](https://www.keycloak.org/server/importExport#_importing_a_realm_from_a_directory). You can supply the files by mounting a volume e.g. with docker compose as follows: ```yaml keycloak: @@ -146,8 +127,7 @@ keycloak: #### Exporting a realm -You can export a realm through the GUI but it will not export users even the option is set, this is a known keycloak -[bug](https://github.com/keycloak/keycloak/issues/23970). +You can export a realm through the GUI but it will not export users even the option is set, this is a known keycloak [bug](https://github.com/keycloak/keycloak/issues/23970). By using the `kc.sh` script you can export a realm with users. Be sure to mount the export folder to a local folder: @@ -162,13 +142,13 @@ Then open a terminal in the running keycloak container and run: ```bash kc.sh export --dir /export/ --users realm_file -```` +``` This will export the all the realms with users to the `/export` folder. ### Configure Ingress -This chart provides support for Ingress resources. If you have an ingress controller installed on your cluster, such as [nginx-ingress-controller](https://github.com/bitnami/charts/tree/main/bitnami/nginx-ingress-controller) or [contour](https://github.com/bitnami/charts/tree/main/bitnami/contour) you can utilize the ingress controller to serve your application.To enable Ingress integration, set `ingress.enabled` to `true`. +This chart provides support for Ingress resources. If you have an ingress controller installed on your cluster, such as [nginx-ingress-controller](https://github.com/bitnami/charts/tree/main/bitnami/nginx-ingress-controller) or [contour](https://github.com/bitnami/charts/tree/main/bitnami/contour) you can utilize the ingress controller to serve your application. To enable Ingress integration, set `ingress.enabled` to `true`. The most common scenario is to have one host name mapped to the deployment. In this case, the `ingress.hostname` property can be used to set the host name. The `ingress.tls` parameter can be used to add the TLS configuration for this host. @@ -176,33 +156,11 @@ However, it is also possible to have more than one host. To facilitate this, the > NOTE: For each host specified in the `ingress.extraHosts` parameter, it is necessary to set a name, path, and any annotations that the Ingress controller should know about. Not all annotations are supported by all Ingress controllers, but [this annotation reference document](https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/annotations.md) lists the annotations supported by many popular Ingress controllers. -Adding the TLS parameter (where available) will cause the chart to generate HTTPS URLs, and the application will be available on port 443. The actual TLS secrets do not have to be generated by this chart. However, if TLS is enabled, the Ingress record will not work until the TLS secret exists. +Adding the TLS parameter (where available) will cause the chart to generate HTTPS URLs, and the application will be available on port 443. The actual TLS secrets do not have to be generated by this chart. However, if TLS is enabled, the Ingress record will not work until the TLS secret exists. [Learn more about Ingress controllers](https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/). -### Configure admin Ingress - -In addition to the Ingress resource described above, this chart also provides the ability to define an Ingress for the admin area of Keycloak, for example the `master` realm. - -For this scenario, you can use the Keycloak Config CLI integration with the following values, where `keycloak-admin.example.com` is to be replaced by the actual hostname: - -```yaml -adminIngress: - enabled: true - hostname: keycloak-admin.example.com -keycloakConfigCli: - enabled: true - configuration: - master.json: | - { - "realm" : "master", - "attributes": { - "frontendUrl": "https://keycloak-admin.example.com" - } - } -``` - -### Configure TLS Secrets for use with Ingress +#### Configure TLS Secrets for use with Ingress This chart facilitates the creation of TLS secrets for use with the Ingress controller (although this is not mandatory). There are several common use cases: @@ -242,34 +200,82 @@ wrj2wDbCDCFmfqnSJ+dKI3vFLlEz44sAV8jX/kd4Y6ZTQhlLbYc= ### Securing traffic using TLS -Keycloak can work with TLS interally by setting `tls.enabled=true`. The chart allows two configuration options: +TLS support for the web interface can be enabled in the chart by specifying the `tls.enabled=true`. Two possible options are available: -- Provide your own secret using the `tls.existingSecret` value. Also set the correct name of the truststore and keystore using the `tls.truststoreFilename` and `tls.keystoreFilename` values. -- Have the chart auto-generate the certificates using `tls.autoGenerated=true`. +- Provide your own secret with the PEM or JKS certificates +- Have the chart auto-generate the certificates. -### Use with ingress offloading SSL +#### Providing your own TLS secret -If your ingress controller has the SSL Termination, you should set `proxy` to `edge`. +To provide your own secret set the `tls.existingSecret` value. It is possible to use PEM or JKS. -### Manage secrets and passwords +To use PEM Certs: -This chart provides several ways to manage passwords: +- `tls.usePemCerts=true`: Use PEM certificates instead of a JKS file. +- `tls.certFilename`: Certificate filename. Defaults to `tls.crt`. +- `tls.certKeyFilename`: Certificate key filename. Defaults to `tls.key` -- Values passed to the chart: In this scenario, a new secret including all the passwords will be created during the chart installation. When upgrading, it is necessary to provide the secrets to the chart as shown below. Replace the KC_BOOTSTRAP_ADMIN_PASSWORD, POSTGRESQL_PASSWORD and POSTGRESQL_PVC placeholders with the correct passwords and PVC name. +To use JKS keystore: + +- `tls.usePemCerts=false`: Use JKS file. +- `tls.keystoreFilename`: Certificate filename. Defaults to `keycloak.keystore.jks`. +- `tls.truststoreFilename`: Truststore filename. Defaults to `keycloak.truststore.jks`. + +In the following example we will use PEM certificates. First, create the secret with the certificates files: ```console -helm upgrade keycloak bitnami/keycloak \ - --set auth.adminPassword=KC_BOOTSTRAP_ADMIN_PASSWORD \ - --set postgresql.postgresqlPassword=POSTGRESQL_PASSWORD \ - --set postgresql.persistence.existingClaim=POSTGRESQL_PVC +kubectl create secret generic certificates-tls-secret --from-file=./cert.pem --from-file=./cert.key ``` -- An existing secret with all the passwords via the `existingSecret` parameter. +Then, use the following parameters: + +```console +tls.enabled=true +tls.autoGenerated.enabled=false +tls.usePemCerts=true +tls.existingSecret="certificates-tls-secret" +tls.certFilename="cert.pem" +tls.certKeyFilename="cert.key" +``` + +#### Auto-generation of TLS certificates + +It is also possible to rely on the chart certificate auto-generation capabilities. The chart supports two different ways to auto-generate the required certificates: + +- Using Helm capabilities. Enable this feature by setting `tls.autoGenerated.enabled` to `true` and `tls.autoGenerated.engine` to `helm`. +- Relying on CertManager (please note it's required to have CertManager installed in your K8s cluster). Enable this feature by setting `tls.autoGenerated.enabled` to `true` and `tls.autoGenerated.engine` to `cert-manager`. Please note it's supported to use an existing Issuer/ClusterIssuer for issuing the TLS certificates by setting the `tls.autoGenerated.certManager.existingIssuer` and `tls.autoGenerated.certManager.existingIssuerKind` parameters. + +#### Use with ingress offloading SSL + +If your ingress controller has the TLS/SSL Termination, you might need to properly configure the reverse proxy headers via the `proxyHeaders` parameter. Find more information in the [upstream documentation](https://www.keycloak.org/server/reverseproxy). + +### Update credentials + +Bitnami charts configure credentials at first boot. Any further change in the secrets or credentials require manual intervention. Follow these instructions: + +- Update the user password following [the upstream documentation](https://www.keycloak.org/server/configuration) +- Update the password secret with the new values (replace the SECRET_NAME and PASSWORD placeholders) + +```shell +kubectl create secret generic SECRET_NAME --from-literal=admin-password=PASSWORD --dry-run -o yaml | kubectl apply -f - +``` ### Backup and restore To back up and restore Helm chart deployments on Kubernetes, you need to back up the persistent volumes from the source deployment and attach them to a new deployment using [Velero](https://velero.io/), a Kubernetes backup/restore tool. Find the instructions for using Velero in [this guide](https://techdocs.broadcom.com/us/en/vmware-tanzu/application-catalog/tanzu-application-catalog/services/tac-doc/apps-tutorials-backup-restore-deployments-velero-index.html). +### Resource requests and limits + +Bitnami charts allow setting resource requests and limits for all containers inside the chart deployment. These are inside the `resources` value (check parameter table). Setting requests is essential for production workloads and these should be adapted to your specific use case. + +To make this process easier, the chart contains the `resourcesPreset` values, which automatically sets the `resources` section according to different presets. Check these presets in [the bitnami/common chart](https://github.com/bitnami/charts/blob/main/bitnami/common/templates/_resources.tpl#L15). However, in production workloads using `resourcesPreset` is discouraged as it may not fully adapt to your specific needs. Find more information on container resource management in the [official Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/). + +### Set Pod affinity + +This chart allows you to set your custom affinity using the `affinity` parameter. Find more information about Pod's affinity in the [kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity). + +As an alternative, you can use of the preset configurations for pod affinity, pod anti-affinity, and node affinity available at the [bitnami/common](https://github.com/bitnami/charts/tree/main/bitnami/common#affinities) chart. To do so, set the `podAffinityPreset`, `podAntiAffinityPreset`, or `nodeAffinityPreset` parameters. + ### Add extra environment variables In case you want to add extra environment variables (useful for advanced operations like custom init scripts), you can use the `extraEnvVars` property. @@ -306,8 +312,6 @@ service: targetPort: 11311 ``` -> NOTE: This Helm chart already includes sidecar containers for the Prometheus exporters (where applicable). These can be activated by adding the `--enable-metrics=true` parameter at deployment time. The `sidecars` parameter should therefore only be used for any extra sidecar containers. - If additional init containers are needed in the same pod, they can be defined using the `initContainers` parameter. Here is an example: ```yaml @@ -334,291 +338,274 @@ The allowed extensions is `.sh`. There are cases where you may want to deploy extra objects, such a ConfigMap containing your app's configuration or some extra deployment with a micro service used by your app. For covering this case, the chart allows adding the full specification of other objects using the `extraDeploy` parameter. -### Set Pod affinity - -This chart allows you to set your custom affinity using the `affinity` parameter. Find more information about Pod's affinity in the [kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity). - -As an alternative, you can use of the preset configurations for pod affinity, pod anti-affinity, and node affinity available at the [bitnami/common](https://github.com/bitnami/charts/tree/main/bitnami/common#affinities) chart. To do so, set the `podAffinityPreset`, `podAntiAffinityPreset`, or `nodeAffinityPreset` parameters. - ## Parameters ### Global parameters | Name | Description | Value | | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | -| `global.imageRegistry` | Global Docker image registry | `""` | +| `global.imageRegistry` | Global Docker Image registry | `""` | | `global.imagePullSecrets` | Global Docker registry secret names as an array | `[]` | | `global.defaultStorageClass` | Global default StorageClass for Persistent Volume(s) | `""` | -| `global.storageClass` | DEPRECATED: use global.defaultStorageClass instead | `""` | | `global.security.allowInsecureImages` | Allows skipping image verification | `false` | | `global.compatibility.openshift.adaptSecurityContext` | Adapt the securityContext sections of the deployment to make them compatible with Openshift restricted-v2 SCC: remove runAsUser, runAsGroup and fsGroup and let the platform use their allowed default IDs. Possible values: auto (apply if the detected running cluster is Openshift), force (perform the adaptation always), disabled (do not perform adaptation) | `auto` | +| `global.compatibility.omitEmptySeLinuxOptions` | If set to true, removes the seLinuxOptions from the securityContexts when it is set to an empty object | `false` | ### Common parameters | Name | Description | Value | | ------------------------ | --------------------------------------------------------------------------------------- | --------------- | -| `kubeVersion` | Force target Kubernetes version (using Helm capabilities if not set) | `""` | -| `nameOverride` | String to partially override common.names.fullname | `""` | +| `kubeVersion` | Override Kubernetes version reported by .Capabilities | `""` | +| `apiVersions` | Override Kubernetes API versions reported by .Capabilities | `[]` | +| `nameOverride` | String to partially override common.names.name | `""` | | `fullnameOverride` | String to fully override common.names.fullname | `""` | | `namespaceOverride` | String to fully override common.names.namespace | `""` | | `commonLabels` | Labels to add to all deployed objects | `{}` | -| `enableServiceLinks` | If set to false, disable Kubernetes service links in the pod spec | `true` | | `commonAnnotations` | Annotations to add to all deployed objects | `{}` | -| `dnsPolicy` | DNS Policy for pod | `""` | -| `dnsConfig` | DNS Configuration pod | `{}` | | `clusterDomain` | Default Kubernetes cluster domain | `cluster.local` | | `extraDeploy` | Array of extra objects to deploy with the release | `[]` | -| `usePasswordFiles` | Mount credentials as files instead of using environment variables | `true` | | `diagnosticMode.enabled` | Enable diagnostic mode (all probes will be disabled and the command will be overridden) | `false` | -| `diagnosticMode.command` | Command to override all containers in the the statefulset | `["sleep"]` | -| `diagnosticMode.args` | Args to override all containers in the the statefulset | `["infinity"]` | +| `diagnosticMode.command` | Command to override all containers in the chart release | `["sleep"]` | +| `diagnosticMode.args` | Args to override all containers in the chart release | `["infinity"]` | +| `useHelmHooks` | Enable use of Helm hooks if needed, e.g. on post-install jobs | `true` | +| `usePasswordFiles` | Mount credentials as files instead of using environment variables | `true` | ### Keycloak parameters -| Name | Description | Value | -| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------- | -| `image.registry` | Keycloak image registry | `REGISTRY_NAME` | -| `image.repository` | Keycloak image repository | `REPOSITORY_NAME/keycloak` | -| `image.digest` | Keycloak image digest in the way sha256:aa.... Please note this parameter, if set, will override the tag | `""` | -| `image.pullPolicy` | Keycloak image pull policy | `IfNotPresent` | -| `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` | -| `image.debug` | Specify if debug logs should be enabled | `false` | -| `auth.adminUser` | Keycloak administrator user | `user` | -| `auth.adminPassword` | Keycloak administrator password for the new user | `""` | -| `auth.existingSecret` | Existing secret containing Keycloak admin password | `""` | -| `auth.passwordSecretKey` | Key where the Keycloak admin password is being stored inside the existing secret. | `""` | -| `auth.annotations` | Additional custom annotations for Keycloak auth secret object | `{}` | -| `customCaExistingSecret` | Name of the secret containing the Keycloak custom CA certificates. The secret will be mounted as a directory and configured using KC_TRUSTSTORE_PATHS. | `""` | -| `tls.enabled` | Enable TLS encryption. Required for HTTPs traffic. | `false` | -| `tls.autoGenerated` | Generate automatically self-signed TLS certificates. Currently only supports PEM certificates | `false` | -| `tls.existingSecret` | Existing secret containing the TLS certificates per Keycloak replica | `""` | -| `tls.usePem` | Use PEM certificates as input instead of PKS12/JKS stores | `false` | -| `tls.truststoreFilename` | Truststore filename inside the existing secret | `keycloak.truststore.jks` | -| `tls.keystoreFilename` | Keystore filename inside the existing secret | `keycloak.keystore.jks` | -| `tls.keystorePassword` | Password to access the keystore when it's password-protected | `""` | -| `tls.truststorePassword` | Password to access the truststore when it's password-protected | `""` | -| `tls.passwordsSecret` | Secret containing the Keystore and Truststore passwords. | `""` | -| `spi.existingSecret` | Existing secret containing the Keycloak truststore for SPI connection over HTTPS/TLS | `""` | -| `spi.truststorePassword` | Password to access the truststore when it's password-protected | `""` | -| `spi.truststoreFilename` | Truststore filename inside the existing secret | `keycloak-spi.truststore.jks` | -| `spi.passwordsSecret` | Secret containing the SPI Truststore passwords. | `""` | -| `spi.hostnameVerificationPolicy` | Verify the hostname of the server's certificate. Allowed values: "ANY", "WILDCARD", "STRICT". | `""` | -| `adminRealm` | Name of the admin realm | `master` | -| `production` | Run Keycloak in production mode. TLS configuration is required except when using proxy=edge. | `false` | -| `proxyHeaders` | Set Keycloak proxy headers | `""` | -| `proxy` | reverse Proxy mode edge, reencrypt, passthrough or none | `""` | -| `httpRelativePath` | Set the path relative to '/' for serving resources. Useful if you are migrating from older version which were using '/auth/' | `/` | -| `configuration` | Keycloak Configuration. Auto-generated based on other parameters when not specified | `""` | -| `existingConfigmap` | Name of existing ConfigMap with Keycloak configuration | `""` | -| `extraStartupArgs` | Extra default startup args | `""` | -| `enableDefaultInitContainers` | Deploy default init containers | `true` | -| `initdbScripts` | Dictionary of initdb scripts | `{}` | -| `initdbScriptsConfigMap` | ConfigMap with the initdb scripts (Note: Overrides `initdbScripts`) | `""` | -| `command` | Override default container command (useful when using custom images) | `[]` | -| `args` | Override default container args (useful when using custom images) | `[]` | -| `extraEnvVars` | Extra environment variables to be set on Keycloak container | `[]` | -| `extraEnvVarsCM` | Name of existing ConfigMap containing extra env vars | `""` | -| `extraEnvVarsSecret` | Name of existing Secret containing extra env vars | `""` | +| Name | Description | Value | +| --------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------- | +| `image.registry` | Keycloak image registry | `REGISTRY_NAME` | +| `image.repository` | Keycloak image repository | `REPOSITORY_NAME/keycloak` | +| `image.digest` | Keycloak image digest in the way sha256:aa.... Please note this parameter, if set, will override the tag | `""` | +| `image.pullPolicy` | Keycloak image pull policy | `IfNotPresent` | +| `image.pullSecrets` | Keycloak image pull secrets | `[]` | +| `image.debug` | Enable Keycloak image debug mode | `false` | +| `auth.adminUser` | Keycloak administrator user | `user` | +| `auth.adminPassword` | Keycloak administrator password for the new user | `""` | +| `auth.existingSecret` | Existing secret containing Keycloak admin password | `""` | +| `auth.passwordSecretKey` | Key where the Keycloak admin password is being stored inside the existing secret. | `""` | +| `auth.annotations` | Additional custom annotations for Keycloak auth secret object | `{}` | +| `production` | Run Keycloak in production mode. TLS configuration is required except when using proxy headers | `false` | +| `tls.enabled` | Enable TLS in Keycloak | `false` | +| `tls.usePemCerts` | Use PEM certificates as input instead of PKS12/JKS stores | `false` | +| `tls.autoGenerated.enabled` | Enable automatic generation of TLS certificates | `true` | +| `tls.autoGenerated.engine` | Mechanism to generate the certificates (allowed values: helm, cert-manager) | `helm` | +| `tls.autoGenerated.certManager.existingIssuer` | The name of an existing Issuer to use for generating the certificates (only for `cert-manager` engine) | `""` | +| `tls.autoGenerated.certManager.existingIssuerKind` | Existing Issuer kind, defaults to Issuer (only for `cert-manager` engine) | `""` | +| `tls.autoGenerated.certManager.keyAlgorithm` | Key algorithm for the certificates (only for `cert-manager` engine) | `RSA` | +| `tls.autoGenerated.certManager.keySize` | Key size for the certificates (only for `cert-manager` engine) | `2048` | +| `tls.autoGenerated.certManager.duration` | Duration for the certificates (only for `cert-manager` engine) | `2160h` | +| `tls.autoGenerated.certManager.renewBefore` | Renewal period for the certificates (only for `cert-manager` engine) | `360h` | +| `tls.existingSecret` | The name of an existing Secret containing the TLS certificates for Keycloak replicas | `""` | +| `tls.certFilename` | Certificate filename inside the existing secret (when tls.usePemCerts=true and tls.autoGenerated.enabled=false) | `tls.crt` | +| `tls.certKeyFilename` | Certificate key filename inside the existing secret (when tls.usePemCerts=true and tls.autoGenerated.enabled=false) | `tls.key` | +| `tls.keystoreFilename` | Keystore filename inside the existing secret | `keycloak.keystore.jks` | +| `tls.truststoreFilename` | Truststore filename inside the existing secret | `keycloak.truststore.jks` | +| `tls.keystorePassword` | Password to access the keystore when it's password-protected | `""` | +| `tls.truststorePassword` | Password to access the truststore when it's password-protected | `""` | +| `tls.passwordsSecret` | The name of an existing Secret containing the keystore/truststore passwords (expected keys: `tls-keystore-password` and `tls-truststore-password`) | `""` | +| `trustedCertsExistingSecret` | Name of the existing Secret containing the trusted certificates to validate communications with external services | `""` | +| `adminRealm` | Name of the admin realm | `master` | +| `proxyHeaders` | Set Keycloak proxy headers | `""` | +| `hostnameStrict` | Disables dynamically resolving the hostname from request headers (ignored if ingress.enabled is false). | `false` | +| `httpEnabled` | Force enabling HTTP endpoint (by default is only enabled if TLS is disabled) | `false` | +| `httpRelativePath` | Set the path relative to '/' for serving resources | `/` | +| `cache.enabled` | Switch to enable or disable the Keycloak distributed cache for kubernetes. | `true` | +| `cache.stack` | Cache stack to use | `jdbc-ping` | +| `cache.configFile` | Path to the file from which cache configuration should be loaded from | `cache-ispn.xml` | +| `cache.useHeadlessServiceWithAppVersion` | Create a headless service used for ispn containing the app version | `false` | +| `logging.output` | Alternates between the default log output format or json format | `default` | +| `logging.level` | Allowed values as documented: FATAL, ERROR, WARN, INFO, DEBUG, TRACE, ALL, OFF | `INFO` | +| `configuration` | Keycloak Configuration. Auto-generated based on other parameters when not specified | `""` | +| `existingConfigmap` | Name of existing ConfigMap with Keycloak configuration | `""` | +| `extraStartupArgs` | Extra default startup args | `""` | +| `initdbScripts` | Dictionary of initdb scripts | `{}` | +| `initdbScriptsConfigMap` | ConfigMap with the initdb scripts (Note: Overrides `initdbScripts`) | `""` | +| `command` | Override default container command (useful when using custom images) | `[]` | +| `args` | Override default container args (useful when using custom images) | `[]` | +| `extraEnvVars` | Extra environment variables to be set on Keycloak container | `[]` | +| `extraEnvVarsCM` | Name of existing ConfigMap containing extra env vars | `""` | +| `extraEnvVarsSecret` | Name of existing Secret containing extra env vars | `""` | +| `containerPorts.http` | Keycloak HTTP container port | `8080` | +| `containerPorts.https` | Keycloak HTTPS container port | `8443` | +| `containerPorts.management` | Keycloak management container port | `9000` | +| `extraContainerPorts` | Optionally specify extra list of additional ports for Keycloak container | `[]` | +| `podSecurityContext.enabled` | Enabled Keycloak pods' Security Context | `true` | +| `podSecurityContext.fsGroupChangePolicy` | Set filesystem group change policy | `Always` | +| `podSecurityContext.sysctls` | Set kernel settings using the sysctl interface | `[]` | +| `podSecurityContext.supplementalGroups` | Set filesystem extra groups | `[]` | +| `podSecurityContext.fsGroup` | Set Keycloak pod's Security Context fsGroup | `1001` | +| `containerSecurityContext.enabled` | Enabled containers' Security Context | `true` | +| `containerSecurityContext.seLinuxOptions` | Set SELinux options in container | `{}` | +| `containerSecurityContext.runAsUser` | Set containers' Security Context runAsUser | `1001` | +| `containerSecurityContext.runAsGroup` | Set containers' Security Context runAsGroup | `1001` | +| `containerSecurityContext.runAsNonRoot` | Set container's Security Context runAsNonRoot | `true` | +| `containerSecurityContext.privileged` | Set container's Security Context privileged | `false` | +| `containerSecurityContext.readOnlyRootFilesystem` | Set container's Security Context readOnlyRootFilesystem | `true` | +| `containerSecurityContext.allowPrivilegeEscalation` | Set container's Security Context allowPrivilegeEscalation | `false` | +| `containerSecurityContext.capabilities.drop` | List of capabilities to be dropped | `["ALL"]` | +| `containerSecurityContext.seccompProfile.type` | Set container's Security Context seccomp profile | `RuntimeDefault` | +| `resourcesPreset` | Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if resources is set (resources is recommended for production). | `small` | +| `resources` | Set container requests and limits for different resources like CPU or memory (essential for production workloads) | `{}` | +| `livenessProbe.enabled` | Enable livenessProbe on Keycloak containers | `true` | +| `livenessProbe.initialDelaySeconds` | Initial delay seconds for livenessProbe | `120` | +| `livenessProbe.periodSeconds` | Period seconds for livenessProbe | `1` | +| `livenessProbe.timeoutSeconds` | Timeout seconds for livenessProbe | `5` | +| `livenessProbe.failureThreshold` | Failure threshold for livenessProbe | `3` | +| `livenessProbe.successThreshold` | Success threshold for livenessProbe | `1` | +| `readinessProbe.enabled` | Enable readinessProbe on Keycloak containers | `true` | +| `readinessProbe.initialDelaySeconds` | Initial delay seconds for readinessProbe | `30` | +| `readinessProbe.periodSeconds` | Period seconds for readinessProbe | `10` | +| `readinessProbe.timeoutSeconds` | Timeout seconds for readinessProbe | `1` | +| `readinessProbe.failureThreshold` | Failure threshold for readinessProbe | `3` | +| `readinessProbe.successThreshold` | Success threshold for readinessProbe | `1` | +| `startupProbe.enabled` | Enable startupProbe on Keycloak containers | `false` | +| `startupProbe.initialDelaySeconds` | Initial delay seconds for startupProbe | `30` | +| `startupProbe.periodSeconds` | Period seconds for startupProbe | `5` | +| `startupProbe.timeoutSeconds` | Timeout seconds for startupProbe | `1` | +| `startupProbe.failureThreshold` | Failure threshold for startupProbe | `10` | +| `startupProbe.successThreshold` | Success threshold for startupProbe | `1` | +| `customLivenessProbe` | Custom Liveness probes for Keycloak | `{}` | +| `customReadinessProbe` | Custom Readiness probes Keycloak | `{}` | +| `customStartupProbe` | Custom Startup probes for Keycloak | `{}` | -### Keycloak statefulset parameters +### Keycloak StatefulSet parameters -| Name | Description | Value | -| --------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | -| `replicaCount` | Number of Keycloak replicas to deploy | `1` | -| `revisionHistoryLimitCount` | Number of controller revisions to keep | `10` | -| `containerPorts.http` | Keycloak HTTP container port | `8080` | -| `containerPorts.https` | Keycloak HTTPS container port | `8443` | -| `containerPorts.metrics` | Keycloak metrics container port | `9000` | -| `extraContainerPorts` | Optionally specify extra list of additional port-mappings for Keycloak container | `[]` | -| `statefulsetAnnotations` | Optionally add extra annotations on the statefulset resource | `{}` | -| `podSecurityContext.enabled` | Enabled Keycloak pods' Security Context | `true` | -| `podSecurityContext.fsGroupChangePolicy` | Set filesystem group change policy | `Always` | -| `podSecurityContext.sysctls` | Set kernel settings using the sysctl interface | `[]` | -| `podSecurityContext.supplementalGroups` | Set filesystem extra groups | `[]` | -| `podSecurityContext.fsGroup` | Set Keycloak pod's Security Context fsGroup | `1001` | -| `containerSecurityContext.enabled` | Enabled containers' Security Context | `true` | -| `containerSecurityContext.seLinuxOptions` | Set SELinux options in container | `{}` | -| `containerSecurityContext.runAsUser` | Set containers' Security Context runAsUser | `1001` | -| `containerSecurityContext.runAsGroup` | Set containers' Security Context runAsGroup | `1001` | -| `containerSecurityContext.runAsNonRoot` | Set container's Security Context runAsNonRoot | `true` | -| `containerSecurityContext.privileged` | Set container's Security Context privileged | `false` | -| `containerSecurityContext.readOnlyRootFilesystem` | Set container's Security Context readOnlyRootFilesystem | `true` | -| `containerSecurityContext.allowPrivilegeEscalation` | Set container's Security Context allowPrivilegeEscalation | `false` | -| `containerSecurityContext.capabilities.drop` | List of capabilities to be dropped | `["ALL"]` | -| `containerSecurityContext.seccompProfile.type` | Set container's Security Context seccomp profile | `RuntimeDefault` | -| `resourcesPreset` | Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if resources is set (resources is recommended for production). | `small` | -| `resources` | Set container requests and limits for different resources like CPU or memory (essential for production workloads) | `{}` | -| `livenessProbe.enabled` | Enable livenessProbe on Keycloak containers | `true` | -| `livenessProbe.initialDelaySeconds` | Initial delay seconds for livenessProbe | `300` | -| `livenessProbe.periodSeconds` | Period seconds for livenessProbe | `1` | -| `livenessProbe.timeoutSeconds` | Timeout seconds for livenessProbe | `5` | -| `livenessProbe.failureThreshold` | Failure threshold for livenessProbe | `3` | -| `livenessProbe.successThreshold` | Success threshold for livenessProbe | `1` | -| `readinessProbe.enabled` | Enable readinessProbe on Keycloak containers | `true` | -| `readinessProbe.initialDelaySeconds` | Initial delay seconds for readinessProbe | `30` | -| `readinessProbe.periodSeconds` | Period seconds for readinessProbe | `10` | -| `readinessProbe.timeoutSeconds` | Timeout seconds for readinessProbe | `1` | -| `readinessProbe.failureThreshold` | Failure threshold for readinessProbe | `3` | -| `readinessProbe.successThreshold` | Success threshold for readinessProbe | `1` | -| `startupProbe.enabled` | Enable startupProbe on Keycloak containers | `false` | -| `startupProbe.initialDelaySeconds` | Initial delay seconds for startupProbe | `30` | -| `startupProbe.periodSeconds` | Period seconds for startupProbe | `5` | -| `startupProbe.timeoutSeconds` | Timeout seconds for startupProbe | `1` | -| `startupProbe.failureThreshold` | Failure threshold for startupProbe | `60` | -| `startupProbe.successThreshold` | Success threshold for startupProbe | `1` | -| `customLivenessProbe` | Custom Liveness probes for Keycloak | `{}` | -| `customReadinessProbe` | Custom Rediness probes Keycloak | `{}` | -| `customStartupProbe` | Custom Startup probes for Keycloak | `{}` | -| `lifecycleHooks` | LifecycleHooks to set additional configuration at startup | `{}` | -| `automountServiceAccountToken` | Mount Service Account token in pod | `true` | -| `hostAliases` | Deployment pod host aliases | `[]` | -| `podLabels` | Extra labels for Keycloak pods | `{}` | -| `podAnnotations` | Annotations for Keycloak pods | `{}` | -| `podAffinityPreset` | Pod affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` | -| `podAntiAffinityPreset` | Pod anti-affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `soft` | -| `nodeAffinityPreset.type` | Node affinity preset type. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` | -| `nodeAffinityPreset.key` | Node label key to match. Ignored if `affinity` is set. | `""` | -| `nodeAffinityPreset.values` | Node label values to match. Ignored if `affinity` is set. | `[]` | -| `affinity` | Affinity for pod assignment | `{}` | -| `nodeSelector` | Node labels for pod assignment | `{}` | -| `tolerations` | Tolerations for pod assignment | `[]` | -| `topologySpreadConstraints` | Topology Spread Constraints for pod assignment spread across your cluster among failure-domains. Evaluated as a template | `[]` | -| `podManagementPolicy` | Pod management policy for the Keycloak statefulset | `Parallel` | -| `priorityClassName` | Keycloak pods' Priority Class Name | `""` | -| `schedulerName` | Use an alternate scheduler, e.g. "stork". | `""` | -| `terminationGracePeriodSeconds` | Seconds Keycloak pod needs to terminate gracefully | `""` | -| `updateStrategy.type` | Keycloak statefulset strategy type | `RollingUpdate` | -| `updateStrategy.rollingUpdate` | Keycloak statefulset rolling update configuration parameters | `{}` | -| `minReadySeconds` | How many seconds a pod needs to be ready before killing the next, during update | `0` | -| `extraVolumes` | Optionally specify extra list of additional volumes for Keycloak pods | `[]` | -| `extraVolumeMounts` | Optionally specify extra list of additional volumeMounts for Keycloak container(s) | `[]` | -| `initContainers` | Add additional init containers to the Keycloak pods | `[]` | -| `sidecars` | Add additional sidecar containers to the Keycloak pods | `[]` | +| Name | Description | Value | +| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | --------------- | +| `replicaCount` | Number of Keycloak replicas to deploy | `1` | +| `updateStrategy.type` | Keycloak StatefulSet type | `RollingUpdate` | +| `revisionHistoryLimitCount` | Number of controller revisions to keep | `10` | +| `minReadySeconds` | How many seconds a pod needs to be ready before killing the next, during update | `0` | +| `statefulsetAnnotations` | Optionally add extra annotations on the StatefulSet resource | `{}` | +| `automountServiceAccountToken` | Mount Service Account token in Keycloak pods | `true` | +| `hostAliases` | Deployment pod host aliases | `[]` | +| `podLabels` | Extra labels for Keycloak pods | `{}` | +| `podAnnotations` | Annotations for Keycloak pods | `{}` | +| `podAffinityPreset` | Pod affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` | +| `podAntiAffinityPreset` | Pod anti-affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `soft` | +| `nodeAffinityPreset.type` | Node affinity preset type. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` | +| `nodeAffinityPreset.key` | Node label key to match. Ignored if `affinity` is set. | `""` | +| `nodeAffinityPreset.values` | Node label values to match. Ignored if `affinity` is set. | `[]` | +| `affinity` | Affinity for pod assignment | `{}` | +| `nodeSelector` | Node labels for pod assignment | `{}` | +| `tolerations` | Tolerations for pod assignment | `[]` | +| `topologySpreadConstraints` | Topology Spread Constraints for pod assignment spread across your cluster among failure-domains. Evaluated as a template | `[]` | +| `podManagementPolicy` | Pod management policy for the Keycloak StatefulSet | `Parallel` | +| `priorityClassName` | Keycloak pods' Priority Class Name | `""` | +| `schedulerName` | Use an alternate scheduler, e.g. "stork". | `""` | +| `terminationGracePeriodSeconds` | Seconds Keycloak pod needs to terminate gracefully | `""` | +| `lifecycleHooks` | LifecycleHooks to set additional configuration at startup | `{}` | +| `dnsPolicy` | DNS Policy for pod | `""` | +| `dnsConfig` | DNS Configuration pod | `{}` | +| `enableServiceLinks` | If set to false, disable Kubernetes service links in the pod spec | `true` | +| `extraVolumes` | Optionally specify extra list of additional volumes for Keycloak pods | `[]` | +| `extraVolumeMounts` | Optionally specify extra list of additional volumeMounts for Keycloak container(s) | `[]` | +| `initContainers` | Add additional init containers to the Keycloak pods | `[]` | +| `sidecars` | Add additional sidecar containers to the Keycloak pods | `[]` | -### Exposure parameters +### Traffic Exposure Parameters -| Name | Description | Value | -| --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ------------------------ | -| `service.type` | Kubernetes service type | `ClusterIP` | -| `service.http.enabled` | Enable http port on service | `true` | -| `service.ports.http` | Keycloak service HTTP port | `80` | -| `service.ports.https` | Keycloak service HTTPS port | `443` | -| `service.nodePorts` | Specify the nodePort values for the LoadBalancer and NodePort service types. | `{}` | -| `service.sessionAffinity` | Control where client requests go, to the same pod or round-robin | `None` | -| `service.sessionAffinityConfig` | Additional settings for the sessionAffinity | `{}` | -| `service.clusterIP` | Keycloak service clusterIP IP | `""` | -| `service.loadBalancerIP` | loadBalancerIP for the SuiteCRM Service (optional, cloud specific) | `""` | -| `service.loadBalancerSourceRanges` | Address that are allowed when service is LoadBalancer | `[]` | -| `service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` | -| `service.annotations` | Additional custom annotations for Keycloak service | `{}` | -| `service.extraPorts` | Extra port to expose on Keycloak service | `[]` | -| `service.extraHeadlessPorts` | Extra ports to expose on Keycloak headless service | `[]` | -| `service.headless.annotations` | Annotations for the headless service. | `{}` | -| `service.headless.extraPorts` | Extra ports to expose on Keycloak headless service | `[]` | -| `ingress.enabled` | Enable ingress record generation for Keycloak | `false` | -| `ingress.ingressClassName` | IngressClass that will be be used to implement the Ingress (evaluated as template) (Kubernetes 1.18+) | `""` | -| `ingress.pathType` | Ingress path type | `ImplementationSpecific` | -| `ingress.apiVersion` | Force Ingress API version (automatically detected if not set) | `""` | -| `ingress.controller` | The ingress controller type. Currently supports `default` and `gce` | `default` | -| `ingress.hostname` | Default host for the ingress record (evaluated as template) | `keycloak.local` | -| `ingress.hostnameStrict` | Disables dynamically resolving the hostname from request headers. | `false` | -| `ingress.path` | Default path for the ingress record (evaluated as template) | `""` | -| `ingress.servicePort` | Backend service port to use | `http` | -| `ingress.annotations` | Additional annotations for the Ingress resource. To enable certificate autogeneration, place here your cert-manager annotations. | `{}` | -| `ingress.labels` | Additional labels for the Ingress resource. | `{}` | -| `ingress.tls` | Enable TLS configuration for the host defined at `ingress.hostname` parameter | `false` | -| `ingress.selfSigned` | Create a TLS secret for this ingress record using self-signed certificates generated by Helm | `false` | -| `ingress.extraHosts` | An array with additional hostname(s) to be covered with the ingress record | `[]` | -| `ingress.extraPaths` | Any additional arbitrary paths that may need to be added to the ingress under the main host. | `[]` | -| `ingress.extraTls` | The tls configuration for additional hostnames to be covered with this ingress record. | `[]` | -| `ingress.secrets` | If you're providing your own certificates, please use this to add the certificates as secrets | `[]` | -| `ingress.extraRules` | Additional rules to be covered with this ingress record | `[]` | -| `adminIngress.enabled` | Enable admin ingress record generation for Keycloak | `false` | -| `adminIngress.ingressClassName` | IngressClass that will be be used to implement the Ingress (evaluated as template) (Kubernetes 1.18+) | `""` | -| `adminIngress.pathType` | Ingress path type | `ImplementationSpecific` | -| `adminIngress.apiVersion` | Force Ingress API version (automatically detected if not set) | `""` | -| `adminIngress.controller` | The ingress controller type. Currently supports `default` and `gce` | `default` | -| `adminIngress.hostname` | Default host for the admin ingress record (evaluated as template) | `keycloak.local` | -| `adminIngress.path` | Default path for the admin ingress record (evaluated as template) | `""` | -| `adminIngress.servicePort` | Backend service port to use | `http` | -| `adminIngress.annotations` | Additional annotations for the Ingress resource. To enable certificate autogeneration, place here your cert-manager annotations. | `{}` | -| `adminIngress.labels` | Additional labels for the Ingress resource. | `{}` | -| `adminIngress.tls` | Enable TLS configuration for the host defined at `adminIngress.hostname` parameter | `false` | -| `adminIngress.selfSigned` | Create a TLS secret for this ingress record using self-signed certificates generated by Helm | `false` | -| `adminIngress.extraHosts` | An array with additional hostname(s) to be covered with the admin ingress record | `[]` | -| `adminIngress.extraPaths` | Any additional arbitrary paths that may need to be added to the admin ingress under the main host. | `[]` | -| `adminIngress.extraTls` | The tls configuration for additional hostnames to be covered with this ingress record. | `[]` | -| `adminIngress.secrets` | If you're providing your own certificates, please use this to add the certificates as secrets | `[]` | -| `adminIngress.extraRules` | Additional rules to be covered with this ingress record | `[]` | -| `networkPolicy.enabled` | Specifies whether a NetworkPolicy should be created | `true` | -| `networkPolicy.allowExternal` | Don't require server label for connections | `true` | -| `networkPolicy.allowExternalEgress` | Allow the pod to access any range of port and all destinations. | `true` | -| `networkPolicy.kubeAPIServerPorts` | List of possible endpoints to kube-apiserver (limit to your cluster settings to increase security) | `[]` | -| `networkPolicy.extraIngress` | Add extra ingress rules to the NetworkPolicy | `[]` | -| `networkPolicy.extraEgress` | Add extra ingress rules to the NetworkPolicy | `[]` | -| `networkPolicy.ingressNSMatchLabels` | Labels to match to allow traffic from other namespaces | `{}` | -| `networkPolicy.ingressNSPodMatchLabels` | Pod labels to match to allow traffic from other namespaces | `{}` | - -### RBAC parameter - -| Name | Description | Value | -| --------------------------------------------- | --------------------------------------------------------- | ------- | -| `serviceAccount.create` | Enable the creation of a ServiceAccount for Keycloak pods | `true` | -| `serviceAccount.name` | Name of the created ServiceAccount | `""` | -| `serviceAccount.automountServiceAccountToken` | Auto-mount the service account token in the pod | `false` | -| `serviceAccount.annotations` | Additional custom annotations for the ServiceAccount | `{}` | -| `serviceAccount.extraLabels` | Additional labels for the ServiceAccount | `{}` | -| `rbac.create` | Whether to create and use RBAC resources or not | `false` | -| `rbac.rules` | Custom RBAC rules | `[]` | +| Name | Description | Value | +| --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | +| `service.type` | Kubernetes service type | `ClusterIP` | +| `service.http.enabled` | Enable http port on service | `true` | +| `service.ports.http` | Keycloak service HTTP port | `80` | +| `service.ports.https` | Keycloak service HTTPS port | `443` | +| `service.nodePorts.http` | Node port for HTTP | `""` | +| `service.nodePorts.https` | Node port for HTTPS | `""` | +| `service.extraPorts` | Extra port to expose on Keycloak service | `[]` | +| `service.sessionAffinity` | Control where client requests go, to the same pod or round-robin | `None` | +| `service.sessionAffinityConfig` | Additional settings for the sessionAffinity | `{}` | +| `service.clusterIP` | Keycloak service clusterIP IP | `""` | +| `service.loadBalancerIP` | loadBalancerIP for the SuiteCRM Service (optional, cloud specific) | `""` | +| `service.loadBalancerSourceRanges` | Address that are allowed when service is LoadBalancer | `[]` | +| `service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` | +| `service.annotations` | Additional custom annotations for Keycloak service | `{}` | +| `service.headless.annotations` | Annotations for the headless service. | `{}` | +| `service.headless.extraPorts` | Extra ports to expose on Keycloak headless service | `[]` | +| `ingress.enabled` | Enable ingress record generation for Keycloak | `false` | +| `ingress.pathType` | Ingress path type | `ImplementationSpecific` | +| `ingress.apiVersion` | Force Ingress API version (automatically detected if not set) | `""` | +| `ingress.hostname` | Default host for the ingress record (evaluated as template) | `keycloak.local` | +| `ingress.ingressClassName` | IngressClass that will be be used to implement the Ingress (evaluated as template) | `""` | +| `ingress.controller` | The ingress controller type. Currently supports `default` and `gce` | `default` | +| `ingress.path` | Default path for the ingress record | `{{ .Values.httpRelativePath }}` | +| `ingress.servicePort` | Backend service port to use | `http` | +| `ingress.annotations` | Additional annotations for the Ingress resource. To enable certificate autogeneration, place here your cert-manager annotations. | `{}` | +| `ingress.labels` | Additional labels for the Ingress resource. | `{}` | +| `ingress.tls` | Enable TLS configuration for the host defined at `ingress.hostname` parameter | `false` | +| `ingress.selfSigned` | Create a TLS secret for this ingress record using self-signed certificates generated by Helm | `false` | +| `ingress.extraHosts` | An array with additional hostname(s) to be covered with the ingress record | `[]` | +| `ingress.extraPaths` | Any additional arbitrary paths that may need to be added to the ingress under the main host. | `[]` | +| `ingress.extraTls` | The tls configuration for additional hostnames to be covered with this ingress record. | `[]` | +| `ingress.secrets` | If you're providing your own certificates, please use this to add the certificates as secrets | `[]` | +| `ingress.extraRules` | Additional rules to be covered with this ingress record | `[]` | +| `networkPolicy.enabled` | Specifies whether a NetworkPolicy should be created | `true` | +| `networkPolicy.allowExternal` | Don't require server label for connections | `true` | +| `networkPolicy.allowExternalEgress` | Allow the pod to access any range of port and all destinations. | `true` | +| `networkPolicy.addExternalClientAccess` | Allow access from pods with client label set to "true". Ignored if `networkPolicy.allowExternal` is true. | `true` | +| `networkPolicy.kubeAPIServerPorts` | List of possible endpoints to kube-apiserver (limit to your cluster settings to increase security) | `[]` | +| `networkPolicy.extraIngress` | Add extra ingress rules to the NetworkPolicy | `[]` | +| `networkPolicy.extraEgress` | Add extra ingress rules to the NetworkPolicy | `[]` | +| `networkPolicy.ingressPodMatchLabels` | Labels to match to allow traffic from other pods. Ignored if `networkPolicy.allowExternal` is true. | `{}` | +| `networkPolicy.ingressNSMatchLabels` | Labels to match to allow traffic from other namespaces | `{}` | +| `networkPolicy.ingressNSPodMatchLabels` | Pod labels to match to allow traffic from other namespaces | `{}` | ### Other parameters -| Name | Description | Value | -| ----------------------------------------------------------- | -------------------------------------------------------------------------------------------- | ------- | -| `pdb.create` | Enable/disable a Pod Disruption Budget creation | `true` | -| `pdb.minAvailable` | Minimum number/percentage of pods that should remain scheduled | `""` | -| `pdb.maxUnavailable` | Maximum number/percentage of pods that may be made unavailable | `""` | -| `autoscaling.enabled` | Enable autoscaling for Keycloak | `false` | -| `autoscaling.minReplicas` | Minimum number of Keycloak replicas | `1` | -| `autoscaling.maxReplicas` | Maximum number of Keycloak replicas | `11` | -| `autoscaling.targetCPU` | Target CPU utilization percentage | `""` | -| `autoscaling.targetMemory` | Target Memory utilization percentage | `""` | -| `autoscaling.behavior.scaleUp.stabilizationWindowSeconds` | The number of seconds for which past recommendations should be considered while scaling up | `120` | -| `autoscaling.behavior.scaleUp.selectPolicy` | The priority of policies that the autoscaler will apply when scaling up | `Max` | -| `autoscaling.behavior.scaleUp.policies` | HPA scaling policies when scaling up | `[]` | -| `autoscaling.behavior.scaleDown.stabilizationWindowSeconds` | The number of seconds for which past recommendations should be considered while scaling down | `300` | -| `autoscaling.behavior.scaleDown.selectPolicy` | The priority of policies that the autoscaler will apply when scaling down | `Max` | -| `autoscaling.behavior.scaleDown.policies` | HPA scaling policies when scaling down | `[]` | +| Name | Description | Value | +| --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ------- | +| `serviceAccount.create` | Specifies whether a ServiceAccount should be created | `true` | +| `serviceAccount.name` | The name of the ServiceAccount to use. | `""` | +| `serviceAccount.annotations` | Additional Service Account annotations (evaluated as a template) | `{}` | +| `serviceAccount.automountServiceAccountToken` | Automount service account token for the server service account | `true` | +| `serviceAccount.extraLabels` | Additional Service Account labels (evaluated as a template) | `{}` | +| `pdb.create` | Enable/disable a Pod Disruption Budget creation | `true` | +| `pdb.minAvailable` | Minimum number/percentage of pods that should remain scheduled | `""` | +| `pdb.maxUnavailable` | Maximum number/percentage of pods that may be made unavailable. Defaults to `1` if both `pdb.minAvailable` and `pdb.maxUnavailable` are empty. | `""` | +| `autoscaling.vpa.enabled` | Enable VPA for Keycloak pods | `false` | +| `autoscaling.vpa.annotations` | Annotations for VPA resource | `{}` | +| `autoscaling.vpa.controlledResources` | VPA List of resources that the vertical pod autoscaler can control. Defaults to cpu and memory | `[]` | +| `autoscaling.vpa.maxAllowed` | VPA Max allowed resources for the pod | `{}` | +| `autoscaling.vpa.minAllowed` | VPA Min allowed resources for the pod | `{}` | +| `autoscaling.vpa.updatePolicy.updateMode` | Autoscaling update policy | `Auto` | +| `autoscaling.hpa.enabled` | Enable HPA for Keycloak pods | `false` | +| `autoscaling.hpa.minReplicas` | Minimum number of Keycloak replicas | `1` | +| `autoscaling.hpa.maxReplicas` | Maximum number of Keycloak replicas | `11` | +| `autoscaling.hpa.targetCPU` | Target CPU utilization percentage | `""` | +| `autoscaling.hpa.targetMemory` | Target Memory utilization percentage | `""` | +| `autoscaling.hpa.behavior.scaleUp.stabilizationWindowSeconds` | The number of seconds for which past recommendations should be considered while scaling up | `120` | +| `autoscaling.hpa.behavior.scaleUp.selectPolicy` | The priority of policies that the autoscaler will apply when scaling up | `Max` | +| `autoscaling.hpa.behavior.scaleUp.policies` | HPA scaling policies when scaling up | `[]` | +| `autoscaling.hpa.behavior.scaleDown.stabilizationWindowSeconds` | The number of seconds for which past recommendations should be considered while scaling down | `300` | +| `autoscaling.hpa.behavior.scaleDown.selectPolicy` | The priority of policies that the autoscaler will apply when scaling down | `Max` | +| `autoscaling.hpa.behavior.scaleDown.policies` | HPA scaling policies when scaling down | `[]` | ### Metrics parameters -| Name | Description | Value | -| ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | -| `metrics.enabled` | Enable exposing Keycloak statistics | `false` | -| `metrics.service.ports.http` | Metrics service HTTP port | `8080` | -| `metrics.service.ports.https` | Metrics service HTTPS port | `8443` | -| `metrics.service.ports.metrics` | Metrics service Metrics port | `9000` | -| `metrics.service.annotations` | Annotations for enabling prometheus to access the metrics endpoints | `{}` | -| `metrics.service.extraPorts` | Add additional ports to the keycloak metrics service (i.e. admin port 9000) | `[]` | -| `metrics.serviceMonitor.enabled` | Create ServiceMonitor Resource for scraping metrics using PrometheusOperator | `false` | -| `metrics.serviceMonitor.port` | Metrics service HTTP port | `metrics` | -| `metrics.serviceMonitor.scheme` | Metrics service scheme | `http` | -| `metrics.serviceMonitor.tlsConfig` | Metrics service TLS configuration | `{}` | -| `metrics.serviceMonitor.endpoints` | The endpoint configuration of the ServiceMonitor. Path is mandatory. Port, scheme, tlsConfig, interval, timeout and labellings can be overwritten. | `[]` | -| `metrics.serviceMonitor.path` | Metrics service HTTP path. Deprecated: Use @param metrics.serviceMonitor.endpoints instead | `""` | -| `metrics.serviceMonitor.namespace` | Namespace which Prometheus is running in | `""` | -| `metrics.serviceMonitor.interval` | Interval at which metrics should be scraped | `30s` | -| `metrics.serviceMonitor.scrapeTimeout` | Specify the timeout after which the scrape is ended | `""` | -| `metrics.serviceMonitor.labels` | Additional labels that can be used so ServiceMonitor will be discovered by Prometheus | `{}` | -| `metrics.serviceMonitor.selector` | Prometheus instance selector labels | `{}` | -| `metrics.serviceMonitor.relabelings` | RelabelConfigs to apply to samples before scraping | `[]` | -| `metrics.serviceMonitor.metricRelabelings` | MetricRelabelConfigs to apply to samples before ingestion | `[]` | -| `metrics.serviceMonitor.honorLabels` | honorLabels chooses the metric's labels on collisions with target labels | `false` | -| `metrics.serviceMonitor.jobLabel` | The name of the label on the target service to use as the job name in prometheus. | `""` | -| `metrics.prometheusRule.enabled` | Create PrometheusRule Resource for scraping metrics using PrometheusOperator | `false` | -| `metrics.prometheusRule.namespace` | Namespace which Prometheus is running in | `""` | -| `metrics.prometheusRule.labels` | Additional labels that can be used so PrometheusRule will be discovered by Prometheus | `{}` | -| `metrics.prometheusRule.groups` | Groups, containing the alert rules. | `[]` | +| Name | Description | Value | +| ------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------- | +| `metrics.enabled` | Enable exposing Keycloak metrics | `false` | +| `metrics.service.ports.metrics` | Metrics service Metrics port | `9000` | +| `metrics.service.annotations` | Annotations for enabling prometheus to access the metrics endpoints | `{}` | +| `metrics.service.extraPorts` | Add additional ports to the keycloak metrics service | `[]` | +| `metrics.serviceMonitor.enabled` | if `true`, creates a Prometheus Operator ServiceMonitor (also requires `metrics.enabled` to be `true`) | `false` | +| `metrics.serviceMonitor.namespace` | Namespace in which Prometheus is running | `""` | +| `metrics.serviceMonitor.annotations` | Additional custom annotations for the ServiceMonitor | `{}` | +| `metrics.serviceMonitor.labels` | Extra labels for the ServiceMonitor | `{}` | +| `metrics.serviceMonitor.jobLabel` | The name of the label on the target service to use as the job name in Prometheus | `""` | +| `metrics.serviceMonitor.honorLabels` | honorLabels chooses the metric's labels on collisions with target labels | `false` | +| `metrics.serviceMonitor.tlsConfig` | TLS configuration used for scrape endpoints used by Prometheus | `{}` | +| `metrics.serviceMonitor.interval` | Interval at which metrics should be scraped. | `""` | +| `metrics.serviceMonitor.scrapeTimeout` | Timeout after which the scrape is ended | `""` | +| `metrics.serviceMonitor.metricRelabelings` | Specify additional relabeling of metrics | `[]` | +| `metrics.serviceMonitor.relabelings` | Specify general relabeling | `[]` | +| `metrics.serviceMonitor.selector` | Prometheus instance selector labels | `{}` | +| `metrics.prometheusRule.enabled` | Create PrometheusRule Resource for scraping metrics using PrometheusOperator | `false` | +| `metrics.prometheusRule.namespace` | Namespace which Prometheus is running in | `""` | +| `metrics.prometheusRule.labels` | Additional labels that can be used so PrometheusRule will be discovered by Prometheus | `{}` | +| `metrics.prometheusRule.groups` | Groups, containing the alert rules. | `[]` | ### keycloak-config-cli parameters @@ -656,7 +643,7 @@ As an alternative, you can use of the preset configurations for pod affinity, po | `keycloakConfigCli.podLabels` | Pod extra labels | `{}` | | `keycloakConfigCli.podAnnotations` | Annotations for job pod | `{}` | | `keycloakConfigCli.nodeSelector` | Node labels for pod assignment | `{}` | -| `keycloakConfigCli.podTolerations` | Tolerations for job pod assignment | `[]` | +| `keycloakConfigCli.tolerations` | Tolerations for job pod assignment | `[]` | | `keycloakConfigCli.availabilityCheck.enabled` | Whether to wait until Keycloak is available | `true` | | `keycloakConfigCli.availabilityCheck.timeout` | Timeout for the availability check (Default is 120s) | `""` | | `keycloakConfigCli.extraEnvVars` | Additional environment variables to set | `[]` | @@ -671,6 +658,24 @@ As an alternative, you can use of the preset configurations for pod affinity, po | `keycloakConfigCli.cleanupAfterFinished.enabled` | Enables Cleanup for Finished Jobs | `false` | | `keycloakConfigCli.cleanupAfterFinished.seconds` | Sets the value of ttlSecondsAfterFinished | `600` | +### Default init container parameters + +| Name | Description | Value | +| ------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | +| `defaultInitContainers.prepareWriteDirs.enabled` | Enable init container that copies writable directories to an empty dir | `true` | +| `defaultInitContainers.prepareWriteDirs.containerSecurityContext.enabled` | Enabled "prepare-write-dirs" init-containers' Security Context | `true` | +| `defaultInitContainers.prepareWriteDirs.containerSecurityContext.seLinuxOptions` | Set SELinux options in "prepare-write-dirs" init-containers | `{}` | +| `defaultInitContainers.prepareWriteDirs.containerSecurityContext.runAsUser` | Set runAsUser in "prepare-write-dirs" init-containers' Security Context | `1001` | +| `defaultInitContainers.prepareWriteDirs.containerSecurityContext.runAsGroup` | Set runAsGroup in "prepare-write-dirs" init-containers' Security Context | `1001` | +| `defaultInitContainers.prepareWriteDirs.containerSecurityContext.runAsNonRoot` | Set runAsNonRoot in "prepare-write-dirs" init-containers' Security Context | `true` | +| `defaultInitContainers.prepareWriteDirs.containerSecurityContext.privileged` | Set privileged in "prepare-write-dirs" init-containers' Security Context | `false` | +| `defaultInitContainers.prepareWriteDirs.containerSecurityContext.readOnlyRootFilesystem` | Set readOnlyRootFilesystem in "prepare-write-dirs" init-containers' Security Context | `true` | +| `defaultInitContainers.prepareWriteDirs.containerSecurityContext.allowPrivilegeEscalation` | Set allowPrivilegeEscalation in "prepare-write-dirs" init-containers' Security Context | `false` | +| `defaultInitContainers.prepareWriteDirs.containerSecurityContext.capabilities.drop` | List of capabilities to be dropped in "prepare-write-dirs" init-containers | `["ALL"]` | +| `defaultInitContainers.prepareWriteDirs.containerSecurityContext.seccompProfile.type` | Set seccomp profile in "prepare-write-dirs" init-containers | `RuntimeDefault` | +| `defaultInitContainers.prepareWriteDirs.resourcesPreset` | Set Keycloak "prepare-write-dirs" init container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if defaultInitContainers.prepareWriteDirs.resources is set (defaultInitContainers.prepareWriteDirs.resources is recommended for production). | `nano` | +| `defaultInitContainers.prepareWriteDirs.resources` | Set Keycloak "prepare-write-dirs" init container requests and limits for different resources like CPU or memory (essential for production workloads) | `{}` | + ### Database parameters | Name | Description | Value | @@ -690,28 +695,10 @@ As an alternative, you can use of the preset configurations for pod affinity, po | `externalDatabase.database` | Keycloak database name | `bitnami_keycloak` | | `externalDatabase.schema` | Keycloak database schema | `public` | | `externalDatabase.existingSecret` | Name of an existing secret resource containing the database credentials | `""` | -| `externalDatabase.existingSecretHostKey` | Name of an existing secret key containing the database host name | `""` | -| `externalDatabase.existingSecretPortKey` | Name of an existing secret key containing the database port | `""` | | `externalDatabase.existingSecretUserKey` | Name of an existing secret key containing the database user | `""` | -| `externalDatabase.existingSecretDatabaseKey` | Name of an existing secret key containing the database name | `""` | | `externalDatabase.existingSecretPasswordKey` | Name of an existing secret key containing the database credentials | `""` | | `externalDatabase.annotations` | Additional custom annotations for external database secret object | `{}` | - -### Keycloak Cache parameters - -| Name | Description | Value | -| ---------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | -| `cache.enabled` | Switch to enable or disable the keycloak distributed cache for kubernetes. | `true` | -| `cache.stack` | Set infinispan cache stack to use, sets KC_CACHE_STACK () | `kubernetes` | -| `cache.configFile` | Set infinispan cache stack config filename sets KC_CACHE_CONFIG_FILE () | `cache-ispn.xml` | -| `cache.useHeadlessServiceWithAppVersion` | Set to true to create the headless service used for ispn containing the app version | `false` | - -### Keycloak Logging parameters - -| Name | Description | Value | -| ---------------- | ------------------------------------------------------------------------------ | --------- | -| `logging.output` | Alternates between the default log output format or json format | `default` | -| `logging.level` | Allowed values as documented: FATAL, ERROR, WARN, INFO, DEBUG, TRACE, ALL, OFF | `INFO` | +| `externalDatabase.extraParams` | Additional JDBC connection parameters appended to the JDBC URL (KC_DB_URL). | `""` | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, @@ -742,6 +729,13 @@ Find more information about how to deal with common errors related to Bitnami's ## Upgrading +### To 25.0.0 + +This version stops relying on the [Keycloak Metrics SPI](https://github.com/aerogear/keycloak-metrics-spi) to expose metrics and, relies on the native metrics exposed by Keycloak via [the management interface](https://www.keycloak.org/server/management-interface) and removes SPI Truststore related parameters given this functionality was deprecated on Keycloak as described in this [GitHub discussion](https://github.com/keycloak/keycloak/discussions/28007). +For security reasons, we also dropped support for exposing the management interface via Ingress. + +This version includes some important refactoring to remove technical debt. As a consequence, some deprecated parameters were removed and it's likely some others were renamed to match the standards used in the Bitnami Charts catalog. + ### To 24.3.0 This version introduces image verification for security purposes. To disable it, set `global.security.allowInsecureImages` to `true`. More details at [GitHub issue](https://github.com/bitnami/charts/issues/30850). diff --git a/charts/keycloak/templates/NOTES.txt b/charts/keycloak/templates/NOTES.txt index 12a0ed9..523cf17 100644 --- a/charts/keycloak/templates/NOTES.txt +++ b/charts/keycloak/templates/NOTES.txt @@ -10,7 +10,7 @@ APP VERSION: {{ .Chart.AppVersion }} Keycloak can be accessed through the following DNS name from within your cluster: - {{ include "common.names.fullname" . }}.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }} (port {{ coalesce .Values.service.ports.http .Values.service.port }}) + {{ include "common.names.fullname" . }}.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }} (port {{ ternary .Values.service.ports.https .Values.service.ports.http .Values.tls.enabled }}) To access Keycloak from outside the cluster execute the following commands: @@ -22,60 +22,33 @@ To access Keycloak from outside the cluster execute the following commands: echo "Keycloak URL: http{{ if .Values.ingress.tls }}s{{ end }}://{{ (tpl .Values.ingress.hostname .) }}/" echo "$CLUSTER_IP {{ (tpl .Values.ingress.hostname .) }}" | sudo tee -a /etc/hosts -{{- if .Values.adminIngress.enabled }} -The admin area of Keycloak has been configured to point to a different domain ({{ .Values.adminIngress.hostname }}). Please remember to update the `frontendUrl` property of the `{{ .Values.adminRealm | default "master" }}` (or any other) realm for it to work properly (see README for an example) : - - echo "Keycloak admin URL: http{{ if .Values.adminIngress.tls }}s{{ end }}://{{ (tpl .Values.adminIngress.hostname .) }}/" - echo "$CLUSTER_IP {{ (tpl .Values.adminIngress.hostname .) }}" | sudo tee -a /etc/hosts -{{- end }} - {{- else }} 1. Get the Keycloak URL by running these commands: {{- if contains "NodePort" .Values.service.type }} - export HTTP_NODE_PORT=$(kubectl get --namespace {{ include "common.names.namespace" . }} -o jsonpath="{.spec.ports[?(@.name=='http')].nodePort}" services {{ include "common.names.fullname" . }}) - {{- if .Values.tls.enabled }} - export HTTPS_NODE_PORT=$(kubectl get --namespace {{ include "common.names.namespace" . }} -o jsonpath="{.spec.ports[?(@.name=='https')].nodePort}" services {{ include "common.names.fullname" . }}) - {{- end }} + export NODE_PORT=$(kubectl get --namespace {{ include "common.names.namespace" . }} -o jsonpath="{.spec.ports[?(@.name=='http{{ if .Values.tls.enabled }}s{{ end }}')].nodePort}" services {{ include "common.names.fullname" . }}) export NODE_IP=$(kubectl get nodes --namespace {{ include "common.names.namespace" . }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo "http://${NODE_IP}:${HTTP_NODE_PORT}/" - {{- if .Values.tls.enabled }} - echo "https://${NODE_IP}:${HTTPS_NODE_PORT}/" - {{- end }} + echo "http{{ if .Values.tls.enabled }}s{{ end }}://${NODE_IP}:${NODE_PORT}/" {{- else if contains "LoadBalancer" .Values.service.type }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. You can watch its status by running 'kubectl get --namespace {{ include "common.names.namespace" . }} svc -w {{ include "common.names.fullname" . }}' - export HTTP_SERVICE_PORT=$(kubectl get --namespace {{ include "common.names.namespace" . }} -o jsonpath="{.spec.ports[?(@.name=='http')].port}" services {{ include "common.names.fullname" . }}) - {{- if .Values.tls.enabled }} - export HTTPS_SERVICE_PORT=$(kubectl get --namespace {{ include "common.names.namespace" . }} -o jsonpath="{.spec.ports[?(@.name=='https')].port}" services {{ include "common.names.fullname" . }}) - {{- end }} + export SERVICE_PORT=$(kubectl get --namespace {{ include "common.names.namespace" . }} -o jsonpath="{.spec.ports[?(@.name=='http{{ if .Values.tls.enabled }}s{{ end }}')].port}" services {{ include "common.names.fullname" . }}) export SERVICE_IP=$(kubectl get svc --namespace {{ include "common.names.namespace" . }} {{ include "common.names.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') - echo "http://${SERVICE_IP}:${HTTP_SERVICE_PORT}/" - {{- if .Values.tls.enabled }} - echo "https://${SERVICE_IP}:${HTTPS_SERVICE_PORT}/" - {{- end }} + echo "http{{ if .Values.tls.enabled }}s{{ end }}://${SERVICE_IP}:${SERVICE_PORT}/" {{- else if contains "ClusterIP" .Values.service.type }} - export HTTP_SERVICE_PORT=$(kubectl get --namespace {{ include "common.names.namespace" . }} -o jsonpath="{.spec.ports[?(@.name=='http')].port}" services {{ include "common.names.fullname" . }}) - {{- if .Values.tls.enabled }} - export HTTPS_SERVICE_PORT=$(kubectl get --namespace {{ include "common.names.namespace" . }} -o jsonpath="{.spec.ports[?(@.name=='https')].port}" services {{ include "common.names.fullname" . }}) - kubectl port-forward --namespace {{ include "common.names.namespace" . }} svc/{{ include "common.names.fullname" . }} ${HTTP_SERVICE_PORT}:${HTTP_SERVICE_PORT} ${HTTPS_SERVICE_PORT}:${HTTPS_SERVICE_PORT} & - {{- else }} - kubectl port-forward --namespace {{ include "common.names.namespace" . }} svc/{{ include "common.names.fullname" . }} ${HTTP_SERVICE_PORT}:${HTTP_SERVICE_PORT} & - {{- end }} + export SERVICE_PORT=$(kubectl get --namespace {{ include "common.names.namespace" . }} -o jsonpath="{.spec.ports[?(@.name=='http{{ if .Values.tls.enabled }}s{{ end }}')].port}" services {{ include "common.names.fullname" . }}) + kubectl port-forward --namespace {{ include "common.names.namespace" . }} svc/{{ include "common.names.fullname" . }} ${SERVICE_PORT}:${SERVICE_PORT} & - echo "http://127.0.0.1:${HTTP_SERVICE_PORT}/" - {{- if .Values.tls.enabled }} - echo "https://127.0.0.1:${HTTPS_SERVICE_PORT}/" - {{- end }} + echo "http{{ if .Values.tls.enabled }}s{{ end }}://127.0.0.1:${SERVICE_PORT}/" {{- end }} {{- end }} @@ -85,7 +58,7 @@ The admin area of Keycloak has been configured to point to a different domain ({ 3. Access the Administration Console using the following credentials: echo Username: {{ .Values.auth.adminUser }} - echo Password: $(kubectl get secret --namespace {{ include "common.names.namespace" . }} {{ include "keycloak.secretName" . }} -o jsonpath="{.data.{{ include "keycloak.secretKey" .}}}" | base64 -d) + echo Password: $(kubectl get secret --namespace {{ include "common.names.namespace" . }} {{ include "keycloak.secretName" . }} -o jsonpath="{.data.{{ include "keycloak.secretKey" . }}}" | base64 -d) {{- end }} {{- if .Values.metrics.enabled }} @@ -93,9 +66,9 @@ You can access the Prometheus metrics following the steps below: 1. Get the Keycloak Prometheus metrics URL by running: - {{- $metricsPort := coalesce .Values.metrics.service.ports.metrics .Values.metrics.service.port | toString }} + {{- $metricsPort := .Values.metrics.service.ports.metrics | toString }} kubectl port-forward --namespace {{ include "common.names.namespace" . }} svc/{{ printf "%s-metrics" (include "common.names.fullname" .) }} {{ $metricsPort }}:{{ $metricsPort }} & - echo "Keycloak Prometheus metrics URL: http://127.0.0.1:{{ $metricsPort }}/metrics" + echo "Keycloak Prometheus metrics URL: http{{ if .Values.tls.enabled }}s{{ end }}://127.0.0.1:{{ $metricsPort }}/metrics" 2. Open a browser and access Keycloak Prometheus metrics using the obtained URL. @@ -104,6 +77,6 @@ You can access the Prometheus metrics following the steps below: {{- include "keycloak.validateValues" . }} {{- include "common.warnings.rollingTag" .Values.image }} {{- include "common.warnings.rollingTag" .Values.keycloakConfigCli.image }} -{{- include "common.warnings.resources" (dict "sections" (list "keycloakConfigCli" "") "context" $) }} -{{- include "common.warnings.modifiedImages" (dict "images" (list .Values.image .Values.keycloakConfigCli.image) "context" $) }} -{{- include "common.errors.insecureImages" (dict "images" (list .Values.image .Values.keycloakConfigCli.image) "context" $) }} +{{- include "common.warnings.resources" (dict "sections" (list "" "keycloakConfigCli") "context" .) }} +{{- include "common.warnings.modifiedImages" (dict "images" (list .Values.image .Values.keycloakConfigCli.image) "context" .) }} +{{- include "common.errors.insecureImages" (dict "images" (list .Values.image .Values.keycloakConfigCli.image) "context" .) }} diff --git a/charts/keycloak/templates/_helpers.tpl b/charts/keycloak/templates/_helpers.tpl index 52a1fb1..74cc30a 100644 --- a/charts/keycloak/templates/_helpers.tpl +++ b/charts/keycloak/templates/_helpers.tpl @@ -17,39 +17,35 @@ Return the proper keycloak-config-cli image name {{ include "common.images.image" (dict "imageRoot" .Values.keycloakConfigCli.image "global" .Values.global) }} {{- end -}} -{{/* -Return the keycloak-config-cli configuration configmap. -*/}} -{{- define "keycloak.keycloakConfigCli.configmapName" -}} -{{- if .Values.keycloakConfigCli.existingConfigmap -}} - {{- printf "%s" (tpl .Values.keycloakConfigCli.existingConfigmap $) -}} -{{- else -}} - {{- printf "%s-keycloak-config-cli-configmap" (include "common.names.fullname" .) -}} -{{- end -}} -{{- end -}} - -{{/* -Return true if a configmap object should be created for keycloak-config-cli -*/}} -{{- define "keycloak.keycloakConfigCli.createConfigmap" -}} -{{- if and .Values.keycloakConfigCli.enabled .Values.keycloakConfigCli.configuration (not .Values.keycloakConfigCli.existingConfigmap) -}} - {{- true -}} -{{- end -}} -{{- end -}} - {{/* Return the proper Docker Image Registry Secret Names */}} {{- define "keycloak.imagePullSecrets" -}} -{{- include "common.images.renderPullSecrets" (dict "images" (list .Values.image .Values.keycloakConfigCli.image) "context" $) -}} +{{- include "common.images.renderPullSecrets" (dict "images" (list .Values.image .Values.keycloakConfigCli.image) "context" .) -}} {{- end -}} {{/* -Create a default fully qualified app name. +Create a default fully qualified postgresql name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). */}} {{- define "keycloak.postgresql.fullname" -}} -{{- include "common.names.dependency.fullname" (dict "chartName" "postgresql" "chartValues" .Values.postgresql "context" $) -}} +{{- include "common.names.dependency.fullname" (dict "chartName" "postgresql" "chartValues" .Values.postgresql "context" .) -}} +{{- end -}} + +{{/* +Create a default fully qualified headless service name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +*/}} +{{- define "keycloak.headless.serviceName" -}} +{{- printf "%s-headless" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified headless service name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +*/}} +{{- define "keycloak.headless.ispn.serviceName" -}} +{{- printf "%s-headless-ispn-%s" (include "common.names.fullname" .) (replace "." "-" .Chart.AppVersion) | trunc 63 | trimSuffix "-" -}} {{- end -}} {{/* @@ -64,189 +60,24 @@ Create the name of the service account to use {{- end -}} {{/* -Return the path Keycloak is hosted on. This looks at httpRelativePath and returns it with a trailing slash. For example: - / -> / (the default httpRelativePath) - /auth -> /auth/ (trailing slash added) - /custom/ -> /custom/ (unchanged) -*/}} -{{- define "keycloak.httpPath" -}} -{{ ternary .Values.httpRelativePath (printf "%s%s" .Values.httpRelativePath "/") (hasSuffix "/" .Values.httpRelativePath) }} -{{- end -}} - -{{/* -Return the Keycloak configuration configmap +Return the Keycloak configuration ConfigMap name. */}} {{- define "keycloak.configmapName" -}} {{- if .Values.existingConfigmap -}} - {{- printf "%s" (tpl .Values.existingConfigmap $) -}} + {{- tpl .Values.existingConfigmap . -}} {{- else -}} {{- printf "%s-configuration" (include "common.names.fullname" .) -}} {{- end -}} {{- end -}} -{{/* -Return true if a configmap object should be created -*/}} -{{- define "keycloak.createConfigmap" -}} -{{- if and .Values.configuration (not .Values.existingConfigmap) }} - {{- true -}} -{{- end -}} -{{- end -}} - -{{/* -Return the Database hostname -*/}} -{{- define "keycloak.databaseHost" -}} -{{- if eq .Values.postgresql.architecture "replication" }} -{{- ternary (include "keycloak.postgresql.fullname" .) (tpl .Values.externalDatabase.host $) .Values.postgresql.enabled -}}-primary -{{- else -}} -{{- ternary (include "keycloak.postgresql.fullname" .) (tpl .Values.externalDatabase.host $) .Values.postgresql.enabled -}} -{{- end -}} -{{- end -}} - -{{/* -Return the Database port -*/}} -{{- define "keycloak.databasePort" -}} -{{- ternary "5432" (tpl (.Values.externalDatabase.port | toString) $) .Values.postgresql.enabled | quote -}} -{{- end -}} - -{{/* -Return the Database database name -*/}} -{{- define "keycloak.databaseName" -}} -{{- if .Values.postgresql.enabled }} - {{- if .Values.global.postgresql }} - {{- if .Values.global.postgresql.auth }} - {{- coalesce .Values.global.postgresql.auth.database .Values.postgresql.auth.database -}} - {{- else -}} - {{- .Values.postgresql.auth.database -}} - {{- end -}} - {{- else -}} - {{- .Values.postgresql.auth.database -}} - {{- end -}} -{{- else -}} - {{- tpl .Values.externalDatabase.database $ -}} -{{- end -}} -{{- end -}} - -{{/* -Return the Database port -*/}} -{{- define "keycloak.databaseSchema" -}} -{{- ternary "public" (tpl (.Values.externalDatabase.schema | toString) $) .Values.postgresql.enabled | quote -}} -{{- end -}} - -{{/* -Return the Database user -*/}} -{{- define "keycloak.databaseUser" -}} -{{- if .Values.postgresql.enabled -}} - {{- if .Values.global.postgresql -}} - {{- if .Values.global.postgresql.auth -}} - {{- coalesce .Values.global.postgresql.auth.username .Values.postgresql.auth.username -}} - {{- else -}} - {{- .Values.postgresql.auth.username -}} - {{- end -}} - {{- else -}} - {{- .Values.postgresql.auth.username -}} - {{- end -}} -{{- else -}} - {{- tpl .Values.externalDatabase.user $ -}} -{{- end -}} -{{- end -}} - -{{/* -Return the Database encrypted password -*/}} -{{- define "keycloak.databaseSecretName" -}} -{{- if .Values.postgresql.enabled -}} - {{- if .Values.global.postgresql -}} - {{- if .Values.global.postgresql.auth -}} - {{- if .Values.global.postgresql.auth.existingSecret -}} - {{- tpl .Values.global.postgresql.auth.existingSecret $ -}} - {{- else -}} - {{- default (include "keycloak.postgresql.fullname" .) (tpl .Values.postgresql.auth.existingSecret $) -}} - {{- end -}} - {{- else -}} - {{- default (include "keycloak.postgresql.fullname" .) (tpl .Values.postgresql.auth.existingSecret $) -}} - {{- end -}} - {{- else -}} - {{- default (include "keycloak.postgresql.fullname" .) (tpl .Values.postgresql.auth.existingSecret $) -}} - {{- end -}} -{{- else -}} - {{- default (printf "%s-externaldb" (include "common.names.fullname" .)) (tpl .Values.externalDatabase.existingSecret $) -}} -{{- end -}} -{{- end -}} - -{{/* -Add environment variables to configure database values -*/}} -{{- define "keycloak.databaseSecretPasswordKey" -}} -{{- if .Values.postgresql.enabled -}} - {{- printf "%s" (.Values.postgresql.auth.secretKeys.userPasswordKey | default "password") -}} -{{- else -}} - {{- if .Values.externalDatabase.existingSecret -}} - {{- if .Values.externalDatabase.existingSecretPasswordKey -}} - {{- printf "%s" .Values.externalDatabase.existingSecretPasswordKey -}} - {{- else -}} - {{- print "db-password" -}} - {{- end -}} - {{- else -}} - {{- print "db-password" -}} - {{- end -}} -{{- end -}} -{{- end -}} - -{{- define "keycloak.databaseSecretHostKey" -}} - {{- if .Values.externalDatabase.existingSecretHostKey -}} - {{- printf "%s" .Values.externalDatabase.existingSecretHostKey -}} - {{- else -}} - {{- print "db-host" -}} - {{- end -}} -{{- end -}} -{{- define "keycloak.databaseSecretPortKey" -}} - {{- if .Values.externalDatabase.existingSecretPortKey -}} - {{- printf "%s" .Values.externalDatabase.existingSecretPortKey -}} - {{- else -}} - {{- print "db-port" -}} - {{- end -}} -{{- end -}} -{{- define "keycloak.databaseSecretUserKey" -}} - {{- if .Values.externalDatabase.existingSecretUserKey -}} - {{- printf "%s" .Values.externalDatabase.existingSecretUserKey -}} - {{- else -}} - {{- print "db-user" -}} - {{- end -}} -{{- end -}} -{{- define "keycloak.databaseSecretDatabaseKey" -}} - {{- if .Values.externalDatabase.existingSecretDatabaseKey -}} - {{- printf "%s" .Values.externalDatabase.existingSecretDatabaseKey -}} - {{- else -}} - {{- print "db-database" -}} - {{- end -}} -{{- end -}} - -{{/* -Return the Keycloak initdb scripts configmap -*/}} -{{- define "keycloak.initdbScriptsCM" -}} -{{- if .Values.initdbScriptsConfigMap -}} - {{- printf "%s" .Values.initdbScriptsConfigMap -}} -{{- else -}} - {{- printf "%s-init-scripts" (include "common.names.fullname" .) -}} -{{- end -}} -{{- end -}} - {{/* Return the secret containing the Keycloak admin password */}} {{- define "keycloak.secretName" -}} -{{- $secretName := .Values.auth.existingSecret -}} -{{- if $secretName -}} - {{- printf "%s" (tpl $secretName $) -}} +{{- if .Values.auth.existingSecret -}} + {{- tpl .Values.auth.existingSecret . -}} {{- else -}} - {{- printf "%s" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" -}} + {{- include "common.names.fullname" . -}} {{- end -}} {{- end -}} @@ -254,21 +85,134 @@ Return the secret containing the Keycloak admin password Return the secret key that contains the Keycloak admin password */}} {{- define "keycloak.secretKey" -}} -{{- $secretName := .Values.auth.existingSecret -}} -{{- if and $secretName .Values.auth.passwordSecretKey -}} - {{- printf "%s" .Values.auth.passwordSecretKey -}} +{{- if and .Values.auth.existingSecret .Values.auth.passwordSecretKey -}} + {{- tpl .Values.auth.passwordSecretKey . -}} {{- else -}} {{- print "admin-password" -}} {{- end -}} {{- end -}} +{{/* +Return the keycloak-config-cli configuration ConfigMap name. +*/}} +{{- define "keycloak.keycloakConfigCli.configmapName" -}} +{{- if .Values.keycloakConfigCli.existingConfigmap -}} + {{- tpl .Values.keycloakConfigCli.existingConfigmap . -}} +{{- else -}} + {{- printf "%s-keycloak-config-cli-configmap" (include "common.names.fullname" .) -}} +{{- end -}} +{{- end -}} + +{{/* +Return the Database hostname +*/}} +{{- define "keycloak.database.host" -}} +{{- if .Values.postgresql.enabled -}} + {{- include "keycloak.postgresql.fullname" . -}}{{- if eq .Values.postgresql.architecture "replication" }}-primary{{- end -}} +{{- else -}} + {{- tpl .Values.externalDatabase.host . -}} +{{- end -}} +{{- end -}} + +{{/* +Return the Database port +*/}} +{{- define "keycloak.database.port" -}} +{{- ternary "5432" .Values.externalDatabase.port .Values.postgresql.enabled -}} +{{- end -}} + +{{/* +Return the Database database name +*/}} +{{- define "keycloak.database.name" -}} +{{- if .Values.postgresql.enabled }} + {{- coalesce (((.Values.global).postgresql).auth).database .Values.postgresql.auth.database "postgres" -}} +{{- else -}} + {{- tpl .Values.externalDatabase.database . -}} +{{- end -}} +{{- end -}} + +{{/* +Return the Database user +*/}} +{{- define "keycloak.database.user" -}} +{{- if .Values.postgresql.enabled -}} + {{- coalesce (((.Values.global).postgresql).auth).username .Values.postgresql.auth.username | default "" -}} +{{- else -}} + {{- tpl .Values.externalDatabase.user . -}} +{{- end -}} +{{- end -}} + +{{/* +Return the Database schema +*/}} +{{- define "keycloak.database.schema" -}} +{{- ternary "public" .Values.externalDatabase.schema .Values.postgresql.enabled -}} +{{- end -}} + +{{/* +Return extra connection parameters for the Database DSN +*/}} +{{- define "keycloak.database.extraParams" -}} +{{- if .Values.externalDatabase.extraParams -}} + {{- printf "&%s" (tpl .Values.externalDatabase.extraParams .) -}} +{{- end -}} +{{- end -}} + +{{/* +Return the Database secret name +*/}} +{{- define "keycloak.database.secretName" -}} +{{- if .Values.postgresql.enabled -}} + {{- if not (empty (coalesce (((.Values.global).postgresql).auth).existingSecret .Values.postgresql.auth.existingSecret | default "")) -}} + {{- tpl (coalesce (((.Values.global).postgresql).auth).existingSecret .Values.postgresql.auth.existingSecret) . -}} + {{- else -}} + {{- include "keycloak.postgresql.fullname" . -}} + {{- end -}} +{{- else if not (empty .Values.externalDatabase.existingSecret) -}} + {{- tpl .Values.externalDatabase.existingSecret . -}} +{{- else -}} + {{- printf "%s-externaldb" (include "common.names.fullname" .) -}} +{{- end -}} +{{- end -}} + +{{/* +Return the Database secret key that contains the database user +*/}} +{{- define "keycloak.database.secretUserKey" -}} +{{- default "db-user" .Values.externalDatabase.existingSecretUserKey -}} +{{- end -}} + +{{/* +Return the Database secret key that contains the database password +*/}} +{{- define "keycloak.database.secretPasswordKey" -}} +{{- if .Values.postgresql.enabled -}} + {{- default "password" .Values.postgresql.auth.secretKeys.userPasswordKey -}} +{{- else if .Values.externalDatabase.existingSecret -}} + {{- default "db-password" .Values.externalDatabase.existingSecretPasswordKey -}} +{{- else -}} + {{- print "db-password" -}} +{{- end -}} +{{- end -}} + +{{/* +Return the Keycloak initdb scripts ConfigMap name. +*/}} +{{- define "keycloak.initdbScripts.configmapName" -}} +{{- if .Values.initdbScriptsConfigMap -}} + {{- tpl .Values.initdbScriptsConfigMap . -}} +{{- else -}} + {{- printf "%s-init-scripts" (include "common.names.fullname" .) -}} +{{- end -}} +{{- end -}} + {{/* Return the secret containing Keycloak HTTPS/TLS certificates */}} -{{- define "keycloak.tlsSecretName" -}} -{{- $secretName := .Values.tls.existingSecret -}} -{{- if $secretName -}} - {{- printf "%s" (tpl $secretName $) -}} +{{- define "keycloak.tls.secretName" -}} +{{- if .Values.tls.existingSecret -}} + {{- tpl .Values.tls.existingSecret . -}} {{- else -}} {{- printf "%s-crt" (include "common.names.fullname" .) -}} {{- end -}} @@ -277,36 +221,14 @@ Return the secret containing Keycloak HTTPS/TLS certificates {{/* Return the secret containing Keycloak HTTPS/TLS keystore and truststore passwords */}} -{{- define "keycloak.tlsPasswordsSecretName" -}} -{{- $secretName := .Values.tls.passwordsSecret -}} -{{- if $secretName -}} - {{- printf "%s" (tpl $secretName $) -}} +{{- define "keycloak.tls.passwordsSecretName" -}} +{{- if .Values.tls.passwordsSecret -}} + {{- tpl .Values.tls.passwordsSecret . -}} {{- else -}} {{- printf "%s-tls-passwords" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" -}} {{- end -}} {{- end -}} -{{/* -Return the secret containing Keycloak SPI TLS certificates -*/}} -{{- define "keycloak.spiPasswordsSecretName" -}} -{{- $secretName := .Values.spi.passwordsSecret -}} -{{- if $secretName -}} - {{- printf "%s" (tpl $secretName $) -}} -{{- else -}} - {{- printf "%s-spi-passwords" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} - -{{/* -Return true if a TLS secret object should be created -*/}} -{{- define "keycloak.createTlsSecret" -}} -{{- if and .Values.tls.enabled .Values.tls.autoGenerated (not .Values.tls.existingSecret) }} - {{- true -}} -{{- end -}} -{{- end -}} - {{/* Compile all warnings into a single message. */}} @@ -325,7 +247,7 @@ Compile all warnings into a single message. {{/* Validate values of Keycloak - database */}} {{- define "keycloak.validateValues.database" -}} -{{- if and (not .Values.postgresql.enabled) (not .Values.externalDatabase.host) (and (not .Values.externalDatabase.password) (not .Values.externalDatabase.existingSecret)) -}} +{{- if and (not .Values.postgresql.enabled) (not .Values.externalDatabase.host) -}} keycloak: database You disabled the PostgreSQL sub-chart but did not specify an external PostgreSQL host. Either deploy the PostgreSQL sub-chart (--set postgresql.enabled=true), @@ -337,19 +259,19 @@ keycloak: database {{/* Validate values of Keycloak - TLS enabled */}} {{- define "keycloak.validateValues.tls" -}} -{{- if and .Values.tls.enabled (not .Values.tls.autoGenerated) (not .Values.tls.existingSecret) }} +{{- if and .Values.tls.enabled (not .Values.tls.autoGenerated.enabled) (not .Values.tls.existingSecret) }} keycloak: tls.enabled - In order to enable TLS, you also need to provide - an existing secret containing the Keystore and Truststore or - enable auto-generated certificates. + In order to enable TLS, you need to provide a secret with the TLS + certificates (--set tls.existingSecret=FOO) or enable auto-generated + TLS certificates (--set tls.autoGenerated.enabled=true). {{- end -}} {{- end -}} {{/* Validate values of Keycloak - Production mode enabled */}} {{- define "keycloak.validateValues.production" -}} -{{- if and .Values.production (not .Values.tls.enabled) (not (eq .Values.proxy "edge")) (empty .Values.proxyHeaders) -}} +{{- if and .Values.production (not .Values.tls.enabled) (empty .Values.proxyHeaders) -}} keycloak: production - In order to enable Production mode, you also need to enable HTTPS/TLS - using the value 'tls.enabled' and providing an existing secret containing the Keystore and Trustore. + In order to enable Production mode, you also need to enable + HTTPS/TLS (--set tls.enabled=true) or use proxy headers (--set proxyHeaders=FOO). {{- end -}} {{- end -}} diff --git a/charts/keycloak/templates/_init_containers.tpl b/charts/keycloak/templates/_init_containers.tpl new file mode 100644 index 0000000..de23a6d --- /dev/null +++ b/charts/keycloak/templates/_init_containers.tpl @@ -0,0 +1,39 @@ +{{/* +Copyright Broadcom, Inc. All Rights Reserved. +SPDX-License-Identifier: APACHE-2.0 +*/}} + +{{/* +Returns an init-container that copies writable directories to an empty dir volume in order to not break the application functionality +*/}} +{{- define "keycloak.defaultInitContainers.prepareWriteDirs" -}} +- name: prepare-write-dirs + image: {{ template "keycloak.image" . }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- if .Values.defaultInitContainers.prepareWriteDirs.containerSecurityContext.enabled }} + securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.defaultInitContainers.prepareWriteDirs.containerSecurityContext "context" .) | nindent 4 }} + {{- end }} + {{- if .Values.defaultInitContainers.prepareWriteDirs.resources }} + resources: {{- toYaml .Values.defaultInitContainers.prepareWriteDirs.resources | nindent 4 }} + {{- else if ne .Values.defaultInitContainers.prepareWriteDirs.resourcesPreset "none" }} + resources: {{- include "common.resources.preset" (dict "type" .Values.defaultInitContainers.prepareWriteDirs.resourcesPreset) | nindent 4 }} + {{- end }} + command: + - /bin/bash + args: + - -ec + - | + . /opt/bitnami/scripts/liblog.sh + + info "Copying writable dirs to empty dir" + # In order to not break the application functionality we need to make some + # directories writable, so we need to copy it to an empty dir volume + cp -r --preserve=mode,timestamps /opt/bitnami/keycloak/lib/quarkus /emptydir/app-quarkus-dir + cp -r --preserve=mode,timestamps /opt/bitnami/keycloak/data /emptydir/app-data-dir + cp -r --preserve=mode,timestamps /opt/bitnami/keycloak/providers /emptydir/app-providers-dir + cp -r --preserve=mode,timestamps /opt/bitnami/keycloak/themes /emptydir/app-themes-dir + info "Copy operation completed" + volumeMounts: + - name: empty-dir + mountPath: /emptydir +{{- end -}} diff --git a/charts/keycloak/templates/ca-cert.yaml b/charts/keycloak/templates/ca-cert.yaml new file mode 100644 index 0000000..69d5c4a --- /dev/null +++ b/charts/keycloak/templates/ca-cert.yaml @@ -0,0 +1,53 @@ +{{- /* +Copyright Broadcom, Inc. All Rights Reserved. +SPDX-License-Identifier: APACHE-2.0 +*/}} + +{{- if and .Values.tls.enabled .Values.tls.autoGenerated.enabled (eq .Values.tls.autoGenerated.engine "cert-manager") }} +{{- if empty .Values.tls.autoGenerated.certManager.existingIssuer }} +apiVersion: cert-manager.io/v1 +kind: Issuer +metadata: + name: {{ printf "%s-clusterissuer" (include "common.names.fullname" .) }} + namespace: {{ include "common.names.namespace" . | quote }} + labels: {{- include "common.labels.standard" (dict "customLabels" .Values.commonLabels "context" .) | nindent 4 }} + app.kubernetes.io/part-of: keycloak + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" .) | nindent 4 }} + {{- end }} +spec: + selfSigned: {} +--- +{{- end }} +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: {{ printf "%s-ca-crt" (include "common.names.fullname" .) }} + namespace: {{ include "common.names.namespace" . | quote }} + labels: {{- include "common.labels.standard" (dict "customLabels" .Values.commonLabels "context" .) | nindent 4 }} + app.kubernetes.io/part-of: keycloak + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" .) | nindent 4 }} + {{- end }} +spec: + secretName: {{ printf "%s-ca-crt" (include "common.names.fullname" .) }} + commonName: {{ printf "%s-ca" (include "common.names.fullname" .) }} + isCA: true + issuerRef: + name: {{ default (printf "%s-clusterissuer" (include "common.names.fullname" .)) .Values.tls.autoGenerated.certManager.existingIssuer }} + kind: {{ default "Issuer" .Values.tls.autoGenerated.certManager.existingIssuerKind }} +--- +apiVersion: cert-manager.io/v1 +kind: Issuer +metadata: + name: {{ printf "%s-ca-issuer" (include "common.names.fullname" .) }} + namespace: {{ include "common.names.namespace" . | quote }} + labels: {{- include "common.labels.standard" (dict "customLabels" .Values.commonLabels "context" .) | nindent 4 }} + app.kubernetes.io/part-of: keycloak + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" .) | nindent 4 }} + {{- end }} +spec: + ca: + secretName: {{ printf "%s-ca-crt" (include "common.names.fullname" .) }} +{{- end }} diff --git a/charts/keycloak/templates/cert.yaml b/charts/keycloak/templates/cert.yaml new file mode 100644 index 0000000..ebb3877 --- /dev/null +++ b/charts/keycloak/templates/cert.yaml @@ -0,0 +1,44 @@ +{{- /* +Copyright Broadcom, Inc. All Rights Reserved. +SPDX-License-Identifier: APACHE-2.0 +*/}} + +{{- if and .Values.tls.enabled .Values.tls.autoGenerated.enabled (eq .Values.tls.autoGenerated.engine "cert-manager") }} +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: {{ printf "%s-crt" (include "common.names.fullname" .) }} + namespace: {{ include "common.names.namespace" . | quote }} + labels: {{- include "common.labels.standard" (dict "customLabels" .Values.commonLabels "context" .) | nindent 4 }} + app.kubernetes.io/component: keycloak + app.kubernetes.io/part-of: keycloak + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" .) | nindent 4 }} + {{- end }} +spec: + secretName: {{ template "keycloak.tls.secretName" . }} + commonName: {{ printf "%s.%s.svc.%s" (include "common.names.fullname" .) (include "common.names.namespace" .) .Values.clusterDomain }} + issuerRef: + name: {{ printf "%s-ca-issuer" (include "common.names.fullname" .) }} + kind: Issuer + subject: + organizations: + - "Keycloak" + dnsNames: + - '*.{{ include "common.names.namespace" . }}' + - '*.{{ include "common.names.namespace" . }}.svc' + - '*.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }}' + - '*.{{ include "common.names.fullname" . }}' + - '*.{{ include "common.names.fullname" . }}.{{ include "common.names.namespace" . }}' + - '*.{{ include "common.names.fullname" . }}.{{ include "common.names.namespace" . }}.svc' + - '*.{{ include "common.names.fullname" . }}.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }}' + - '*.{{ include "keycloak.headless.serviceName" . }}' + - '*.{{ include "keycloak.headless.serviceName" . }}.{{ include "common.names.namespace" . }}' + - '*.{{ include "keycloak.headless.serviceName" . }}.{{ include "common.names.namespace" . }}.svc' + - '*.{{ include "keycloak.headless.serviceName" . }}.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }}' + privateKey: + algorithm: {{ .Values.tls.autoGenerated.certManager.keyAlgorithm }} + size: {{ int .Values.tls.autoGenerated.certManager.keySize }} + duration: {{ .Values.tls.autoGenerated.certManager.duration }} + renewBefore: {{ .Values.tls.autoGenerated.certManager.renewBefore }} +{{- end }} diff --git a/charts/keycloak/templates/configmap-env-vars.yaml b/charts/keycloak/templates/configmap-env-vars.yaml index f76c163..b663381 100644 --- a/charts/keycloak/templates/configmap-env-vars.yaml +++ b/charts/keycloak/templates/configmap-env-vars.yaml @@ -8,102 +8,78 @@ kind: ConfigMap metadata: name: {{ printf "%s-env-vars" (include "common.names.fullname" .) }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} + labels: {{- include "common.labels.standard" (dict "customLabels" .Values.commonLabels "context" .) | nindent 4 }} app.kubernetes.io/component: keycloak + app.kubernetes.io/part-of: keycloak {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" .) | nindent 4 }} {{- end }} data: + BITNAMI_DEBUG: {{ ternary "true" "false" .Values.image.debug | quote }} + KEYCLOAK_PRODUCTION: {{ ternary "true" "false" .Values.production | quote }} + KC_LOG_LEVEL: {{ .Values.logging.level | quote }} + KC_LOG_CONSOLE_OUTPUT: {{ .Values.logging.output | quote }} KC_BOOTSTRAP_ADMIN_USERNAME: {{ .Values.auth.adminUser | quote }} - KEYCLOAK_HTTP_PORT: {{ .Values.containerPorts.http | quote }} - {{- if and .Values.proxy (empty .Values.proxyHeaders) }} - KEYCLOAK_PROXY_HEADERS: {{ ternary "" "xforwarded" (eq .Values.proxy "passthrough") | quote }} - {{- else }} - KEYCLOAK_PROXY_HEADERS: {{ .Values.proxyHeaders | quote }} + {{- if .Values.usePasswordFiles }} + KC_BOOTSTRAP_ADMIN_PASSWORD_FILE: {{ printf "/opt/bitnami/keycloak/secrets/%s" (include "keycloak.secretKey" .) }} {{- end }} - {{- if and .Values.adminIngress.enabled .Values.adminIngress.hostname }} - KEYCLOAK_HOSTNAME_ADMIN: |- - {{ ternary "https://" "http://" ( or .Values.adminIngress.tls (eq .Values.proxy "edge") (not (empty .Values.proxyHeaders)) ) -}} {{- include "common.tplvalues.render" (dict "value" .Values.adminIngress.hostname "context" $) -}} - {{- if eq .Values.adminIngress.controller "default" }} - {{- include "common.tplvalues.render" (dict "value" .Values.adminIngress.path "context" $) }} - {{- else if eq .Values.adminIngress.controller "gce" }} - {{- $path := .Values.adminIngress.path -}} - {{- if hasSuffix "*" $path -}} - {{- $path = trimSuffix "*" $path -}} - {{- end -}} - {{- include "common.tplvalues.render" (dict "value" $path "context" $) }} - {{- end }} - {{- end }} - {{- if and .Values.ingress.enabled .Values.ingress.hostname }} - KEYCLOAK_HOSTNAME: |- - {{ ternary "https://" "http://" ( or .Values.ingress.tls (eq .Values.proxy "edge") (not (empty .Values.proxyHeaders)) ) -}} {{- include "common.tplvalues.render" (dict "value" .Values.ingress.hostname "context" $) -}} - {{- if eq .Values.ingress.controller "default" }} - {{- include "common.tplvalues.render" (dict "value" .Values.ingress.path "context" $) }} - {{- else if eq .Values.ingress.controller "gce" }} - {{- $path := .Values.ingress.path -}} - {{- if hasSuffix "*" $path -}} - {{- $path = trimSuffix "*" $path -}} - {{- end -}} - {{- include "common.tplvalues.render" (dict "value" $path "context" $) }} - {{- end }} + KC_HTTP_PORT: {{ .Values.containerPorts.http | quote }} + KC_HTTP_MANAGEMENT_PORT: {{ .Values.containerPorts.management | quote }} + KC_HTTP_ENABLED: {{ ternary "true" "false" (or .Values.httpEnabled (not .Values.tls.enabled)) | quote }} + {{- if .Values.proxyHeaders }} + KC_PROXY_HEADERS: {{ .Values.proxyHeaders | quote }} {{- end }} {{- if .Values.ingress.enabled }} - KEYCLOAK_HOSTNAME_STRICT: {{ ternary "true" "false" .Values.ingress.hostnameStrict | quote }} + KC_HOSTNAME_STRICT: {{ ternary "true" "false" .Values.hostnameStrict | quote }} +{{- if .Values.ingress.hostname }} + {{- $path := tpl .Values.ingress.path . }} + {{- if and (eq .Values.ingress.controller "gce") (hasSuffix "*" $path) }} + {{- $path = trimSuffix "*" $path }} {{- end }} - KEYCLOAK_ENABLE_STATISTICS: {{ ternary "true" "false" .Values.metrics.enabled | quote }} - {{- if not .Values.externalDatabase.existingSecretHostKey }} - KEYCLOAK_DATABASE_HOST: {{ include "keycloak.databaseHost" . | quote }} + KC_HOSTNAME: {{ printf "%s://%s%s" (ternary "https" "http" (or .Values.ingress.tls (not (empty .Values.proxyHeaders)))) (tpl .Values.ingress.hostname .) $path | quote }} {{- end }} - {{- if not .Values.externalDatabase.existingSecretPortKey }} - KEYCLOAK_DATABASE_PORT: {{ include "keycloak.databasePort" . }} +{{- end }} + KC_METRICS_ENABLED: {{ ternary "true" "false" .Values.metrics.enabled | quote }} + KC_DB_URL: {{ printf "jdbc:postgresql://%s:%d/%s?currentSchema=%s%s" (include "keycloak.database.host" .) (include "keycloak.database.port" . | int) (include "keycloak.database.name" .) (include "keycloak.database.schema" .) (include "keycloak.database.extraParams" .) | quote }} + KC_DB_SCHEMA: {{ include "keycloak.database.schema" . | quote }} +{{- if .Values.usePasswordFiles }} + KC_DB_PASSWORD_FILE: {{ printf "/opt/bitnami/keycloak/secrets/db-%s" (include "keycloak.database.secretPasswordKey" .) }} + {{- if .Values.externalDatabase.existingSecretUserKey }} + KC_DB_USERNAME_FILE: {{ printf "/opt/bitnami/keycloak/secrets/db-%s" (include "keycloak.database.secretUserKey" .) }} {{- end }} - {{- if not .Values.externalDatabase.existingSecretDatabaseKey }} - KEYCLOAK_DATABASE_NAME: {{ include "keycloak.databaseName" . | quote }} +{{- end }} + {{- if not (and .Values.externalDatabase.existingSecret .Values.externalDatabase.existingSecretUserKey) }} + KC_DB_USERNAME: {{ include "keycloak.database.user" . | quote }} {{- end }} - KEYCLOAK_DATABASE_SCHEMA: {{ include "keycloak.databaseSchema" . }} - {{- if not .Values.externalDatabase.existingSecretUserKey }} - KEYCLOAK_DATABASE_USER: {{ include "keycloak.databaseUser" . | quote }} - {{- end }} - KEYCLOAK_PRODUCTION: {{ ternary "true" "false" .Values.production | quote }} - KEYCLOAK_ENABLE_HTTPS: {{ ternary "true" "false" .Values.tls.enabled | quote }} - {{- if .Values.customCaExistingSecret }} - KC_TRUSTSTORE_PATHS: "/opt/bitnami/keycloak/custom-ca" - {{- end }} - {{- if .Values.tls.enabled }} - KEYCLOAK_HTTPS_PORT: {{ .Values.containerPorts.https | quote }} - KEYCLOAK_HTTPS_USE_PEM: {{ ternary "true" "false" (or .Values.tls.usePem .Values.tls.autoGenerated) | quote }} - {{- if or .Values.tls.usePem .Values.tls.autoGenerated }} - KEYCLOAK_HTTPS_CERTIFICATE_FILE: "/opt/bitnami/keycloak/certs/tls.crt" - KEYCLOAK_HTTPS_CERTIFICATE_KEY_FILE: "/opt/bitnami/keycloak/certs/tls.key" +{{- if .Values.tls.enabled }} + KEYCLOAK_ENABLE_HTTPS: "true" + KC_HTTPS_PORT: {{ .Values.containerPorts.https | quote }} + {{- if or .Values.tls.usePemCerts .Values.tls.autoGenerated.enabled }} + KEYCLOAK_HTTPS_USE_PEM: "true" + KC_HTTPS_CERTIFICATE_FILE: {{ printf "/opt/bitnami/keycloak/certs/%s" (ternary "tls.crt" .Values.tls.certFilename .Values.tls.autoGenerated.enabled) | quote }} + KC_HTTPS_CERTIFICATE_KEY_FILE: {{ printf "/opt/bitnami/keycloak/certs/%s" (ternary "tls.key" .Values.tls.certKeyFilename .Values.tls.autoGenerated.enabled) | quote }} {{- else }} - KEYCLOAK_HTTPS_KEY_STORE_FILE: {{ printf "/opt/bitnami/keycloak/certs/%s" .Values.tls.keystoreFilename | quote }} - KEYCLOAK_HTTPS_TRUST_STORE_FILE: {{ printf "/opt/bitnami/keycloak/certs/%s" .Values.tls.truststoreFilename | quote }} + KC_HTTPS_KEY_STORE_FILE: {{ printf "/opt/bitnami/keycloak/certs/%s" .Values.tls.keystoreFilename | quote }} + KC_HTTPS_TRUST_STORE_FILE: {{ printf "/opt/bitnami/keycloak/certs/%s" .Values.tls.truststoreFilename | quote }} {{- end }} +{{- end }} + {{- if .Values.trustedCertsExistingSecret }} + KC_TRUSTSTORE_PATHS: "/opt/bitnami/keycloak/truststore" {{- end }} - {{- if .Values.spi.existingSecret }} - {{- if .Values.spi.hostnameVerificationPolicy }} - KEYCLOAK_SPI_TRUSTSTORE_FILE_HOSTNAME_VERIFICATION_POLICY: {{ .Values.spi.hostnameVerificationPolicy | quote }} - {{- end }} - KEYCLOAK_SPI_TRUSTSTORE_FILE: {{ printf "/opt/bitnami/keycloak/spi-certs/%s" .Values.spi.truststoreFilename }} - {{- end }} - {{- if .Values.cache.enabled }} - KC_CACHE_TYPE: "ispn" + KC_CACHE: {{ ternary "ispn" "local" .Values.cache.enabled | quote }} +{{- if .Values.cache.enabled }} {{- if .Values.cache.stack }} KC_CACHE_STACK: {{ .Values.cache.stack | quote }} {{- end }} {{- if .Values.cache.configFile }} KC_CACHE_CONFIG_FILE: {{ .Values.cache.configFile | quote }} {{- end }} - {{- if .Values.cache.useHeadlessServiceWithAppVersion }} - JAVA_OPTS_APPEND: {{ printf "-Djgroups.dns.query=%s-headless-ispn-%s.%s.svc.%s" (include "common.names.fullname" .) (replace "." "-" .Chart.AppVersion) (include "common.names.namespace" .) .Values.clusterDomain | quote }} - {{- else }} - JAVA_OPTS_APPEND: {{ printf "-Djgroups.dns.query=%s-headless.%s.svc.%s" (include "common.names.fullname" .) (include "common.names.namespace" .) .Values.clusterDomain | quote }} + JAVA_OPTS_APPEND: {{ printf "-Djgroups.dns.query=%s.%s.svc.%s" (ternary (include "keycloak.headless.ispn.serviceName" .) (include "keycloak.headless.serviceName" .) .Values.cache.useHeadlessServiceWithAppVersion) (include "common.names.namespace" .) .Values.clusterDomain | quote }} +{{- end }} + KC_HTTP_RELATIVE_PATH: {{ .Values.httpRelativePath | quote }} + {{- if .Values.adminRealm }} + KC_SPI_ADMIN_REALM: {{ .Values.adminRealm | quote }} {{- end }} - {{- else }} - KC_CACHE_TYPE: "local" + {{- if .Values.extraStartupArgs }} + KEYCLOAK_EXTRA_ARGS: {{ .Values.extraStartupArgs | quote }} {{- end }} - {{- if .Values.logging }} - KEYCLOAK_LOG_OUTPUT: {{ .Values.logging.output | quote }} - KEYCLOAK_LOG_LEVEL: {{ .Values.logging.level | quote }} - {{- end }} - diff --git a/charts/keycloak/templates/configmap.yaml b/charts/keycloak/templates/configmap.yaml index 12cca41..d0aac78 100644 --- a/charts/keycloak/templates/configmap.yaml +++ b/charts/keycloak/templates/configmap.yaml @@ -3,16 +3,17 @@ Copyright Broadcom, Inc. All Rights Reserved. SPDX-License-Identifier: APACHE-2.0 */}} -{{- if (include "keycloak.createConfigmap" .) }} +{{- if and .Values.configuration (not .Values.existingConfigmap) }} apiVersion: v1 kind: ConfigMap metadata: name: {{ printf "%s-configuration" (include "common.names.fullname" .) }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} + labels: {{- include "common.labels.standard" (dict "customLabels" .Values.commonLabels "context" .) | nindent 4 }} app.kubernetes.io/component: keycloak + app.kubernetes.io/part-of: keycloak {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" .) | nindent 4 }} {{- end }} data: keycloak.conf: |- diff --git a/charts/keycloak/templates/headless-service-ispn.yaml b/charts/keycloak/templates/headless-service-ispn.yaml index c61626d..6093aa1 100644 --- a/charts/keycloak/templates/headless-service-ispn.yaml +++ b/charts/keycloak/templates/headless-service-ispn.yaml @@ -7,37 +7,38 @@ SPDX-License-Identifier: APACHE-2.0 apiVersion: v1 kind: Service metadata: - name: {{ printf "%s-headless-ispn-%s" (include "common.names.fullname" .) (replace "." "-" .Chart.AppVersion) | trunc 63 | trimSuffix "-" }} + name: {{ template "keycloak.headless.ispn.serviceName" . }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} + labels: {{- include "common.labels.standard" (dict "customLabels" .Values.commonLabels "context" .) | nindent 4 }} app.kubernetes.io/component: keycloak + app.kubernetes.io/part-of: keycloak {{- if or .Values.commonAnnotations .Values.service.headless.annotations }} - {{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.service.headless.annotations .Values.commonAnnotations ) "context" . ) }} - annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} + {{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.service.headless.annotations .Values.commonAnnotations) "context" .) }} + annotations: {{- include "common.tplvalues.render" (dict "value" $annotations "context" .) | nindent 4 }} {{- end }} spec: type: ClusterIP clusterIP: None ports: + {{- if .Values.service.http.enabled }} - name: http port: {{ .Values.containerPorts.http }} protocol: TCP targetPort: http + {{- end }} {{- if .Values.tls.enabled }} - name: https port: {{ .Values.containerPorts.https }} protocol: TCP targetPort: https {{- end }} - {{- if .Values.service.extraHeadlessPorts }} - {{- include "common.tplvalues.render" (dict "value" .Values.service.extraHeadlessPorts "context" $) | nindent 4 }} - {{- end }} {{- if .Values.service.headless.extraPorts }} - {{- include "common.tplvalues.render" (dict "value" .Values.service.headless.extraPorts "context" $) | nindent 4 }} + {{- include "common.tplvalues.render" (dict "value" .Values.service.headless.extraPorts "context" .) | nindent 4 }} {{- end }} publishNotReadyAddresses: true - {{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.podLabels .Values.commonLabels ) "context" . ) }} - selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }} + {{- $podLabels := include "common.tplvalues.merge" (dict "values" (list .Values.podLabels .Values.commonLabels) "context" .) }} + selector: {{- include "common.labels.matchLabels" (dict "customLabels" $podLabels "context" .) | nindent 4 }} app.kubernetes.io/component: keycloak - app.kubernetes.io/app-version: {{ .Chart.AppVersion }} + app.kubernetes.io/part-of: keycloak + app.kubernetes.io/app-version: {{ .Chart.AppVersion | quote }} {{- end }} diff --git a/charts/keycloak/templates/headless-service.yaml b/charts/keycloak/templates/headless-service.yaml index c71e9a8..c37ad51 100644 --- a/charts/keycloak/templates/headless-service.yaml +++ b/charts/keycloak/templates/headless-service.yaml @@ -6,35 +6,36 @@ SPDX-License-Identifier: APACHE-2.0 apiVersion: v1 kind: Service metadata: - name: {{ printf "%s-headless" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }} + name: {{ template "keycloak.headless.serviceName" . }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} + labels: {{- include "common.labels.standard" (dict "customLabels" .Values.commonLabels "context" .) | nindent 4 }} app.kubernetes.io/component: keycloak + app.kubernetes.io/part-of: keycloak {{- if or .Values.commonAnnotations .Values.service.headless.annotations }} - {{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.service.headless.annotations .Values.commonAnnotations ) "context" . ) }} - annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} + {{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.service.headless.annotations .Values.commonAnnotations) "context" .) }} + annotations: {{- include "common.tplvalues.render" (dict "value" $annotations "context" .) | nindent 4 }} {{- end }} spec: type: ClusterIP clusterIP: None ports: + {{- if .Values.service.http.enabled }} - name: http port: {{ .Values.containerPorts.http }} protocol: TCP targetPort: http + {{- end }} {{- if .Values.tls.enabled }} - name: https port: {{ .Values.containerPorts.https }} protocol: TCP targetPort: https {{- end }} - {{- if .Values.service.extraHeadlessPorts }} - {{- include "common.tplvalues.render" (dict "value" .Values.service.extraHeadlessPorts "context" $) | nindent 4 }} - {{- end }} {{- if .Values.service.headless.extraPorts }} - {{- include "common.tplvalues.render" (dict "value" .Values.service.headless.extraPorts "context" $) | nindent 4 }} + {{- include "common.tplvalues.render" (dict "value" .Values.service.headless.extraPorts "context" .) | nindent 4 }} {{- end }} publishNotReadyAddresses: true - {{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.podLabels .Values.commonLabels ) "context" . ) }} - selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }} + {{- $podLabels := include "common.tplvalues.merge" (dict "values" (list .Values.podLabels .Values.commonLabels) "context" .) }} + selector: {{- include "common.labels.matchLabels" (dict "customLabels" $podLabels "context" .) | nindent 4 }} app.kubernetes.io/component: keycloak + app.kubernetes.io/part-of: keycloak diff --git a/charts/keycloak/templates/hpa.yaml b/charts/keycloak/templates/hpa.yaml index aaf757d..2889b69 100644 --- a/charts/keycloak/templates/hpa.yaml +++ b/charts/keycloak/templates/hpa.yaml @@ -3,56 +3,57 @@ Copyright Broadcom, Inc. All Rights Reserved. SPDX-License-Identifier: APACHE-2.0 */}} -{{- if .Values.autoscaling.enabled }} -apiVersion: {{ include "common.capabilities.hpa.apiVersion" ( dict "context" $ ) }} +{{- if .Values.autoscaling.hpa.enabled }} +apiVersion: {{ include "common.capabilities.hpa.apiVersion" (dict "context" .) }} kind: HorizontalPodAutoscaler metadata: name: {{ template "common.names.fullname" . }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} + labels: {{- include "common.labels.standard" (dict "customLabels" .Values.commonLabels "context" .) | nindent 4 }} app.kubernetes.io/component: keycloak + app.kubernetes.io/part-of: keycloak {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" .) | nindent 4 }} {{- end }} spec: scaleTargetRef: apiVersion: {{ include "common.capabilities.statefulset.apiVersion" . }} kind: StatefulSet name: {{ template "common.names.fullname" . }} - minReplicas: {{ .Values.autoscaling.minReplicas }} - maxReplicas: {{ .Values.autoscaling.maxReplicas }} + minReplicas: {{ .Values.autoscaling.hpa.minReplicas }} + maxReplicas: {{ .Values.autoscaling.hpa.maxReplicas }} metrics: - {{- if .Values.autoscaling.targetCPU }} + {{- if .Values.autoscaling.hpa.targetCPU }} - type: Resource resource: name: cpu target: type: Utilization - averageUtilization: {{ .Values.autoscaling.targetCPU }} + averageUtilization: {{ .Values.autoscaling.hpa.targetCPU }} {{- end }} - {{- if .Values.autoscaling.targetMemory }} + {{- if .Values.autoscaling.hpa.targetMemory }} - type: Resource resource: name: memory target: type: Utilization - averageUtilization: {{ .Values.autoscaling.targetMemory }} + averageUtilization: {{ .Values.autoscaling.hpa.targetMemory }} {{- end }} - {{- if or .Values.autoscaling.behavior.scaleDown.policies .Values.autoscaling.behavior.scaleUp.policies }} + {{- if or .Values.autoscaling.hpa.behavior.scaleDown.policies .Values.autoscaling.hpa.behavior.scaleUp.policies }} behavior: - {{- if .Values.autoscaling.behavior.scaleDown.policies }} + {{- if .Values.autoscaling.hpa.behavior.scaleDown.policies }} scaleDown: - stabilizationWindowSeconds: {{ .Values.autoscaling.behavior.scaleDown.stabilizationWindowSeconds }} - selectPolicy: {{ .Values.autoscaling.behavior.scaleDown.selectPolicy }} + stabilizationWindowSeconds: {{ .Values.autoscaling.hpa.behavior.scaleDown.stabilizationWindowSeconds }} + selectPolicy: {{ .Values.autoscaling.hpa.behavior.scaleDown.selectPolicy }} policies: - {{- toYaml .Values.autoscaling.behavior.scaleDown.policies | nindent 8 }} + {{- toYaml .Values.autoscaling.hpa.behavior.scaleDown.policies | nindent 8 }} {{- end }} - {{- if .Values.autoscaling.behavior.scaleUp.policies }} + {{- if .Values.autoscaling.hpa.behavior.scaleUp.policies }} scaleUp: - stabilizationWindowSeconds: {{ .Values.autoscaling.behavior.scaleUp.stabilizationWindowSeconds }} - selectPolicy: {{ .Values.autoscaling.behavior.scaleUp.selectPolicy }} + stabilizationWindowSeconds: {{ .Values.autoscaling.hpa.behavior.scaleUp.stabilizationWindowSeconds }} + selectPolicy: {{ .Values.autoscaling.hpa.behavior.scaleUp.selectPolicy }} policies: - {{- toYaml .Values.autoscaling.behavior.scaleUp.policies | nindent 8 }} + {{- toYaml .Values.autoscaling.hpa.behavior.scaleUp.policies | nindent 8 }} {{- end }} {{- end }} {{- end }} diff --git a/charts/keycloak/templates/ingress-tls-secret.yaml b/charts/keycloak/templates/ingress-tls-secret.yaml new file mode 100644 index 0000000..a4701be --- /dev/null +++ b/charts/keycloak/templates/ingress-tls-secret.yaml @@ -0,0 +1,48 @@ +{{- /* +Copyright Broadcom, Inc. All Rights Reserved. +SPDX-License-Identifier: APACHE-2.0 +*/}} + +{{- if .Values.ingress.enabled }} +{{- if .Values.ingress.secrets }} +{{- range .Values.ingress.secrets }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ .name }} + namespace: {{ include "common.names.namespace" $ | quote }} + labels: {{- include "common.labels.standard" (dict "customLabels" $.Values.commonLabels "context" $) | nindent 4 }} + app.kubernetes.io/component: keycloak + app.kubernetes.io/part-of: keycloak + {{- if $.Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" (dict "value" $.Values.commonAnnotations "context" $) | nindent 4 }} + {{- end }} +type: kubernetes.io/tls +data: + tls.crt: {{ .certificate | b64enc }} + tls.key: {{ .key | b64enc }} +--- +{{- end }} +{{- end }} +{{- if and .Values.ingress.tls .Values.ingress.selfSigned }} +{{- $secretName := printf "%s-tls" .Values.ingress.hostname }} +{{- $ca := genCA "keycloak-ca" 365 }} +{{- $cert := genSignedCert (tpl .Values.ingress.hostname .) nil (list (tpl .Values.ingress.hostname .)) 365 $ca }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ $secretName }} + namespace: {{ include "common.names.namespace" . | quote }} + labels: {{- include "common.labels.standard" (dict "customLabels" .Values.commonLabels "context" .) | nindent 4 }} + app.kubernetes.io/component: keycloak + app.kubernetes.io/part-of: keycloak + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" .) | nindent 4 }} + {{- end }} +type: kubernetes.io/tls +data: + tls.crt: {{ include "common.secrets.lookup" (dict "secret" $secretName "key" "tls.crt" "defaultValue" $cert.Cert "context" $) }} + tls.key: {{ include "common.secrets.lookup" (dict "secret" $secretName "key" "tls.key" "defaultValue" $cert.Key "context" $) }} + ca.crt: {{ include "common.secrets.lookup" (dict "secret" $secretName "key" "ca.crt" "defaultValue" $ca.Cert "context" $) }} +{{- end }} +{{- end }} diff --git a/charts/keycloak/templates/ingress.yaml b/charts/keycloak/templates/ingress.yaml index 3fd6046..bc9dde5 100644 --- a/charts/keycloak/templates/ingress.yaml +++ b/charts/keycloak/templates/ingress.yaml @@ -9,16 +9,17 @@ kind: Ingress metadata: name: {{ include "common.names.fullname" . }} namespace: {{ include "common.names.namespace" . | quote }} - {{- $labels := include "common.tplvalues.merge" ( dict "values" ( list .Values.ingress.labels .Values.commonLabels ) "context" . ) }} - labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }} + {{- $labels := include "common.tplvalues.merge" (dict "values" (list .Values.ingress.labels .Values.commonLabels) "context" .) }} + labels: {{- include "common.labels.standard" (dict "customLabels" $labels "context" .) | nindent 4 }} app.kubernetes.io/component: keycloak + app.kubernetes.io/part-of: keycloak {{- if or .Values.ingress.annotations .Values.commonAnnotations }} - {{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.ingress.annotations .Values.commonAnnotations ) "context" . ) }} - annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} + {{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.ingress.annotations .Values.commonAnnotations) "context" .) }} + annotations: {{- include "common.tplvalues.render" (dict "value" $annotations "context" .) | nindent 4 }} {{- end }} spec: {{- if .Values.ingress.ingressClassName }} - ingressClassName: {{ include "common.tplvalues.render" ( dict "value" .Values.ingress.ingressClassName "context" $ ) | quote }} + ingressClassName: {{ tpl .Values.ingress.ingressClassName . | quote }} {{- end }} rules: {{- if .Values.ingress.hostname }} @@ -28,9 +29,9 @@ spec: {{- if .Values.ingress.extraPaths }} {{- toYaml .Values.ingress.extraPaths | nindent 10 }} {{- end }} - - path: {{ include "common.tplvalues.render" ( dict "value" .Values.ingress.path "context" $) }} + - path: {{ tpl .Values.ingress.path . | quote }} pathType: {{ .Values.ingress.pathType }} - backend: {{- include "common.ingress.backend" (dict "serviceName" (include "common.names.fullname" .) "servicePort" .Values.ingress.servicePort "context" $) | nindent 14 }} + backend: {{- include "common.ingress.backend" (dict "serviceName" (include "common.names.fullname" .) "servicePort" .Values.ingress.servicePort "context" .) | nindent 14 }} {{- end }} {{- range .Values.ingress.extraHosts }} - host: {{ (tpl .name $) }} @@ -41,17 +42,17 @@ spec: backend: {{- include "common.ingress.backend" (dict "serviceName" (include "common.names.fullname" $) "servicePort" $.Values.ingress.servicePort "context" $) | nindent 14 }} {{- end }} {{- if .Values.ingress.extraRules }} - {{- include "common.tplvalues.render" (dict "value" .Values.ingress.extraRules "context" $) | nindent 4 }} + {{- include "common.tplvalues.render" (dict "value" .Values.ingress.extraRules "context" .) | nindent 4 }} {{- end }} - {{- if or (and .Values.ingress.tls (or (include "common.ingress.certManagerRequest" ( dict "annotations" .Values.ingress.annotations )) .Values.ingress.selfSigned .Values.ingress.secrets )) .Values.ingress.extraTls }} + {{- if or (and .Values.ingress.tls (or (include "common.ingress.certManagerRequest" (dict "annotations" .Values.ingress.annotations)) .Values.ingress.selfSigned .Values.ingress.secrets)) .Values.ingress.extraTls }} tls: - {{- if and .Values.ingress.tls (or (include "common.ingress.certManagerRequest" ( dict "annotations" .Values.ingress.annotations )) .Values.ingress.secrets .Values.ingress.selfSigned) }} + {{- if and .Values.ingress.tls (or (include "common.ingress.certManagerRequest" (dict "annotations" .Values.ingress.annotations)) .Values.ingress.secrets .Values.ingress.selfSigned) }} - hosts: - {{ (tpl .Values.ingress.hostname .) | quote }} secretName: {{ printf "%s-tls" (tpl .Values.ingress.hostname .) }} {{- end }} {{- if .Values.ingress.extraTls }} - {{- include "common.tplvalues.render" (dict "value" .Values.ingress.extraTls "context" $) | nindent 4 }} + {{- include "common.tplvalues.render" (dict "value" .Values.ingress.extraTls "context" .) | nindent 4 }} {{- end }} {{- end }} {{- end }} diff --git a/charts/keycloak/templates/init-scripts-configmap.yaml b/charts/keycloak/templates/init-scripts-configmap.yaml index a758d40..cff84ec 100644 --- a/charts/keycloak/templates/init-scripts-configmap.yaml +++ b/charts/keycloak/templates/init-scripts-configmap.yaml @@ -9,10 +9,11 @@ kind: ConfigMap metadata: name: {{ printf "%s-init-scripts" (include "common.names.fullname" .) }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} + labels: {{- include "common.labels.standard" (dict "customLabels" .Values.commonLabels "context" .) | nindent 4 }} app.kubernetes.io/component: keycloak + app.kubernetes.io/part-of: keycloak {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" .) | nindent 4 }} {{- end }} data: {{- include "common.tplvalues.render" (dict "value" .Values.initdbScripts "context" .) | nindent 2 }} diff --git a/charts/keycloak/templates/keycloak-config-cli-configmap.yaml b/charts/keycloak/templates/keycloak-config-cli-configmap.yaml index bba17b7..6c92dd8 100644 --- a/charts/keycloak/templates/keycloak-config-cli-configmap.yaml +++ b/charts/keycloak/templates/keycloak-config-cli-configmap.yaml @@ -3,14 +3,18 @@ Copyright Broadcom, Inc. All Rights Reserved. SPDX-License-Identifier: APACHE-2.0 */}} -{{- if (include "keycloak.keycloakConfigCli.createConfigmap" .) }} +{{- if and .Values.keycloakConfigCli.enabled .Values.keycloakConfigCli.configuration (not .Values.keycloakConfigCli.existingConfigmap) -}} apiVersion: v1 kind: ConfigMap metadata: name: {{ include "keycloak.keycloakConfigCli.configmapName" . }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} + labels: {{- include "common.labels.standard" (dict "customLabels" .Values.commonLabels "context" .) | nindent 4 }} app.kubernetes.io/component: keycloak-config-cli + app.kubernetes.io/part-of: keycloak + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" .) | nindent 4 }} + {{- end }} data: {{- range $fileName, $fileContent := .Values.keycloakConfigCli.configuration }} {{- if $fileContent }} diff --git a/charts/keycloak/templates/keycloak-config-cli-job.yaml b/charts/keycloak/templates/keycloak-config-cli-job.yaml index 6939d3d..8b87f2a 100644 --- a/charts/keycloak/templates/keycloak-config-cli-job.yaml +++ b/charts/keycloak/templates/keycloak-config-cli-job.yaml @@ -9,12 +9,12 @@ kind: Job metadata: name: {{ printf "%s-keycloak-config-cli" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} + labels: {{- include "common.labels.standard" (dict "customLabels" .Values.commonLabels "context" .) | nindent 4 }} app.kubernetes.io/component: keycloak-config-cli - {{- if or .Values.keycloakConfigCli.annotations .Values.commonAnnotations }} - {{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.keycloakConfigCli.annotations .Values.commonAnnotations ) "context" . ) }} - annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} - {{- end }} + app.kubernetes.io/part-of: keycloak + {{- $defaultAnnotations := ternary (dict "helm.sh/hook" "post-install,post-upgrade,post-rollback" "helm.sh/hook-delete-policy" "before-hook-creation,hook-succeeded" "helm.sh/hook-weight" "5") (dict) .Values.useHelmHooks }} + {{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.keycloakConfigCli.annotations .Values.commonAnnotations $defaultAnnotations) "context" .) }} + annotations: {{- include "common.tplvalues.render" (dict "value" $annotations "context" .) | nindent 4 }} spec: backoffLimit: {{ .Values.keycloakConfigCli.backoffLimit }} {{- if .Values.keycloakConfigCli.cleanupAfterFinished.enabled }} @@ -22,58 +22,61 @@ spec: {{- end }} template: metadata: - {{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.keycloakConfigCli.podLabels .Values.commonLabels ) "context" . ) }} - labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }} + {{- $podLabels := include "common.tplvalues.merge" (dict "values" (list .Values.keycloakConfigCli.podLabels .Values.commonLabels) "context" .) }} + labels: {{- include "common.labels.standard" (dict "customLabels" $podLabels "context" .) | nindent 8 }} app.kubernetes.io/component: keycloak-config-cli + app.kubernetes.io/part-of: keycloak annotations: - {{- if (include "keycloak.keycloakConfigCli.createConfigmap" .) }} + {{- if and .Values.keycloakConfigCli.configuration (not .Values.keycloakConfigCli.existingConfigmap) }} checksum/configuration: {{ include (print $.Template.BasePath "/keycloak-config-cli-configmap.yaml") . | sha256sum }} {{- end }} {{- if .Values.keycloakConfigCli.podAnnotations }} - {{- include "common.tplvalues.render" (dict "value" .Values.keycloakConfigCli.podAnnotations "context" $) | nindent 8 }} + {{- include "common.tplvalues.render" (dict "value" .Values.keycloakConfigCli.podAnnotations "context" .) | nindent 8 }} {{- end }} spec: + restartPolicy: Never serviceAccountName: {{ template "keycloak.serviceAccountName" . }} {{- include "keycloak.imagePullSecrets" . | nindent 6 }} - restartPolicy: Never {{- if .Values.keycloakConfigCli.podSecurityContext.enabled }} - securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.keycloakConfigCli.podSecurityContext "context" $) | nindent 8 }} + securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.keycloakConfigCli.podSecurityContext "context" .) | nindent 8 }} {{- end }} automountServiceAccountToken: {{ .Values.keycloakConfigCli.automountServiceAccountToken }} {{- if .Values.keycloakConfigCli.hostAliases }} - hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.keycloakConfigCli.hostAliases "context" $) | nindent 8 }} + hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.keycloakConfigCli.hostAliases "context" .) | nindent 8 }} {{- end }} {{- if .Values.keycloakConfigCli.nodeSelector }} - nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.keycloakConfigCli.nodeSelector "context" $) | nindent 8 }} + nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.keycloakConfigCli.nodeSelector "context" .) | nindent 8 }} {{- end }} - {{- if .Values.keycloakConfigCli.podTolerations }} - tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.keycloakConfigCli.podTolerations "context" .) | nindent 8 }} + {{- if .Values.keycloakConfigCli.tolerations }} + tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.keycloakConfigCli.tolerations "context" .) | nindent 8 }} {{- end }} {{- if .Values.keycloakConfigCli.initContainers }} - initContainers: - {{- include "common.tplvalues.render" (dict "value" .Values.keycloakConfigCli.initContainers "context" $) | nindent 8 }} + initContainers: {{- include "common.tplvalues.render" (dict "value" .Values.keycloakConfigCli.initContainers "context" .) | nindent 8 }} {{- end }} containers: - name: keycloak-config-cli image: {{ template "keycloak.keycloakConfigCli.image" . }} imagePullPolicy: {{ .Values.keycloakConfigCli.image.pullPolicy }} - {{- if .Values.keycloakConfigCli.command }} - command: {{- include "common.tplvalues.render" (dict "value" .Values.keycloakConfigCli.command "context" $) | nindent 12 }} - {{- else }} command: + {{- if .Values.keycloakConfigCli.command }} + {{- include "common.tplvalues.render" (dict "value" .Values.keycloakConfigCli.command "context" .) | nindent 12 }} + {{- else }} - java + {{- end }} + args: + {{- if .Values.keycloakConfigCli.args }} + {{- include "common.tplvalues.render" (dict "value" .Values.keycloakConfigCli.args "context" .) | nindent 12 }} + {{- else }} - -jar - /opt/bitnami/keycloak-config-cli/keycloak-config-cli.jar {{- end }} - {{- if .Values.keycloakConfigCli.args }} - args: {{- include "common.tplvalues.render" (dict "value" .Values.keycloakConfigCli.args "context" $) | nindent 12 }} - {{- end }} {{- if .Values.keycloakConfigCli.containerSecurityContext.enabled }} - securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.keycloakConfigCli.containerSecurityContext "context" $) | nindent 12 }} + securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.keycloakConfigCli.containerSecurityContext "context" .) | nindent 12 }} {{- end }} env: + # ref: https://github.com/adorsys/keycloak-config-cli?tab=readme-ov-file#configuration - name: KEYCLOAK_URL - value: {{ printf "http://%s-headless:%d%s" (include "common.names.fullname" .) (.Values.containerPorts.http | int) (.Values.httpRelativePath) }} + value: {{ printf "http://%s:%d%s" (include "keycloak.headless.serviceName" .) (.Values.containerPorts.http | int) (.Values.httpRelativePath) }} - name: KEYCLOAK_USER value: {{ .Values.auth.adminUser | quote }} - name: KEYCLOAK_PASSWORD @@ -92,17 +95,17 @@ spec: value: {{ .Values.keycloakConfigCli.availabilityCheck.timeout }} {{- end }} {{- if .Values.keycloakConfigCli.extraEnvVars }} - {{- include "common.tplvalues.render" (dict "value" .Values.keycloakConfigCli.extraEnvVars "context" $) | nindent 12 }} + {{- include "common.tplvalues.render" (dict "value" .Values.keycloakConfigCli.extraEnvVars "context" .) | nindent 12 }} {{- end }} {{- if or .Values.keycloakConfigCli.extraEnvVarsCM .Values.keycloakConfigCli.extraEnvVarsSecret }} envFrom: {{- if .Values.keycloakConfigCli.extraEnvVarsCM }} - configMapRef: - name: {{ include "common.tplvalues.render" (dict "value" .Values.keycloakConfigCli.extraEnvVarsCM "context" $) }} + name: {{ tpl .Values.keycloakConfigCli.extraEnvVarsCM . }} {{- end }} {{- if .Values.keycloakConfigCli.extraEnvVarsSecret }} - secretRef: - name: {{ include "common.tplvalues.render" (dict "value" .Values.keycloakConfigCli.extraEnvVarsSecret "context" $) }} + name: {{ tpl .Values.keycloakConfigCli.extraEnvVarsSecret . }} {{- end }} {{- end }} {{- if or .Values.keycloakConfigCli.configuration .Values.keycloakConfigCli.existingConfigmap .Values.keycloakConfigCli.extraVolumeMounts }} @@ -115,7 +118,7 @@ spec: mountPath: /config {{- end }} {{- if .Values.keycloakConfigCli.extraVolumeMounts }} - {{- include "common.tplvalues.render" (dict "value" .Values.keycloakConfigCli.extraVolumeMounts "context" $) | nindent 12 }} + {{- include "common.tplvalues.render" (dict "value" .Values.keycloakConfigCli.extraVolumeMounts "context" .) | nindent 12 }} {{- end }} {{- end }} {{- if .Values.keycloakConfigCli.resources }} @@ -124,9 +127,8 @@ spec: resources: {{- include "common.resources.preset" (dict "type" .Values.keycloakConfigCli.resourcesPreset) | nindent 12 }} {{- end }} {{- if .Values.keycloakConfigCli.sidecars }} - {{- include "common.tplvalues.render" ( dict "value" .Values.keycloakConfigCli.sidecars "context" $) | nindent 8 }} + {{- include "common.tplvalues.render" ("value" .Values.keycloakConfigCli.sidecars "context" .) | nindent 8 }} {{- end }} - {{- if or .Values.keycloakConfigCli.configuration .Values.keycloakConfigCli.existingConfigmap .Values.keycloakConfigCli.extraVolumes }} volumes: - name: empty-dir emptyDir: {} @@ -136,7 +138,6 @@ spec: name: {{ include "keycloak.keycloakConfigCli.configmapName" . }} {{- end }} {{- if .Values.keycloakConfigCli.extraVolumes }} - {{- include "common.tplvalues.render" (dict "value" .Values.keycloakConfigCli.extraVolumes "context" $) | nindent 8 }} + {{- include "common.tplvalues.render" (dict "value" .Values.keycloakConfigCli.extraVolumes "context" .) | nindent 8 }} {{- end }} - {{- end }} {{- end }} diff --git a/charts/keycloak/templates/metrics-service.yaml b/charts/keycloak/templates/metrics-service.yaml index 8987b17..0fb025d 100644 --- a/charts/keycloak/templates/metrics-service.yaml +++ b/charts/keycloak/templates/metrics-service.yaml @@ -9,33 +9,25 @@ kind: Service metadata: name: {{ printf "%s-metrics" (include "common.names.fullname" .) }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} + labels: {{- include "common.labels.standard" (dict "customLabels" .Values.commonLabels "context" .) | nindent 4 }} app.kubernetes.io/component: metrics + app.kubernetes.io/part-of: keycloak {{- if or .Values.metrics.service.annotations .Values.commonAnnotations }} - {{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.metrics.service.annotations .Values.commonAnnotations ) "context" . ) }} - annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} + {{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.metrics.service.annotations .Values.commonAnnotations) "context" .) }} + annotations: {{- include "common.tplvalues.render" (dict "value" $annotations "context" .) | nindent 4 }} {{- end }} spec: type: ClusterIP ports: - - name: metrics + - name: tcp-metrics port: {{ .Values.metrics.service.ports.metrics }} protocol: TCP - targetPort: {{ .Values.containerPorts.metrics }} - - name: http - port: {{ .Values.metrics.service.ports.http }} - protocol: TCP - targetPort: {{ .Values.containerPorts.http }} - {{- if .Values.tls.enabled }} - - name: https - port: {{ .Values.metrics.service.ports.https }} - protocol: TCP - targetPort: {{ .Values.containerPorts.https }} - {{- end }} + targetPort: management {{- if .Values.metrics.service.extraPorts }} - {{- include "common.tplvalues.render" (dict "value" .Values.metrics.service.extraPorts "context" $) | nindent 4 }} - {{- end }} - {{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.podLabels .Values.commonLabels ) "context" . ) }} - selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }} + {{- include "common.tplvalues.render" (dict "value" .Values.metrics.service.extraPorts "context" .) | nindent 4 }} + {{- end }} + {{- $podLabels := include "common.tplvalues.merge" (dict "values" (list .Values.podLabels .Values.commonLabels) "context" .) }} + selector: {{- include "common.labels.matchLabels" (dict "customLabels" $podLabels "context" .) | nindent 4 }} app.kubernetes.io/component: keycloak + app.kubernetes.io/part-of: keycloak {{- end }} diff --git a/charts/keycloak/templates/networkpolicy.yaml b/charts/keycloak/templates/networkpolicy.yaml index ffb5828..862ae5e 100644 --- a/charts/keycloak/templates/networkpolicy.yaml +++ b/charts/keycloak/templates/networkpolicy.yaml @@ -9,16 +9,18 @@ apiVersion: {{ include "common.capabilities.networkPolicy.apiVersion" . }} metadata: name: {{ template "common.names.fullname" . }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} + labels: {{- include "common.labels.standard" (dict "customLabels" .Values.commonLabels "context" .) | nindent 4 }} app.kubernetes.io/component: keycloak + app.kubernetes.io/part-of: keycloak {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" .) | nindent 4 }} {{- end }} spec: - {{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.podLabels .Values.commonLabels ) "context" . ) }} + {{- $podLabels := include "common.tplvalues.merge" (dict "values" (list .Values.podLabels .Values.commonLabels) "context" .) }} podSelector: - matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }} + matchLabels: {{- include "common.labels.matchLabels" (dict "customLabels" $podLabels "context" .) | nindent 6 }} app.kubernetes.io/component: keycloak + app.kubernetes.io/part-of: keycloak policyTypes: - Ingress - Egress @@ -38,7 +40,7 @@ spec: {{- end }} # Allow connection to PostgreSQL - ports: - - port: {{ include "keycloak.databasePort" . | trimAll "\"" | int }} + - port: {{ include "keycloak.database.port" . | int }} {{- if .Values.postgresql.enabled }} to: - podSelector: @@ -46,7 +48,7 @@ spec: app.kubernetes.io/name: postgresql app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} - # Allow connection to other keycloak nodes + # Allow connection to other Keycloak nodes - ports: {{- /* Constant in code: https://github.com/keycloak/keycloak/blob/ce8e925c1ad9bf7a3180d1496e181aeea0ab5f8a/operator/src/main/java/org/keycloak/operator/Constants.java#L60 */}} - port: 7800 @@ -56,30 +58,37 @@ spec: {{- end }} to: - podSelector: - matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 14 }} + matchLabels: {{- include "common.labels.matchLabels" (dict "customLabels" .Values.commonLabels "context" .) | nindent 14 }} app.kubernetes.io/component: keycloak + app.kubernetes.io/part-of: keycloak {{- if .Values.networkPolicy.extraEgress }} - {{- include "common.tplvalues.render" ( dict "value" .Values.networkPolicy.extraEgress "context" $ ) | nindent 4 }} + {{- include "common.tplvalues.render" (dict "value" .Values.networkPolicy.extraEgress "context" .) | nindent 4 }} {{- end }} {{- end }} ingress: - ports: - {{- /* Constant in code: https://github.com/keycloak/keycloak/blob/ce8e925c1ad9bf7a3180d1496e181aeea0ab5f8a/operator/src/main/java/org/keycloak/operator/Constants.java#L60 */}} - - port: 7800 - {{- if and (.Values.metrics.enabled) (not (eq (.Values.containerPorts.http | int) (.Values.containerPorts.metrics | int) )) }} - - port: {{ .Values.containerPorts.metrics }} # metrics and health - {{- end }} - port: {{ .Values.containerPorts.http }} {{- if .Values.tls.enabled }} - port: {{ .Values.containerPorts.https }} {{- end }} + {{- if .Values.metrics.enabled }} + - port: {{ .Values.containerPorts.management }} + {{- end }} + {{- /* Constant in code: https://github.com/keycloak/keycloak/blob/ce8e925c1ad9bf7a3180d1496e181aeea0ab5f8a/operator/src/main/java/org/keycloak/operator/Constants.java#L60 */}} + - port: 7800 {{- if not .Values.networkPolicy.allowExternal }} from: - podSelector: - matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 14 }} + matchLabels: {{- include "common.labels.matchLabels" (dict "customLabels" .Values.commonLabels "context" .) | nindent 14 }} + {{- if .Values.networkPolicy.addExternalClientAccess }} - podSelector: matchLabels: {{ template "common.names.fullname" . }}-client: "true" + {{- end }} + {{- if .Values.networkPolicy.ingressPodMatchLabels }} + - podSelector: + matchLabels: {{- include "common.tplvalues.render" (dict "value" .Values.networkPolicy.ingressPodMatchLabels "context" .) | nindent 14 }} + {{- end }} {{- if .Values.networkPolicy.ingressNSMatchLabels }} - namespaceSelector: matchLabels: @@ -95,8 +104,7 @@ spec: {{- end }} {{- end }} {{- end }} - {{- $extraIngress := coalesce .Values.networkPolicy.additionalRules .Values.networkPolicy.extraIngress }} - {{- if $extraIngress }} - {{- include "common.tplvalues.render" ( dict "value" $extraIngress "context" $ ) | nindent 4 }} + {{- if .Values.networkPolicy.extraIngress }} + {{- include "common.tplvalues.render" (dict "value" .Values.networkPolicy.extraIngress "context" .) | nindent 4 }} {{- end }} {{- end }} diff --git a/charts/keycloak/templates/pdb.yaml b/charts/keycloak/templates/pdb.yaml index 653b953..296fafb 100644 --- a/charts/keycloak/templates/pdb.yaml +++ b/charts/keycloak/templates/pdb.yaml @@ -9,20 +9,22 @@ kind: PodDisruptionBudget metadata: name: {{ template "common.names.fullname" . }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} + labels: {{- include "common.labels.standard" (dict "customLabels" .Values.commonLabels "context" .) | nindent 4 }} app.kubernetes.io/component: keycloak + app.kubernetes.io/part-of: keycloak {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" .) | nindent 4 }} {{- end }} spec: {{- if .Values.pdb.minAvailable }} minAvailable: {{ .Values.pdb.minAvailable }} {{- end }} - {{- if or .Values.pdb.maxUnavailable ( not .Values.pdb.minAvailable ) }} + {{- if or .Values.pdb.maxUnavailable (not .Values.pdb.minAvailable) }} maxUnavailable: {{ .Values.pdb.maxUnavailable | default 1 }} {{- end }} - {{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.podLabels .Values.commonLabels ) "context" . ) }} + {{- $podLabels := include "common.tplvalues.merge" (dict "values" (list .Values.podLabels .Values.commonLabels) "context" .) }} selector: - matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }} + matchLabels: {{- include "common.labels.matchLabels" (dict "customLabels" $podLabels "context" .) | nindent 6 }} app.kubernetes.io/component: keycloak + app.kubernetes.io/part-of: keycloak {{- end }} diff --git a/charts/keycloak/templates/prometheusrule.yaml b/charts/keycloak/templates/prometheusrule.yaml index 2792392..4de1780 100644 --- a/charts/keycloak/templates/prometheusrule.yaml +++ b/charts/keycloak/templates/prometheusrule.yaml @@ -3,17 +3,18 @@ Copyright Broadcom, Inc. All Rights Reserved. SPDX-License-Identifier: APACHE-2.0 */}} -{{- if and .Values.metrics.enabled .Values.metrics.prometheusRule.enabled .Values.metrics.prometheusRule.groups}} +{{- if and .Values.metrics.enabled .Values.metrics.prometheusRule.enabled .Values.metrics.prometheusRule.groups }} apiVersion: monitoring.coreos.com/v1 kind: PrometheusRule metadata: name: {{ template "common.names.fullname" . }} namespace: {{ default (include "common.names.namespace" .) .Values.metrics.prometheusRule.namespace }} - {{- $labels := include "common.tplvalues.merge" ( dict "values" ( list .Values.metrics.prometheusRule.labels .Values.commonLabels ) "context" . ) }} - labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }} + {{- $labels := include "common.tplvalues.merge" (dict "values" (list .Values.metrics.prometheusRule.labels .Values.commonLabels) "context" .) }} + labels: {{- include "common.labels.standard" (dict "customLabels" $labels "context" .) | nindent 4 }} app.kubernetes.io/component: keycloak + app.kubernetes.io/part-of: keycloak {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" .) | nindent 4 }} {{- end }} spec: groups: {{- include "common.tplvalues.render" (dict "value" .Values.metrics.prometheusRule.groups "context" .) | nindent 4 }} diff --git a/charts/keycloak/templates/secret-external-db.yaml b/charts/keycloak/templates/secret-external-db.yaml index ca61a5a..242b621 100644 --- a/charts/keycloak/templates/secret-external-db.yaml +++ b/charts/keycloak/templates/secret-external-db.yaml @@ -3,17 +3,19 @@ Copyright Broadcom, Inc. All Rights Reserved. SPDX-License-Identifier: APACHE-2.0 */}} -{{- if and (not .Values.postgresql.enabled) (not .Values.externalDatabase.existingSecret) (not .Values.postgresql.existingSecret) }} +{{- if and (not .Values.postgresql.enabled) (not .Values.externalDatabase.existingSecret) }} apiVersion: v1 kind: Secret metadata: - name: {{ printf "%s-externaldb" (include "common.names.fullname" .) }} + {{- $secretName := printf "%s-externaldb" (include "common.names.fullname" .) }} + name: {{ $secretName }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" (dict "customLabels" .Values.commonLabels "context" $) | nindent 4 }} + labels: {{- include "common.labels.standard" (dict "customLabels" .Values.commonLabels "context" .) | nindent 4 }} + app.kubernetes.io/part-of: keycloak {{- if or .Values.externalDatabase.annotations .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.merge" (dict "values" (list .Values.externalDatabase.annotations .Values.commonAnnotations) "context" $) | nindent 4 }} + annotations: {{- include "common.tplvalues.merge" (dict "values" (list .Values.externalDatabase.annotations .Values.commonAnnotations) "context" .) | nindent 4 }} {{- end }} type: Opaque data: - db-password: {{ include "common.secrets.passwords.manage" (dict "secret" (printf "%s-externaldb" (include "common.names.fullname" .)) "key" "db-password" "length" 10 "providedValues" (list "externalDatabase.password") "context" $) }} + db-password: {{ include "common.secrets.passwords.manage" (dict "secret" $secretName "key" "db-password" "length" 10 "providedValues" (list "externalDatabase.password") "context" .) }} {{- end }} diff --git a/charts/keycloak/templates/secrets.yaml b/charts/keycloak/templates/secrets.yaml index f1b9025..68b1678 100644 --- a/charts/keycloak/templates/secrets.yaml +++ b/charts/keycloak/templates/secrets.yaml @@ -7,14 +7,15 @@ SPDX-License-Identifier: APACHE-2.0 apiVersion: v1 kind: Secret metadata: - name: {{ printf "%s" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }} + name: {{ include "common.names.fullname" . }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" (dict "customLabels" .Values.commonLabels "context" $) | nindent 4 }} + labels: {{- include "common.labels.standard" (dict "customLabels" .Values.commonLabels "context" .) | nindent 4 }} app.kubernetes.io/component: keycloak + app.kubernetes.io/part-of: keycloak {{- if or .Values.auth.annotations .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.merge" (dict "values" (list .Values.auth.annotations .Values.commonAnnotations) "context" $) | nindent 4 }} + annotations: {{- include "common.tplvalues.merge" (dict "values" (list .Values.auth.annotations .Values.commonAnnotations) "context" .) | nindent 4 }} {{- end }} type: Opaque data: - admin-password: {{ include "common.secrets.passwords.manage" (dict "secret" (printf "%s" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-") "key" "admin-password" "length" 10 "providedValues" (list "auth.adminPassword") "context" $) }} + admin-password: {{ include "common.secrets.passwords.manage" (dict "secret" (include "common.names.fullname" .) "key" "admin-password" "length" 10 "providedValues" (list "auth.adminPassword") "context" .) }} {{- end }} diff --git a/charts/keycloak/templates/service.yaml b/charts/keycloak/templates/service.yaml index dec9cb5..1d18072 100644 --- a/charts/keycloak/templates/service.yaml +++ b/charts/keycloak/templates/service.yaml @@ -8,11 +8,12 @@ kind: Service metadata: name: {{ template "common.names.fullname" . }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} + labels: {{- include "common.labels.standard" (dict "customLabels" .Values.commonLabels "context" .) | nindent 4 }} app.kubernetes.io/component: keycloak + app.kubernetes.io/part-of: keycloak {{- if or .Values.service.annotations .Values.commonAnnotations }} - {{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.service.annotations .Values.commonAnnotations ) "context" . ) }} - annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} + {{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.service.annotations .Values.commonAnnotations) "context" .) }} + annotations: {{- include "common.tplvalues.render" (dict "value" $annotations "context" .) | nindent 4 }} {{- end }} spec: type: {{ .Values.service.type }} @@ -32,15 +33,15 @@ spec: sessionAffinity: {{ .Values.service.sessionAffinity }} {{- end }} {{- if .Values.service.sessionAffinityConfig }} - sessionAffinityConfig: {{- include "common.tplvalues.render" (dict "value" .Values.service.sessionAffinityConfig "context" $) | nindent 4 }} + sessionAffinityConfig: {{- include "common.tplvalues.render" (dict "value" .Values.service.sessionAffinityConfig "context" .) | nindent 4 }} {{- end }} ports: {{- if .Values.service.http.enabled }} - name: http - port: {{ coalesce .Values.service.ports.http .Values.service.port }} + port: {{ .Values.service.ports.http }} protocol: TCP targetPort: http - {{- if (and (or (eq .Values.service.type "NodePort") (eq .Values.service.type "LoadBalancer")) (not (empty .Values.service.nodePorts.http))) }} + {{- if and (or (eq .Values.service.type "NodePort") (eq .Values.service.type "LoadBalancer")) (not (empty .Values.service.nodePorts.http)) }} nodePort: {{ .Values.service.nodePorts.http }} {{- else if eq .Values.service.type "ClusterIP" }} nodePort: null @@ -48,18 +49,19 @@ spec: {{- end }} {{- if .Values.tls.enabled }} - name: https - port: {{ coalesce .Values.service.ports.https .Values.service.httpsPort }} + port: {{ .Values.service.ports.https}} protocol: TCP targetPort: https - {{- if (and (or (eq .Values.service.type "NodePort") (eq .Values.service.type "LoadBalancer")) (not (empty .Values.service.nodePorts.https))) }} + {{- if and (or (eq .Values.service.type "NodePort") (eq .Values.service.type "LoadBalancer")) (not (empty .Values.service.nodePorts.https)) }} nodePort: {{ .Values.service.nodePorts.https }} {{- else if eq .Values.service.type "ClusterIP" }} nodePort: null {{- end }} {{- end }} {{- if .Values.service.extraPorts }} - {{- include "common.tplvalues.render" (dict "value" .Values.service.extraPorts "context" $) | nindent 4 }} + {{- include "common.tplvalues.render" (dict "value" .Values.service.extraPorts "context" .) | nindent 4 }} {{- end }} - {{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.podLabels .Values.commonLabels ) "context" . ) }} - selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }} + {{- $podLabels := include "common.tplvalues.merge" (dict "values" (list .Values.podLabels .Values.commonLabels) "context" .) }} + selector: {{- include "common.labels.matchLabels" (dict "customLabels" $podLabels "context" .) | nindent 4 }} app.kubernetes.io/component: keycloak + app.kubernetes.io/part-of: keycloak diff --git a/charts/keycloak/templates/serviceaccount.yaml b/charts/keycloak/templates/serviceaccount.yaml index 467e14b..9518595 100644 --- a/charts/keycloak/templates/serviceaccount.yaml +++ b/charts/keycloak/templates/serviceaccount.yaml @@ -9,14 +9,15 @@ kind: ServiceAccount metadata: name: {{ template "keycloak.serviceAccountName" . }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} + labels: {{- include "common.labels.standard" (dict "customLabels" .Values.commonLabels "context" .) | nindent 4 }} app.kubernetes.io/component: keycloak + app.kubernetes.io/part-of: keycloak {{- if .Values.serviceAccount.extraLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.serviceAccount.extraLabels "context" $) | nindent 4 }} + {{- include "common.tplvalues.render" (dict "value" .Values.serviceAccount.extraLabels "context" .) | nindent 4 }} {{- end }} {{- if or .Values.serviceAccount.annotations .Values.commonAnnotations }} - {{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.serviceAccount.annotations .Values.commonAnnotations ) "context" . ) }} - annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} + {{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.serviceAccount.annotations .Values.commonAnnotations) "context" .) }} + annotations: {{- include "common.tplvalues.render" (dict "value" $annotations "context" .) | nindent 4 }} {{- end }} automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }} {{- end }} diff --git a/charts/keycloak/templates/servicemonitor.yaml b/charts/keycloak/templates/servicemonitor.yaml index a63d53e..87b3906 100644 --- a/charts/keycloak/templates/servicemonitor.yaml +++ b/charts/keycloak/templates/servicemonitor.yaml @@ -9,50 +9,50 @@ kind: ServiceMonitor metadata: name: {{ template "common.names.fullname" . }} namespace: {{ default (include "common.names.namespace" .) .Values.metrics.serviceMonitor.namespace }} - {{- $labels := include "common.tplvalues.merge" ( dict "values" ( list .Values.metrics.serviceMonitor.labels .Values.commonLabels ) "context" . ) }} - labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }} + {{- $labels := include "common.tplvalues.merge" (dict "values" (list .Values.metrics.serviceMonitor.labels .Values.commonLabels) "context" .) }} + labels: {{- include "common.labels.standard" (dict "customLabels" $labels "context" .) | nindent 4 }} app.kubernetes.io/component: keycloak - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + app.kubernetes.io/part-of: keycloak + {{- if or .Values.metrics.serviceMonitor.annotations .Values.commonAnnotations }} + {{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.metrics.serviceMonitor.annotations .Values.commonAnnotations) "context" .) }} + annotations: {{- include "common.tplvalues.render" (dict "value" $annotations "context" .) | nindent 4 }} {{- end }} spec: - {{- if .Values.metrics.serviceMonitor.jobLabel }} - jobLabel: {{ .Values.metrics.serviceMonitor.jobLabel }} - {{- end }} + jobLabel: {{ .Values.metrics.serviceMonitor.jobLabel | quote }} endpoints: - {{- $defaultEndpoint := pick .Values.metrics.serviceMonitor "port" "scheme" "tlsConfig" "interval" "scrapeTimeout" "relabelings" "metricRelabelings" "honorLabels" }} - {{- $endpoints := ternary (.Values.metrics.serviceMonitor.endpoints) (list (dict "path" .Values.metrics.serviceMonitor.path)) (empty .Values.metrics.serviceMonitor.path) }} - {{- range $endpoints }} - {{- $endpoint := merge . $defaultEndpoint }} - - port: {{ $endpoint.port | quote }} - scheme: {{ $endpoint.scheme | quote }} - {{- if $endpoint.tlsConfig }} - tlsConfig: {{- include "common.tplvalues.render" ( dict "value" $endpoint.tlsConfig "context" $) | nindent 8 }} + - port: tcp-metrics + path: "/metrics" + {{- if .Values.tls.enabled }} + scheme: https + {{- if .Values.metrics.serviceMonitor.tlsConfig }} + tlsConfig: {{- include "common.tplvalues.render" (dict "value" .Values.metrics.serviceMonitor.tlsConfig "context" .) | nindent 8 }} + {{- else if .Values.tls.autoGenerated.enabled }} + tlsConfig: + insecureSkipVerify: true {{- end }} - path: {{ include "common.tplvalues.render" ( dict "value" $endpoint.path "context" $) }} - {{- if $endpoint.interval }} - interval: {{ $endpoint.interval }} {{- end }} - {{- if $endpoint.scrapeTimeout }} - scrapeTimeout: {{ $endpoint.scrapeTimeout }} + {{- if .Values.metrics.serviceMonitor.interval }} + interval: {{ .Values.metrics.serviceMonitor.interval }} {{- end }} - {{- if $endpoint.relabelings }} - relabelings: {{- include "common.tplvalues.render" ( dict "value" $endpoint.relabelings "context" $) | nindent 6 }} + {{- if .Values.metrics.serviceMonitor.scrapeTimeout }} + scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }} {{- end }} - {{- if $endpoint.metricRelabelings }} - metricRelabelings: {{- include "common.tplvalues.render" ( dict "value" $endpoint.metricRelabelings "context" $) | nindent 6 }} + {{- if .Values.metrics.serviceMonitor.honorLabels }} + honorLabels: {{ .Values.metrics.serviceMonitor.honorLabels }} {{- end }} - {{- if $endpoint.honorLabels }} - honorLabels: {{ $endpoint.honorLabels }} + {{- if .Values.metrics.serviceMonitor.metricRelabelings }} + metricRelabelings: {{- include "common.tplvalues.render" (dict "value" .Values.metrics.serviceMonitor.metricRelabelings "context" .) | nindent 8 }} + {{- end }} + {{- if .Values.metrics.serviceMonitor.relabelings }} + relabelings: {{- include "common.tplvalues.render" (dict "value" .Values.metrics.serviceMonitor.relabelings "context" .) | nindent 8 }} {{- end }} - {{- end }} namespaceSelector: matchNames: - {{ include "common.names.namespace" . | quote }} selector: - matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 6 }} + matchLabels: {{- include "common.labels.matchLabels" (dict "customLabels" .Values.commonLabels "context" .) | nindent 6 }} {{- if .Values.metrics.serviceMonitor.selector }} - {{- include "common.tplvalues.render" (dict "value" .Values.metrics.serviceMonitor.selector "context" $) | nindent 6 }} + {{- include "common.tplvalues.render" (dict "value" .Values.metrics.serviceMonitor.selector "context" .) | nindent 6 }} {{- end }} app.kubernetes.io/component: metrics {{- end }} diff --git a/charts/keycloak/templates/statefulset.yaml b/charts/keycloak/templates/statefulset.yaml index eb40418..72f12f0 100644 --- a/charts/keycloak/templates/statefulset.yaml +++ b/charts/keycloak/templates/statefulset.yaml @@ -8,27 +8,28 @@ kind: StatefulSet metadata: name: {{ template "common.names.fullname" . }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} + labels: {{- include "common.labels.standard" (dict "customLabels" .Values.commonLabels "context" .) | nindent 4 }} app.kubernetes.io/component: keycloak + app.kubernetes.io/part-of: keycloak {{- if or .Values.statefulsetAnnotations .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.merge" ( dict "values" ( list .Values.statefulsetAnnotations .Values.commonAnnotations ) "context" $ ) | nindent 4 }} + annotations: {{- include "common.tplvalues.merge" (dict "values" (list .Values.statefulsetAnnotations .Values.commonAnnotations) "context" .) | nindent 4 }} {{- end }} spec: - {{- if not .Values.autoscaling.enabled }} + {{- if not .Values.autoscaling.hpa.enabled }} replicas: {{ .Values.replicaCount }} {{- end }} revisionHistoryLimit: {{ .Values.revisionHistoryLimitCount }} podManagementPolicy: {{ .Values.podManagementPolicy }} serviceName: {{ printf "%s-headless" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }} - updateStrategy: - {{- include "common.tplvalues.render" (dict "value" .Values.updateStrategy "context" $ ) | nindent 4 }} + updateStrategy: {{- include "common.tplvalues.render" (dict "value" .Values.updateStrategy "context" .) | nindent 4 }} {{- if .Values.minReadySeconds }} minReadySeconds: {{ .Values.minReadySeconds }} {{- end }} - {{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.podLabels .Values.commonLabels ) "context" . ) }} + {{- $podLabels := include "common.tplvalues.merge" (dict "values" (list .Values.podLabels .Values.commonLabels) "context" .) }} selector: - matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }} + matchLabels: {{- include "common.labels.matchLabels" (dict "customLabels" $podLabels "context" .) | nindent 6 }} app.kubernetes.io/component: keycloak + app.kubernetes.io/part-of: keycloak template: metadata: annotations: @@ -36,32 +37,32 @@ spec: {{- if not .Values.auth.existingSecret }} checksum/secrets: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }} {{- end }} - {{- if (include "keycloak.createConfigmap" .) }} + {{- if and .Values.configuration (not .Values.existingConfigmap) }} checksum/configuration: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} {{- end }} {{- if .Values.podAnnotations }} - {{- include "common.tplvalues.render" (dict "value" .Values.podAnnotations "context" $) | nindent 8 }} + {{- include "common.tplvalues.render" (dict "value" .Values.podAnnotations "context" .) | nindent 8 }} {{- end }} - labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }} + labels: {{- include "common.labels.standard" (dict "customLabels" $podLabels "context" .) | nindent 8 }} app.kubernetes.io/component: keycloak - app.kubernetes.io/app-version: {{ .Chart.AppVersion }} + app.kubernetes.io/part-of: keycloak spec: serviceAccountName: {{ template "keycloak.serviceAccountName" . }} {{- include "keycloak.imagePullSecrets" . | nindent 6 }} automountServiceAccountToken: {{ .Values.automountServiceAccountToken }} {{- if .Values.hostAliases }} - hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.hostAliases "context" $) | nindent 8 }} + hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.hostAliases "context" .) | nindent 8 }} {{- end }} {{- if .Values.affinity }} - affinity: {{- include "common.tplvalues.render" ( dict "value" .Values.affinity "context" $) | nindent 8 }} + affinity: {{- include "common.tplvalues.render" ( dict "value" .Values.affinity "context" .) | nindent 8 }} {{- else }} affinity: - podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "customLabels" $podLabels "context" $) | nindent 10 }} - podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "customLabels" $podLabels "context" $) | nindent 10 }} + podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "component" "keycloak" "customLabels" $podLabels "context" .) | nindent 10 }} + podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "component" "keycloak" "customLabels" $podLabels "context" .) | nindent 10 }} nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values) | nindent 10 }} {{- end }} {{- if .Values.nodeSelector }} - nodeSelector: {{- include "common.tplvalues.render" ( dict "value" .Values.nodeSelector "context" $) | nindent 8 }} + nodeSelector: {{- include "common.tplvalues.render" ( dict "value" .Values.nodeSelector "context" .) | nindent 8 }} {{- end }} {{- if .Values.tolerations }} tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" .) | nindent 8 }} @@ -76,7 +77,7 @@ spec: schedulerName: {{ .Values.schedulerName }} {{- end }} {{- if .Values.podSecurityContext.enabled }} - securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.podSecurityContext "context" $) | nindent 8 }} + securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.podSecurityContext "context" .) | nindent 8 }} {{- end }} {{- if .Values.dnsPolicy }} dnsPolicy: {{ .Values.dnsPolicy }} @@ -88,41 +89,13 @@ spec: {{- if .Values.terminationGracePeriodSeconds }} terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} {{- end }} - {{- if or .Values.enableDefaultInitContainers .Values.initContainers }} + {{- if or .Values.defaultInitContainers.prepareWriteDirs.enabled .Values.initContainers }} initContainers: - {{- if .Values.enableDefaultInitContainers }} - - name: prepare-write-dirs - image: {{ template "keycloak.image" . }} - imagePullPolicy: {{ .Values.image.pullPolicy }} - command: - - /bin/bash - args: - - -ec - - | - . /opt/bitnami/scripts/liblog.sh - - info "Copying writable dirs to empty dir" - # In order to not break the application functionality we need to make some - # directories writable, so we need to copy it to an empty dir volume - cp -r --preserve=mode,timestamps /opt/bitnami/keycloak/lib/quarkus /emptydir/app-quarkus-dir - cp -r --preserve=mode,timestamps /opt/bitnami/keycloak/data /emptydir/app-data-dir - cp -r --preserve=mode,timestamps /opt/bitnami/keycloak/providers /emptydir/app-providers-dir - cp -r --preserve=mode,timestamps /opt/bitnami/keycloak/themes /emptydir/app-themes-dir - info "Copy operation completed" - {{- if .Values.containerSecurityContext.enabled }} - securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.containerSecurityContext "context" $) | nindent 12 }} - {{- end }} - {{- if .Values.resources }} - resources: {{- toYaml .Values.resources | nindent 12 }} - {{- else if ne .Values.resourcesPreset "none" }} - resources: {{- include "common.resources.preset" (dict "type" .Values.resourcesPreset) | nindent 12 }} - {{- end }} - volumeMounts: - - name: empty-dir - mountPath: /emptydir + {{- if .Values.defaultInitContainers.prepareWriteDirs.enabled }} + {{- include "keycloak.defaultInitContainers.prepareWriteDirs" . | nindent 8 }} {{- end }} {{- if .Values.initContainers }} - {{- include "common.tplvalues.render" (dict "value" .Values.initContainers "context" $) | nindent 8 }} + {{- include "common.tplvalues.render" (dict "value" .Values.initContainers "context" .) | nindent 8 }} {{- end }} {{- end }} containers: @@ -130,20 +103,20 @@ spec: image: {{ template "keycloak.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy }} {{- if .Values.lifecycleHooks }} - lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.lifecycleHooks "context" $) | nindent 12 }} + lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.lifecycleHooks "context" .) | nindent 12 }} {{- end }} {{- if .Values.containerSecurityContext.enabled }} - securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.containerSecurityContext "context" $) | nindent 12 }} + securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.containerSecurityContext "context" .) | nindent 12 }} {{- end }} {{- if .Values.diagnosticMode.enabled }} - command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }} + command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" .) | nindent 12 }} {{- else if .Values.command }} - command: {{- include "common.tplvalues.render" (dict "value" .Values.command "context" $) | nindent 12 }} + command: {{- include "common.tplvalues.render" (dict "value" .Values.command "context" .) | nindent 12 }} {{- end }} {{- if .Values.diagnosticMode.enabled }} - args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }} + args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" .) | nindent 12 }} {{- else if .Values.args }} - args: {{- include "common.tplvalues.render" (dict "value" .Values.args "context" $) | nindent 12 }} + args: {{- include "common.tplvalues.render" (dict "value" .Values.args "context" .) | nindent 12 }} {{- end }} env: - name: KUBERNETES_NAMESPACE @@ -151,125 +124,52 @@ spec: fieldRef: apiVersion: v1 fieldPath: metadata.namespace - - name: BITNAMI_DEBUG - value: {{ ternary "true" "false" .Values.image.debug | quote }} - {{- if .Values.usePasswordFiles }} - - name: KC_BOOTSTRAP_ADMIN_PASSWORD_FILE - value: {{ printf "/opt/bitnami/keycloak/secrets/%s" (include "keycloak.secretKey" .) }} - - name: KEYCLOAK_DATABASE_PASSWORD_FILE - value: {{ printf "/opt/bitnami/keycloak/secrets/db-%s" (include "keycloak.databaseSecretPasswordKey" .) }} - {{- if .Values.externalDatabase.existingSecretHostKey }} - - name: KEYCLOAK_DATABASE_HOST_FILE - value: {{ printf "/opt/bitnami/keycloak/secrets/db-%s" (include "keycloak.databaseSecretHostKey" .) }} - {{- end }} - {{- if .Values.externalDatabase.existingSecretPortKey }} - - name: KEYCLOAK_DATABASE_PORT_FILE - value: {{ printf "/opt/bitnami/keycloak/secrets/db-%s" (include "keycloak.databaseSecretPortKey" .) }} - {{- end }} - {{- if .Values.externalDatabase.existingSecretUserKey }} - - name: KEYCLOAK_DATABASE_USER_FILE - value: {{ printf "/opt/bitnami/keycloak/secrets/db-%s" (include "keycloak.databaseSecretUserKey" .) }} - {{- end }} - {{- if .Values.externalDatabase.existingSecretDatabaseKey }} - - name: KEYCLOAK_DATABASE_NAME_FILE - value: {{ printf "/opt/bitnami/keycloak/secrets/db-%s" (include "keycloak.databaseSecretDatabaseKey" .) }} - {{- end }} - {{- if and .Values.tls.enabled (or .Values.tls.keystorePassword .Values.tls.passwordsSecret) }} - - name: KEYCLOAK_HTTPS_KEY_STORE_PASSWORD_FILE - value: "/opt/bitnami/keycloak/secrets/tls-keystore-password" - {{- end }} - {{- if and .Values.tls.enabled (or .Values.tls.truststorePassword .Values.tls.passwordsSecret) }} - - name: KEYCLOAK_HTTPS_TRUST_STORE_PASSWORD_FILE - value: "/opt/bitnami/keycloak/secrets/tls-truststore-password" - {{- end }} - {{- if and .Values.spi.existingSecret (or .Values.spi.truststorePassword .Values.spi.passwordsSecret) }} - - name: KEYCLOAK_SPI_TRUSTSTORE_PASSWORD_FILE - value: "/opt/bitnami/keycloak/secrets/spi-truststore-password" - {{- end }} - {{- else }} + {{- if not .Values.usePasswordFiles }} - name: KC_BOOTSTRAP_ADMIN_PASSWORD valueFrom: secretKeyRef: name: {{ include "keycloak.secretName" . }} key: {{ include "keycloak.secretKey" . }} - - name: KEYCLOAK_DATABASE_PASSWORD + - name: KC_DB_PASSWORD valueFrom: secretKeyRef: - name: {{ include "keycloak.databaseSecretName" . }} - key: {{ include "keycloak.databaseSecretPasswordKey" . }} - {{- if .Values.externalDatabase.existingSecretHostKey }} - - name: KEYCLOAK_DATABASE_HOST - valueFrom: - secretKeyRef: - name: {{ include "keycloak.databaseSecretName" . }} - key: {{ include "keycloak.databaseSecretHostKey" . }} - {{- end }} - {{- if .Values.externalDatabase.existingSecretPortKey }} - - name: KEYCLOAK_DATABASE_PORT - valueFrom: - secretKeyRef: - name: {{ include "keycloak.databaseSecretName" . }} - key: {{ include "keycloak.databaseSecretPortKey" . }} - {{- end }} + name: {{ include "keycloak.database.secretName" . }} + key: {{ include "keycloak.database.secretPasswordKey" . }} {{- if .Values.externalDatabase.existingSecretUserKey }} - - name: KEYCLOAK_DATABASE_USER + - name: KC_DB_USERNAME valueFrom: secretKeyRef: - name: {{ include "keycloak.databaseSecretName" . }} - key: {{ include "keycloak.databaseSecretUserKey" . }} + name: {{ include "keycloak.database.secretName" . }} + key: {{ include "keycloak.database.secretUserKey" . }} {{- end }} - {{- if .Values.externalDatabase.existingSecretDatabaseKey }} - - name: KEYCLOAK_DATABASE_NAME + {{- if and .Values.tls.enabled (not .Values.tls.autoGenerated.enabled) (or .Values.tls.keystorePassword .Values.tls.passwordsSecret) }} + - name: KC_HTTPS_KEY_STORE_PASSWORD valueFrom: secretKeyRef: - name: {{ include "keycloak.databaseSecretName" . }} - key: {{ include "keycloak.databaseSecretDatabaseKey" . }} - {{- end }} - {{- if and .Values.tls.enabled (or .Values.tls.keystorePassword .Values.tls.passwordsSecret) }} - - name: KEYCLOAK_HTTPS_KEY_STORE_PASSWORD - valueFrom: - secretKeyRef: - name: {{ include "keycloak.tlsPasswordsSecretName" . }} + name: {{ include "keycloak.tls.passwordsSecretName" . }} key: "tls-keystore-password" {{- end }} - {{- if and .Values.tls.enabled (or .Values.tls.truststorePassword .Values.tls.passwordsSecret) }} - - name: KEYCLOAK_HTTPS_TRUST_STORE_PASSWORD + {{- if and .Values.tls.enabled (not .Values.tls.autoGenerated.enabled) (or .Values.tls.truststorePassword .Values.tls.passwordsSecret) }} + - name: KC_HTTPS_TRUST_STORE_PASSWORD valueFrom: secretKeyRef: - name: {{ include "keycloak.tlsPasswordsSecretName" . }} + name: {{ include "keycloak.tls.passwordsSecretName" . }} key: "tls-truststore-password" {{- end }} - {{- if and .Values.spi.existingSecret (or .Values.spi.truststorePassword .Values.spi.passwordsSecret) }} - - name: KEYCLOAK_SPI_TRUSTSTORE_PASSWORD - valueFrom: - secretKeyRef: - name: {{ include "keycloak.spiPasswordsSecretName" . }} - key: "spi-truststore-password" - {{- end }} - {{- end }} - - name: KEYCLOAK_HTTP_RELATIVE_PATH - value: {{ .Values.httpRelativePath | quote }} - {{- if .Values.extraStartupArgs }} - - name: KEYCLOAK_EXTRA_ARGS - value: {{ .Values.extraStartupArgs | quote }} - {{- end }} - {{- if .Values.adminRealm }} - - name: KC_SPI_ADMIN_REALM - value: "{{ .Values.adminRealm }}" - {{- end }} + {{- end }} {{- if .Values.extraEnvVars }} - {{- include "common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 12 }} + {{- include "common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" .) | nindent 12 }} {{- end }} envFrom: - configMapRef: name: {{ printf "%s-env-vars" (include "common.names.fullname" .) }} {{- if .Values.extraEnvVarsCM }} - configMapRef: - name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsCM "context" $) }} + name: {{ tpl .Values.extraEnvVarsCM . }} {{- end }} {{- if .Values.extraEnvVarsSecret }} - secretRef: - name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }} + name: {{ tpl .Values.extraEnvVarsSecret . }} {{- end }} {{- if .Values.resources }} resources: {{- toYaml .Values.resources | nindent 12 }} @@ -285,40 +185,42 @@ spec: containerPort: {{ .Values.containerPorts.https }} protocol: TCP {{- end }} - {{- if and (.Values.metrics.enabled) (not (eq (.Values.containerPorts.http | int) (.Values.containerPorts.metrics | int) )) }} - - name: metrics - containerPort: {{ .Values.containerPorts.metrics }} + {{- if .Values.metrics.enabled }} + - name: management + containerPort: {{ .Values.containerPorts.management }} protocol: TCP {{- end}} {{- /* Constant in code: https://github.com/keycloak/keycloak/blob/ce8e925c1ad9bf7a3180d1496e181aeea0ab5f8a/operator/src/main/java/org/keycloak/operator/Constants.java#L60 */}} - name: discovery containerPort: 7800 {{- if .Values.extraContainerPorts }} - {{- include "common.tplvalues.render" (dict "value" .Values.extraContainerPorts "context" $) | nindent 12 }} + {{- include "common.tplvalues.render" (dict "value" .Values.extraContainerPorts "context" .) | nindent 12 }} {{- end }} {{- if not .Values.diagnosticMode.enabled }} {{- if .Values.customStartupProbe }} - startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customStartupProbe "context" $) | nindent 12 }} + startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customStartupProbe "context" .) | nindent 12 }} {{- else if .Values.startupProbe.enabled }} startupProbe: {{- omit .Values.startupProbe "enabled" | toYaml | nindent 12 }} httpGet: path: {{ .Values.httpRelativePath }} - port: http + port: {{ ternary "http" "https" (or .Values.httpEnabled (not .Values.tls.enabled)) }} + scheme: {{ ternary "HTTP" "HTTPS" (or .Values.httpEnabled (not .Values.tls.enabled)) }} {{- end }} {{- if .Values.customLivenessProbe }} - livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customLivenessProbe "context" $) | nindent 12 }} + livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customLivenessProbe "context" .) | nindent 12 }} {{- else if .Values.livenessProbe.enabled }} livenessProbe: {{- omit .Values.livenessProbe "enabled" | toYaml | nindent 12 }} tcpSocket: - port: http + port: {{ ternary "http" "https" (or .Values.httpEnabled (not .Values.tls.enabled)) }} {{- end }} {{- if .Values.customReadinessProbe }} - readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customReadinessProbe "context" $) | nindent 12 }} + readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customReadinessProbe "context" .) | nindent 12 }} {{- else if .Values.readinessProbe.enabled }} readinessProbe: {{- omit .Values.readinessProbe "enabled" | toYaml | nindent 12 }} httpGet: path: {{ .Values.httpRelativePath }}realms/{{ .Values.adminRealm | default "master" }} - port: http + port: {{ ternary "http" "https" (or .Values.httpEnabled (not .Values.tls.enabled)) }} + scheme: {{ ternary "HTTP" "HTTPS" (or .Values.httpEnabled (not .Values.tls.enabled)) }} {{- end }} {{- end }} volumeMounts: @@ -357,14 +259,9 @@ spec: mountPath: /opt/bitnami/keycloak/certs readOnly: true {{- end }} - {{- if .Values.customCaExistingSecret }} - - name: custom-ca - mountPath: /opt/bitnami/keycloak/custom-ca - readOnly: true - {{- end }} - {{- if .Values.spi.existingSecret }} - - name: spi-certificates - mountPath: /opt/bitnami/keycloak/spi-certs + {{- if .Values.trustedCertsExistingSecret }} + - name: truststore + mountPath: /opt/bitnami/keycloak/truststore readOnly: true {{- end }} {{- if or .Values.initdbScriptsConfigMap .Values.initdbScripts }} @@ -372,10 +269,10 @@ spec: mountPath: /docker-entrypoint-initdb.d {{- end }} {{- if .Values.extraVolumeMounts }} - {{- include "common.tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 12 }} + {{- include "common.tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" .) | nindent 12 }} {{- end }} {{- if .Values.sidecars }} - {{- include "common.tplvalues.render" ( dict "value" .Values.sidecars "context" $) | nindent 8 }} + {{- include "common.tplvalues.render" ( dict "value" .Values.sidecars "context" .) | nindent 8 }} {{- end }} volumes: - name: empty-dir @@ -387,33 +284,17 @@ spec: - secret: name: {{ include "keycloak.secretName" . }} - secret: - name: {{ include "keycloak.databaseSecretName" . }} + name: {{ include "keycloak.database.secretName" . }} items: - - key: {{ include "keycloak.databaseSecretPasswordKey" . }} - path: {{ printf "db-%s" (include "keycloak.databaseSecretPasswordKey" .) }} - {{- if .Values.externalDatabase.existingSecretHostKey }} - - key: {{ include "keycloak.databaseSecretHostKey" . }} - path: {{ printf "db-%s" (include "keycloak.databaseSecretHostKey" .) }} - {{- end }} - {{- if .Values.externalDatabase.existingSecretPortKey }} - - key: {{ include "keycloak.databaseSecretPortKey" . }} - path: {{ printf "db-%s" (include "keycloak.databaseSecretPortKey" .) }} - {{- end }} + - key: {{ include "keycloak.database.secretPasswordKey" . }} + path: {{ printf "db-%s" (include "keycloak.database.secretPasswordKey" .) }} {{- if .Values.externalDatabase.existingSecretUserKey }} - - key: {{ include "keycloak.databaseSecretUserKey" . }} - path: {{ printf "db-%s" (include "keycloak.databaseSecretUserKey" .) }} + - key: {{ include "keycloak.database.secretUserKey" . }} + path: {{ printf "db-%s" (include "keycloak.database.secretUserKey" .) }} {{- end }} - {{- if .Values.externalDatabase.existingSecretDatabaseKey }} - - key: {{ include "keycloak.databaseSecretDatabaseKey" . }} - path: {{ printf "db-%s" (include "keycloak.databaseSecretDatabaseKey" .) }} - {{- end }} - {{- if and .Values.tls.enabled (or .Values.tls.keystorePassword .Values.tls.truststorePassword .Values.tls.passwordsSecret) }} + {{- if and .Values.tls.enabled (not .Values.tls.autoGenerated.enabled) (or .Values.tls.keystorePassword .Values.tls.truststorePassword .Values.tls.passwordsSecret) }} - secret: - name: {{ include "keycloak.tlsPasswordsSecretName" . }} - {{- end }} - {{- if and .Values.spi.existingSecret (or .Values.spi.truststorePassword .Values.spi.passwordsSecret) }} - - secret: - name: {{ include "keycloak.spiPasswordsSecretName" . }} + name: {{ include "keycloak.tls.passwordsSecretName" . }} {{- end }} {{- end }} {{- if or .Values.configuration .Values.existingConfigmap }} @@ -424,26 +305,20 @@ spec: {{- if .Values.tls.enabled }} - name: certificates secret: - secretName: {{ include "keycloak.tlsSecretName" . }} + secretName: {{ include "keycloak.tls.secretName" . }} defaultMode: 420 {{- end }} - {{- if .Values.customCaExistingSecret }} - - name: custom-ca + {{- if .Values.trustedCertsExistingSecret }} + - name: truststore secret: - secretName: {{ .Values.customCaExistingSecret }} - defaultMode: 420 - {{- end }} - {{- if .Values.spi.existingSecret }} - - name: spi-certificates - secret: - secretName: {{ .Values.spi.existingSecret }} + secretName: {{ tpl .Values.trustedCertsExistingSecret . }} defaultMode: 420 {{- end }} {{- if or .Values.initdbScriptsConfigMap .Values.initdbScripts }} - name: custom-init-scripts configMap: - name: {{ include "keycloak.initdbScriptsCM" . }} + name: {{ include "keycloak.initdbScripts.configmapName" . }} {{- end }} {{- if .Values.extraVolumes }} - {{- include "common.tplvalues.render" (dict "value" .Values.extraVolumes "context" $) | nindent 8 }} + {{- include "common.tplvalues.render" (dict "value" .Values.extraVolumes "context" .) | nindent 8 }} {{- end }} diff --git a/charts/keycloak/templates/tls-pass-secret.yaml b/charts/keycloak/templates/tls-pass-secret.yaml index cedcab5..491125e 100644 --- a/charts/keycloak/templates/tls-pass-secret.yaml +++ b/charts/keycloak/templates/tls-pass-secret.yaml @@ -3,16 +3,17 @@ Copyright Broadcom, Inc. All Rights Reserved. SPDX-License-Identifier: APACHE-2.0 */}} -{{- if and (or .Values.tls.keystorePassword .Values.tls.truststorePassword) (not .Values.tls.passwordsSecret) }} +{{- if and (not .Values.tls.usePemCerts) (.Values.tls.autoGenerated.enabled) (not .Values.tls.passwordsSecret) (or .Values.tls.keystorePassword .Values.tls.truststorePassword) }} apiVersion: v1 kind: Secret metadata: name: {{ printf "%s-tls-passwords" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} + labels: {{- include "common.labels.standard" (dict "customLabels" .Values.commonLabels "context" .) | nindent 4 }} + app.kubernetes.io/component: keycloak app.kubernetes.io/component: keycloak {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" .) | nindent 4 }} {{- end }} type: Opaque data: @@ -22,22 +23,4 @@ data: {{- if .Values.tls.truststorePassword }} tls-truststore-password: {{ .Values.tls.truststorePassword | b64enc | quote }} {{- end }} ---- -{{- end }} -{{- if and .Values.spi.truststorePassword (not .Values.spi.passwordsSecret) }} -apiVersion: v1 -kind: Secret -metadata: - name: {{ printf "%s-spi-passwords" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }} - namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} - app.kubernetes.io/component: keycloak - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -type: Opaque -data: - {{- if .Values.spi.truststorePassword }} - spi-truststore-password: {{ .Values.spi.truststorePassword | b64enc | quote }} - {{- end }} {{- end }} diff --git a/charts/keycloak/templates/tls-secret.yaml b/charts/keycloak/templates/tls-secret.yaml index 91e0647..a4bfb37 100644 --- a/charts/keycloak/templates/tls-secret.yaml +++ b/charts/keycloak/templates/tls-secret.yaml @@ -3,69 +3,28 @@ Copyright Broadcom, Inc. All Rights Reserved. SPDX-License-Identifier: APACHE-2.0 */}} -{{- if .Values.ingress.enabled }} -{{- if .Values.ingress.secrets }} -{{- range .Values.ingress.secrets }} -apiVersion: v1 -kind: Secret -metadata: - name: {{ include "common.tplvalues.render" ( dict "value" .name "context" $ ) }} - namespace: {{ include "common.names.namespace" $ | quote }} - labels: {{- include "common.labels.standard" ( dict "customLabels" $.Values.commonLabels "context" $ ) | nindent 4 }} - {{- if $.Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" $.Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -type: kubernetes.io/tls -data: - tls.crt: {{ include "common.tplvalues.render" ( dict "value" .certificate "context" $ ) | b64enc }} - tls.key: {{ include "common.tplvalues.render" ( dict "value" .key "context" $ ) | b64enc }} ---- -{{- end }} -{{- end }} -{{- if and .Values.ingress.tls .Values.ingress.selfSigned }} -{{- $secretName := printf "%s-tls" .Values.ingress.hostname }} -{{- $ca := genCA "keycloak-ca" 365 }} -{{- $cert := genSignedCert (tpl .Values.ingress.hostname .) nil (list (tpl .Values.ingress.hostname .)) 365 $ca }} -apiVersion: v1 -kind: Secret -metadata: - name: {{ $secretName }} - namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -type: kubernetes.io/tls -data: - tls.crt: {{ include "common.secrets.lookup" (dict "secret" $secretName "key" "tls.crt" "defaultValue" $cert.Cert "context" $) }} - tls.key: {{ include "common.secrets.lookup" (dict "secret" $secretName "key" "tls.key" "defaultValue" $cert.Key "context" $) }} - ca.crt: {{ include "common.secrets.lookup" (dict "secret" $secretName "key" "ca.crt" "defaultValue" $ca.Cert "context" $) }} -{{- end }} -{{- end }} -{{- if (include "keycloak.createTlsSecret" $) }} -{{- $secretName := printf "%s-crt" (include "common.names.fullname" .) }} +{{- if and .Values.tls.enabled .Values.tls.autoGenerated.enabled (eq .Values.tls.autoGenerated.engine "helm") -}} {{- $ca := genCA "keycloak-ca" 365 }} {{- $releaseNamespace := include "common.names.namespace" . }} {{- $clusterDomain := .Values.clusterDomain }} ---- +{{- $headlessServiceName := include "keycloak.headless.serviceName" . }} +{{- $serviceName := include "common.names.fullname" . }} +{{- $altNames := list (printf "*.%s.%s.svc.%s" $headlessServiceName $releaseNamespace $clusterDomain) (printf "%s.%s.svc.%s" $headlessServiceName $releaseNamespace $clusterDomain) $headlessServiceName (printf "%s.%s.svc.%s" $serviceName $releaseNamespace $clusterDomain) $serviceName "127.0.0.1" "localhost" }} +{{- $cert := genSignedCert $serviceName nil $altNames 365 $ca }} +{{- $secretName := include "keycloak.tls.secretName" . }} apiVersion: v1 kind: Secret metadata: name: {{ $secretName }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} + labels: {{- include "common.labels.standard" (dict "customLabels" .Values.commonLabels "context" .) | nindent 4 }} app.kubernetes.io/component: keycloak + app.kubernetes.io/part-of: keycloak {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" .) | nindent 4 }} {{- end }} -type: Opaque +type: kubernetes.io/tls data: - {{- $replicaCount := int .Values.replicaCount }} - {{- $svcName := include "common.names.fullname" . }} - {{- $altNames := list (printf "%s.%s.svc.%s" $svcName $releaseNamespace $clusterDomain) (printf "%s.%s" $svcName $releaseNamespace) $svcName }} - {{- $cert := genSignedCert $svcName nil $altNames 365 $ca }} - tls.crt: {{ include "common.secrets.lookup" (dict "secret" $secretName "key" "tls.crt" "defaultValue" $cert.Cert "context" $) }} - tls.key: {{ include "common.secrets.lookup" (dict "secret" $secretName "key" "tls.key" "defaultValue" $cert.Key "context" $) }} - ca.crt: {{ include "common.secrets.lookup" (dict "secret" $secretName "key" "ca.crt" "defaultValue" $ca.Cert "context" $) }} + tls.crt: {{ include "common.secrets.lookup" (dict "secret" $secretName "key" "tls.crt" "defaultValue" $cert.Cert "context" .) }} + tls.key: {{ include "common.secrets.lookup" (dict "secret" $secretName "key" "tls.key" "defaultValue" $cert.Key "context" .) }} {{- end }} - diff --git a/charts/keycloak/templates/vpa.yaml b/charts/keycloak/templates/vpa.yaml new file mode 100644 index 0000000..7105744 --- /dev/null +++ b/charts/keycloak/templates/vpa.yaml @@ -0,0 +1,45 @@ +{{- /* +Copyright Broadcom, Inc. All Rights Reserved. +SPDX-License-Identifier: APACHE-2.0 +*/}} + +{{- if and (include "common.capabilities.apiVersions.has" (dict "version" "autoscaling.k8s.io/v1/VerticalPodAutoscaler" "context" .)) .Values.autoscaling.vpa.enabled }} +apiVersion: autoscaling.k8s.io/v1 +kind: VerticalPodAutoscaler +metadata: + name: {{ template "common.names.fullname" . }} + namespace: {{ include "common.names.namespace" . | quote }} + labels: {{- include "common.labels.standard" (dict "customLabels" .Values.commonLabels "context" .) | nindent 4 }} + app.kubernetes.io/component: keycloak + app.kubernetes.io/part-of: keycloak + {{- if or .Values.autoscaling.vpa.annotations .Values.commonAnnotations }} + {{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.autoscaling.vpa.annotations .Values.commonAnnotations) "context" .) }} + annotations: {{- include "common.tplvalues.render" (dict "value" $annotations "context" .) | nindent 4 }} + {{- end }} +spec: + resourcePolicy: + containerPolicies: + - containerName: keycloak + {{- with .Values.autoscaling.vpa.controlledResources }} + controlledResources: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.autoscaling.vpa.maxAllowed }} + maxAllowed: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.autoscaling.vpa.minAllowed }} + minAllowed: + {{- toYaml . | nindent 8 }} + {{- end }} + scaleTargetRef: + apiVersion: {{ include "common.capabilities.statefulset.apiVersion" . }} + kind: StatefulSet + name: {{ template "common.names.fullname" . }} + {{- if .Values.autoscaling.vpa.updatePolicy }} + updatePolicy: + {{- with .Values.autoscaling.vpa.updatePolicy.updateMode }} + updateMode: {{ . }} + {{- end }} + {{- end }} +{{- end }} diff --git a/charts/keycloak/values.yaml b/charts/keycloak/values.yaml index 3990e0b..09fb96d 100644 --- a/charts/keycloak/values.yaml +++ b/charts/keycloak/values.yaml @@ -2,46 +2,44 @@ # SPDX-License-Identifier: APACHE-2.0 ## @section Global parameters -## Global Docker image parameters -## Please, note that this will override the image parameters, including dependencies, configured to use the global value -## Current available global Docker image parameters: imageRegistry, imagePullSecrets and storageClass -## -## @param global.imageRegistry Global Docker image registry -## @param global.imagePullSecrets Global Docker registry secret names as an array -## @param global.defaultStorageClass Global default StorageClass for Persistent Volume(s) -## @param global.storageClass DEPRECATED: use global.defaultStorageClass instead -## global: - imageRegistry: "" - ## E.g. - ## imagePullSecrets: - ## - myRegistryKeySecretName + ## Global Docker image parameters + ## Please, note that this will override the image parameters, including dependencies, configured to use the global value + ## @param global.imageRegistry Global Docker Image registry + ## @param global.imagePullSecrets Global Docker registry secret names as an array ## + imageRegistry: "" imagePullSecrets: [] + ## @param global.defaultStorageClass Global default StorageClass for Persistent Volume(s) + ## defaultStorageClass: "" - storageClass: "" ## Security parameters + ## @param global.security.allowInsecureImages Allows skipping image verification ## security: - ## @param global.security.allowInsecureImages Allows skipping image verification allowInsecureImages: false ## Compatibility adaptations for Kubernetes platforms ## compatibility: ## Compatibility adaptations for Openshift + ## @param global.compatibility.openshift.adaptSecurityContext Adapt the securityContext sections of the deployment to make them compatible with Openshift restricted-v2 SCC: remove runAsUser, runAsGroup and fsGroup and let the platform use their allowed default IDs. Possible values: auto (apply if the detected running cluster is Openshift), force (perform the adaptation always), disabled (do not perform adaptation) ## openshift: - ## @param global.compatibility.openshift.adaptSecurityContext Adapt the securityContext sections of the deployment to make them compatible with Openshift restricted-v2 SCC: remove runAsUser, runAsGroup and fsGroup and let the platform use their allowed default IDs. Possible values: auto (apply if the detected running cluster is Openshift), force (perform the adaptation always), disabled (do not perform adaptation) - ## adaptSecurityContext: auto -## @section Common parameters -## + ## @param global.compatibility.omitEmptySeLinuxOptions If set to true, removes the seLinuxOptions from the securityContexts when it is set to an empty object + ## + omitEmptySeLinuxOptions: false -## @param kubeVersion Force target Kubernetes version (using Helm capabilities if not set) +## @section Common parameters + +## @param kubeVersion Override Kubernetes version reported by .Capabilities ## kubeVersion: "" -## @param nameOverride String to partially override common.names.fullname +## @param apiVersions Override Kubernetes API versions reported by .Capabilities +## +apiVersions: [] +## @param nameOverride String to partially override common.names.name ## nameOverride: "" ## @param fullnameOverride String to fully override common.names.fullname @@ -53,49 +51,33 @@ namespaceOverride: "" ## @param commonLabels Labels to add to all deployed objects ## commonLabels: {} -## @param enableServiceLinks If set to false, disable Kubernetes service links in the pod spec -## Ref: https://kubernetes.io/docs/tutorials/services/connect-applications-service/#accessing-the-service -## -enableServiceLinks: true ## @param commonAnnotations Annotations to add to all deployed objects ## commonAnnotations: {} -## @param dnsPolicy DNS Policy for pod -## ref: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/ -## E.g. -## dnsPolicy: ClusterFirst -dnsPolicy: "" -## @param dnsConfig DNS Configuration pod -## ref: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/ -## E.g. -## dnsConfig: -## options: -## - name: ndots -## value: "4" -dnsConfig: {} ## @param clusterDomain Default Kubernetes cluster domain ## clusterDomain: cluster.local ## @param extraDeploy Array of extra objects to deploy with the release ## extraDeploy: [] +## Diagnostic mode +## @param diagnosticMode.enabled Enable diagnostic mode (all probes will be disabled and the command will be overridden) +## @param diagnosticMode.command Command to override all containers in the chart release +## @param diagnosticMode.args Args to override all containers in the chart release +## +diagnosticMode: + enabled: false + command: + - sleep + args: + - infinity +## @param useHelmHooks Enable use of Helm hooks if needed, e.g. on post-install jobs +## +useHelmHooks: true ## @param usePasswordFiles Mount credentials as files instead of using environment variables ## usePasswordFiles: true -## Enable diagnostic mode in the statefulset -## -diagnosticMode: - ## @param diagnosticMode.enabled Enable diagnostic mode (all probes will be disabled and the command will be overridden) - ## - enabled: false - ## @param diagnosticMode.command Command to override all containers in the the statefulset - ## - command: - - sleep - ## @param diagnosticMode.args Args to override all containers in the the statefulset - ## - args: - - infinity + ## @section Keycloak parameters ## Bitnami Keycloak image version @@ -105,28 +87,25 @@ diagnosticMode: ## @skip image.tag Keycloak image tag (immutable tags are recommended) ## @param image.digest Keycloak image digest in the way sha256:aa.... Please note this parameter, if set, will override the tag ## @param image.pullPolicy Keycloak image pull policy -## @param image.pullSecrets Specify docker-registry secret names as an array -## @param image.debug Specify if debug logs should be enabled +## @param image.pullSecrets Keycloak image pull secrets +## @param image.debug Enable Keycloak image debug mode ## image: registry: docker.io repository: bitnami/keycloak - tag: 26.3.2-debian-12-r1 + tag: 26.3.3-debian-12-r0 digest: "" ## Specify a imagePullPolicy ## ref: https://kubernetes.io/docs/concepts/containers/images/#pre-pulled-images ## pullPolicy: IfNotPresent - ## Optionally specify an array of imagePullSecrets. - ## Secrets must be manually created in the namespace. + ## Optionally specify an array of imagePullSecrets (secrets must be manually created in the namespace) ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ - ## Example: + ## e.g: ## pullSecrets: ## - myRegistryKeySecretName ## pullSecrets: [] - ## Set to true if you would like to see extra information on logs - ## debug: false ## Keycloak authentication parameters ## ref: https://github.com/bitnami/containers/tree/main/bitnami/keycloak#admin-credentials @@ -147,98 +126,102 @@ auth: ## @param auth.annotations Additional custom annotations for Keycloak auth secret object ## annotations: {} -## Custom Certificates -## @param customCaExistingSecret Name of the secret containing the Keycloak custom CA certificates. The secret will be mounted as a directory and configured using KC_TRUSTSTORE_PATHS. -## https://www.keycloak.org/server/keycloak-truststore -## Could be created like this: kubectl create secret generic secretName --from-file=./certificateToMerge.pem -customCaExistingSecret: "" +## @param production Run Keycloak in production mode. TLS configuration is required except when using proxy headers +## +production: false ## HTTPS settings -## ref: https://github.com/bitnami/containers/tree/main/bitnami/keycloak#tls-encryption +## +## @param tls.enabled Enable TLS in Keycloak +## @param tls.usePemCerts Use PEM certificates as input instead of PKS12/JKS stores +## @param tls.autoGenerated.enabled Enable automatic generation of TLS certificates +## @param tls.autoGenerated.engine Mechanism to generate the certificates (allowed values: helm, cert-manager) +## @param tls.autoGenerated.certManager.existingIssuer The name of an existing Issuer to use for generating the certificates (only for `cert-manager` engine) +## @param tls.autoGenerated.certManager.existingIssuerKind Existing Issuer kind, defaults to Issuer (only for `cert-manager` engine) +## @param tls.autoGenerated.certManager.keyAlgorithm Key algorithm for the certificates (only for `cert-manager` engine) +## @param tls.autoGenerated.certManager.keySize Key size for the certificates (only for `cert-manager` engine) +## @param tls.autoGenerated.certManager.duration Duration for the certificates (only for `cert-manager` engine) +## @param tls.autoGenerated.certManager.renewBefore Renewal period for the certificates (only for `cert-manager` engine) +## @param tls.existingSecret The name of an existing Secret containing the TLS certificates for Keycloak replicas +## @param tls.certFilename Certificate filename inside the existing secret (when tls.usePemCerts=true and tls.autoGenerated.enabled=false) +## @param tls.certKeyFilename Certificate key filename inside the existing secret (when tls.usePemCerts=true and tls.autoGenerated.enabled=false) +## @param tls.keystoreFilename Keystore filename inside the existing secret +## @param tls.truststoreFilename Truststore filename inside the existing secret +## @param tls.keystorePassword Password to access the keystore when it's password-protected +## @param tls.truststorePassword Password to access the truststore when it's password-protected +## @param tls.passwordsSecret The name of an existing Secret containing the keystore/truststore passwords (expected keys: `tls-keystore-password` and `tls-truststore-password`) ## tls: - ## @param tls.enabled Enable TLS encryption. Required for HTTPs traffic. - ## enabled: false - ## @param tls.autoGenerated Generate automatically self-signed TLS certificates. Currently only supports PEM certificates - ## - autoGenerated: false - ## @param tls.existingSecret Existing secret containing the TLS certificates per Keycloak replica + usePemCerts: false + autoGenerated: + enabled: true + engine: helm + certManager: + existingIssuer: "" + existingIssuerKind: "" + keySize: 2048 + keyAlgorithm: RSA + duration: 2160h + renewBefore: 360h ## Create this secret following the steps below: - ## 1) Generate your truststore and keystore files (more info at https://www.keycloak.org/docs/latest/server_installation/#_setting_up_ssl) - ## 2) Rename your truststore to `keycloak.truststore.jks` or use a different name overwriting the value 'tls.truststoreFilename'. - ## 3) Rename your keystores to `keycloak.keystore.jks` or use a different name overwriting the value 'tls.keystoreFilename'. + ## 1) Generate your truststore and keystore files (more info at https://www.keycloak.org/server/enabletls) + ## 2) Rename your truststore to `keycloak.truststore.jks` + ## 3) Rename your keystores to `keycloak.keystore.jks` ## 4) Run the command below where SECRET_NAME is the name of the secret you want to create: ## kubectl create secret generic SECRET_NAME --from-file=./keycloak.truststore.jks --from-file=./keycloak.keystore.jks - ## NOTE: If usePem enabled, make sure the PEM key and cert are named 'tls.key' and 'tls.crt' respectively. + ## NOTE: If tls.usePemCerts enabled, make sure the PEM key and cert are named 'tls.key' and 'tls.crt' respectively. ## existingSecret: "" - ## @param tls.usePem Use PEM certificates as input instead of PKS12/JKS stores - ## If "true", the Keycloak chart will look for the files tls.key and tls.crt inside the secret provided with 'existingSecret'. - ## - usePem: false - ## @param tls.truststoreFilename Truststore filename inside the existing secret - ## - truststoreFilename: "keycloak.truststore.jks" - ## @param tls.keystoreFilename Keystore filename inside the existing secret - ## + certFilename: "tls.crt" + certKeyFilename: "tls.key" keystoreFilename: "keycloak.keystore.jks" - ## @param tls.keystorePassword Password to access the keystore when it's password-protected - ## + truststoreFilename: "keycloak.truststore.jks" keystorePassword: "" - ## @param tls.truststorePassword Password to access the truststore when it's password-protected - ## truststorePassword: "" - ## @param tls.passwordsSecret Secret containing the Keystore and Truststore passwords. - ## The secret must have "tls-keystore-password" and "tls-truststore-password" keys for the keystore and truststore respectively. - ## passwordsSecret: "" -## SPI TLS settings +## @param trustedCertsExistingSecret Name of the existing Secret containing the trusted certificates to validate communications with external services ## ref: https://www.keycloak.org/server/keycloak-truststore ## -spi: - ## @param spi.existingSecret Existing secret containing the Keycloak truststore for SPI connection over HTTPS/TLS - ## Create this secret following the steps below: - ## 1) Rename your truststore to `keycloak-spi.truststore.jks` or use a different name overwriting the value 'spi.truststoreFilename'. - ## 2) Run the command below where SECRET_NAME is the name of the secret you want to create: - ## kubectl create secret generic SECRET_NAME --from-file=./keycloak-spi.truststore.jks --from-file=./keycloak.keystore.jks - ## - existingSecret: "" - ## @param spi.truststorePassword Password to access the truststore when it's password-protected - ## - truststorePassword: "" - ## @param spi.truststoreFilename Truststore filename inside the existing secret - ## - truststoreFilename: "keycloak-spi.truststore.jks" - ## @param spi.passwordsSecret Secret containing the SPI Truststore passwords. - ## The secret must have "spi-truststore-password" key. - ## - passwordsSecret: "" - ## @param spi.hostnameVerificationPolicy Verify the hostname of the server's certificate. Allowed values: "ANY", "WILDCARD", "STRICT". - ## - hostnameVerificationPolicy: "" +trustedCertsExistingSecret: "" ## @param adminRealm Name of the admin realm ## adminRealm: "master" -## @param production Run Keycloak in production mode. TLS configuration is required except when using proxy=edge. -## -production: false ## @param proxyHeaders Set Keycloak proxy headers ## proxyHeaders: "" -## @param proxy reverse Proxy mode edge, reencrypt, passthrough or none -## DEPRECATED: use proxyHeaders instead -## ref: https://www.keycloak.org/server/reverseproxy +## @param hostnameStrict Disables dynamically resolving the hostname from request headers (ignored if ingress.enabled is false). +## Should always be set to true in production, unless your reverse proxy overwrites the Host header. +## If enabled, the ingress.hostname option needs to be specified. ## -proxy: "" -## @param httpRelativePath Set the path relative to '/' for serving resources. Useful if you are migrating from older version which were using '/auth/' -## ref: https://www.keycloak.org/migration/migrating-to-quarkus#_default_context_path_changed +hostnameStrict: false +## @param httpEnabled Force enabling HTTP endpoint (by default is only enabled if TLS is disabled) +## +httpEnabled: false +## @param httpRelativePath Set the path relative to '/' for serving resources ## httpRelativePath: "/" -## Keycloak Service Discovery settings -## ref: https://github.com/bitnami/containers/tree/main/bitnami/keycloak#cluster-configuration +## Keycloak cache configuration +## ref: https://www.keycloak.org/server/caching +## @param cache.enabled Switch to enable or disable the Keycloak distributed cache for kubernetes. +## NOTE: Set to false to use 'local' cache (only supported when replicaCount=1). +## @param cache.stack Cache stack to use +## @param cache.configFile Path to the file from which cache configuration should be loaded from +## @param cache.useHeadlessServiceWithAppVersion Create a headless service used for ispn containing the app version ## +cache: + enabled: true + stack: jdbc-ping + configFile: "cache-ispn.xml" + useHeadlessServiceWithAppVersion: false +## Keycloak logging configuration +## ref: https://www.keycloak.org/server/logging +## @param logging.output Alternates between the default log output format or json format +## @param logging.level Allowed values as documented: FATAL, ERROR, WARN, INFO, DEBUG, TRACE, ALL, OFF +## +logging: + output: default + level: INFO ## @param configuration Keycloak Configuration. Auto-generated based on other parameters when not specified -## Specify content for keycloak.conf ## NOTE: This will override configuring Keycloak based on environment variables (including those set by the chart) ## The keycloak.conf is auto-generated based on other parameters when this parameter is not specified ## @@ -255,10 +238,6 @@ existingConfigmap: "" ## @param extraStartupArgs Extra default startup args ## extraStartupArgs: "" -## @param enableDefaultInitContainers Deploy default init containers -## Disable this parameter could be helpful for 3rd party images e.g native Keycloak image. -## -enableDefaultInitContainers: true ## @param initdbScripts Dictionary of initdb scripts ## Specify dictionary of scripts to be run at first boot ## ref: https://github.com/bitnami/containers/tree/main/bitnami/keycloak#initializing-a-new-instance @@ -291,28 +270,21 @@ extraEnvVarsCM: "" ## @param extraEnvVarsSecret Name of existing Secret containing extra env vars ## extraEnvVarsSecret: "" -## @section Keycloak statefulset parameters - -## @param replicaCount Number of Keycloak replicas to deploy -## -replicaCount: 1 -## @param revisionHistoryLimitCount Number of controller revisions to keep -## -revisionHistoryLimitCount: 10 ## @param containerPorts.http Keycloak HTTP container port ## @param containerPorts.https Keycloak HTTPS container port -## @param containerPorts.metrics Keycloak metrics container port +## @param containerPorts.management Keycloak management container port ## containerPorts: http: 8080 https: 8443 - metrics: 9000 -## @param extraContainerPorts Optionally specify extra list of additional port-mappings for Keycloak container + management: 9000 +## @param extraContainerPorts Optionally specify extra list of additional ports for Keycloak container +## e.g: +## extraContainerPorts: +## - name: myservice +## containerPort: 9090 ## extraContainerPorts: [] -## @param statefulsetAnnotations Optionally add extra annotations on the statefulset resource -statefulsetAnnotations: {} -## ## Keycloak pods' SecurityContext ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod ## @param podSecurityContext.enabled Enabled Keycloak pods' Security Context @@ -381,7 +353,7 @@ resources: {} ## livenessProbe: enabled: true - initialDelaySeconds: 300 + initialDelaySeconds: 120 periodSeconds: 1 timeoutSeconds: 5 failureThreshold: 3 @@ -400,7 +372,6 @@ readinessProbe: timeoutSeconds: 1 failureThreshold: 3 successThreshold: 1 -## When enabling this, make sure to set initialDelaySeconds to 0 for livenessProbe and readinessProbe ## @param startupProbe.enabled Enable startupProbe on Keycloak containers ## @param startupProbe.initialDelaySeconds Initial delay seconds for startupProbe ## @param startupProbe.periodSeconds Period seconds for startupProbe @@ -413,21 +384,40 @@ startupProbe: initialDelaySeconds: 30 periodSeconds: 5 timeoutSeconds: 1 - failureThreshold: 60 + failureThreshold: 10 successThreshold: 1 ## @param customLivenessProbe Custom Liveness probes for Keycloak ## customLivenessProbe: {} -## @param customReadinessProbe Custom Rediness probes Keycloak +## @param customReadinessProbe Custom Readiness probes Keycloak ## customReadinessProbe: {} ## @param customStartupProbe Custom Startup probes for Keycloak ## customStartupProbe: {} -## @param lifecycleHooks LifecycleHooks to set additional configuration at startup + +## @section Keycloak StatefulSet parameters + +## @param replicaCount Number of Keycloak replicas to deploy ## -lifecycleHooks: {} -## @param automountServiceAccountToken Mount Service Account token in pod +replicaCount: 1 +## @param updateStrategy.type Keycloak StatefulSet type +## ref: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#update-strategies +## +updateStrategy: + ## Can be set to RollingUpdate or OnDelete + ## + type: RollingUpdate +## @param revisionHistoryLimitCount Number of controller revisions to keep +## +revisionHistoryLimitCount: 10 +## @param minReadySeconds How many seconds a pod needs to be ready before killing the next, during update +## +minReadySeconds: 0 +## @param statefulsetAnnotations Optionally add extra annotations on the StatefulSet resource +## +statefulsetAnnotations: {} +## @param automountServiceAccountToken Mount Service Account token in Keycloak pods ## automountServiceAccountToken: true ## @param hostAliases Deployment pod host aliases @@ -485,7 +475,7 @@ tolerations: [] ## Ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/#spread-constraints-for-pods ## topologySpreadConstraints: [] -## @param podManagementPolicy Pod management policy for the Keycloak statefulset +## @param podManagementPolicy Pod management policy for the Keycloak StatefulSet ## podManagementPolicy: Parallel ## @param priorityClassName Keycloak pods' Priority Class Name @@ -500,16 +490,19 @@ schedulerName: "" ## ref: https://kubernetes.io/docs/concepts/workloads/pods/pod/#termination-of-pods ## terminationGracePeriodSeconds: "" -## @param updateStrategy.type Keycloak statefulset strategy type -## @param updateStrategy.rollingUpdate Keycloak statefulset rolling update configuration parameters -## ref: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#update-strategies +## @param lifecycleHooks LifecycleHooks to set additional configuration at startup ## -updateStrategy: - type: RollingUpdate - rollingUpdate: {} -## @param minReadySeconds How many seconds a pod needs to be ready before killing the next, during update +lifecycleHooks: {} +## @param dnsPolicy DNS Policy for pod +## @param dnsConfig DNS Configuration pod +## ref: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/ ## -minReadySeconds: 0 +dnsPolicy: "" +dnsConfig: {} +## @param enableServiceLinks If set to false, disable Kubernetes service links in the pod spec +## Ref: https://kubernetes.io/docs/tutorials/services/connect-applications-service/#accessing-the-service +## +enableServiceLinks: true ## @param extraVolumes Optionally specify extra list of additional volumes for Keycloak pods ## extraVolumes: [] @@ -538,8 +531,8 @@ initContainers: [] ## containerPort: 1234 ## sidecars: [] -## @section Exposure parameters -## + +## @section Traffic Exposure Parameters ## Service configuration ## @@ -557,12 +550,17 @@ service: ports: http: 80 https: 443 - ## @param service.nodePorts [object] Specify the nodePort values for the LoadBalancer and NodePort service types. - ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport + ## Node ports to expose + ## @param service.nodePorts.http Node port for HTTP + ## @param service.nodePorts.https Node port for HTTPS + ## NOTE: choose port between <30000-32767> ## nodePorts: http: "" https: "" + ## @param service.extraPorts Extra port to expose on Keycloak service + ## + extraPorts: [] ## @param service.sessionAffinity Control where client requests go, to the same pod or round-robin ## Values: ClientIP or None ## ref: https://kubernetes.io/docs/concepts/services-networking/service/ @@ -597,13 +595,6 @@ service: ## @param service.annotations Additional custom annotations for Keycloak service ## annotations: {} - ## @param service.extraPorts Extra port to expose on Keycloak service - ## - extraPorts: [] - # DEPRECATED service.extraHeadlessPorts will be removed in a future release, please use service.headless.extraPorts instead - ## @param service.extraHeadlessPorts Extra ports to expose on Keycloak headless service - ## - extraHeadlessPorts: [] ## Headless service properties ## headless: @@ -620,31 +611,25 @@ ingress: ## @param ingress.enabled Enable ingress record generation for Keycloak ## enabled: false - ## @param ingress.ingressClassName IngressClass that will be be used to implement the Ingress (evaluated as template) (Kubernetes 1.18+) - ## This is supported in Kubernetes 1.18+ and required if you have more than one IngressClass marked as the default for your cluster . - ## ref: https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/ - ## - ingressClassName: "" ## @param ingress.pathType Ingress path type ## pathType: ImplementationSpecific ## @param ingress.apiVersion Force Ingress API version (automatically detected if not set) ## apiVersion: "" + ## @param ingress.hostname Default host for the ingress record (evaluated as template) + ## + hostname: keycloak.local + ## @param ingress.ingressClassName IngressClass that will be be used to implement the Ingress (evaluated as template) + ## Required if you have more than one IngressClass marked as the default for your cluster + ## + ingressClassName: "" ## @param ingress.controller The ingress controller type. Currently supports `default` and `gce` ## leave as `default` for most ingress controllers. ## set to `gce` if using the GCE ingress controller ## controller: default - ## @param ingress.hostname Default host for the ingress record (evaluated as template) - ## - hostname: keycloak.local - ## @param ingress.hostnameStrict Disables dynamically resolving the hostname from request headers. - ## Should always be set to true in production, unless your reverse proxy overwrites the Host header. - ## If enabled, the hostname option needs to be specified. - ## - hostnameStrict: false - ## @param ingress.path [string] Default path for the ingress record (evaluated as template) + ## @param ingress.path Default path for the ingress record ## path: "{{ .Values.httpRelativePath }}" ## @param ingress.servicePort Backend service port to use @@ -730,118 +715,6 @@ ingress: ## name: http ## extraRules: [] -## Keycloak admin ingress parameters -## ref: https://kubernetes.io/docs/user-guide/ingress/ -## -adminIngress: - ## @param adminIngress.enabled Enable admin ingress record generation for Keycloak - ## - enabled: false - ## @param adminIngress.ingressClassName IngressClass that will be be used to implement the Ingress (evaluated as template) (Kubernetes 1.18+) - ## This is supported in Kubernetes 1.18+ and required if you have more than one IngressClass marked as the default for your cluster . - ## ref: https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/ - ## - ingressClassName: "" - ## @param adminIngress.pathType Ingress path type - ## - pathType: ImplementationSpecific - ## @param adminIngress.apiVersion Force Ingress API version (automatically detected if not set) - ## - apiVersion: "" - ## @param adminIngress.controller The ingress controller type. Currently supports `default` and `gce` - ## leave as `default` for most ingress controllers. - ## set to `gce` if using the GCE ingress controller - ## - controller: default - ## @param adminIngress.hostname Default host for the admin ingress record (evaluated as template) - ## - hostname: keycloak.local - ## @param adminIngress.path [string] Default path for the admin ingress record (evaluated as template) - ## - path: "{{ .Values.httpRelativePath }}" - ## @param adminIngress.servicePort Backend service port to use - ## Default is http. Alternative is https. - ## - servicePort: http - ## @param adminIngress.annotations [object] Additional annotations for the Ingress resource. To enable certificate autogeneration, place here your cert-manager annotations. - ## Use this parameter to set the required annotations for cert-manager, see - ## ref: https://cert-manager.io/docs/usage/ingress/#supported-annotations - ## e.g: - ## annotations: - ## kubernetes.io/ingress.class: nginx - ## cert-manager.io/cluster-issuer: cluster-issuer-name - ## - annotations: {} - ## @param adminIngress.labels Additional labels for the Ingress resource. - ## e.g: - ## labels: - ## app: keycloak - ## - labels: {} - ## @param adminIngress.tls Enable TLS configuration for the host defined at `adminIngress.hostname` parameter - ## TLS certificates will be retrieved from a TLS secret with name: `{{- printf "%s-tls" (tpl .Values.adminIngress.hostname .) }}` - ## You can: - ## - Use the `adminIngress.secrets` parameter to create this TLS secret - ## - Rely on cert-manager to create it by setting the corresponding annotations - ## - Rely on Helm to create self-signed certificates by setting `adminIngress.selfSigned=true` - ## - tls: false - ## @param adminIngress.selfSigned Create a TLS secret for this ingress record using self-signed certificates generated by Helm - ## - selfSigned: false - ## @param adminIngress.extraHosts An array with additional hostname(s) to be covered with the admin ingress record - ## e.g: - ## extraHosts: - ## - name: keycloak.local - ## path: / - ## - extraHosts: [] - ## @param adminIngress.extraPaths Any additional arbitrary paths that may need to be added to the admin ingress under the main host. - ## For example: The ALB ingress controller requires a special rule for handling SSL redirection. - ## extraPaths: - ## - path: /* - ## backend: - ## serviceName: ssl-redirect - ## servicePort: use-annotation - ## - extraPaths: [] - ## @param adminIngress.extraTls The tls configuration for additional hostnames to be covered with this ingress record. - ## see: https://kubernetes.io/docs/concepts/services-networking/ingress/#tls - ## extraTls: - ## - hosts: - ## - keycloak.local - ## secretName: keycloak.local-tls - ## - extraTls: [] - ## @param adminIngress.secrets If you're providing your own certificates, please use this to add the certificates as secrets - ## key and certificate should start with -----BEGIN CERTIFICATE----- or - ## -----BEGIN RSA PRIVATE KEY----- - ## - ## name should line up with a tlsSecret set further up - ## If you're using cert-manager, this is unneeded, as it will create the secret for you if it is not set - ## - ## It is also possible to create and manage the certificates outside of this helm chart - ## Please see README.md for more information - ## e.g: - ## - name: keycloak.local-tls - ## key: - ## certificate: - ## - secrets: [] - ## @param adminIngress.extraRules Additional rules to be covered with this ingress record - ## ref: https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-rules - ## e.g: - ## extraRules: - ## - host: keycloak.local - ## http: - ## path: / - ## backend: - ## service: - ## name: keycloak - ## port: - ## name: http - ## - extraRules: [] ## Network Policy configuration ## ref: https://kubernetes.io/docs/concepts/services-networking/network-policies/ ## @@ -859,6 +732,9 @@ networkPolicy: ## @param networkPolicy.allowExternalEgress Allow the pod to access any range of port and all destinations. ## allowExternalEgress: true + ## @param networkPolicy.addExternalClientAccess Allow access from pods with client label set to "true". Ignored if `networkPolicy.allowExternal` is true. + ## + addExternalClientAccess: true ## @param networkPolicy.kubeAPIServerPorts [array] List of possible endpoints to kube-apiserver (limit to your cluster settings to increase security) ## kubeAPIServerPorts: [443, 6443, 8443] @@ -895,199 +771,190 @@ networkPolicy: ## - frontend ## extraEgress: [] + ## @param networkPolicy.ingressPodMatchLabels [object] Labels to match to allow traffic from other pods. Ignored if `networkPolicy.allowExternal` is true. + ## e.g: + ## ingressPodMatchLabels: + ## my-client: "true" + # + ingressPodMatchLabels: {} ## @param networkPolicy.ingressNSMatchLabels [object] Labels to match to allow traffic from other namespaces ## @param networkPolicy.ingressNSPodMatchLabels [object] Pod labels to match to allow traffic from other namespaces ## ingressNSMatchLabels: {} ingressNSPodMatchLabels: {} -## @section RBAC parameter -## Specifies whether a ServiceAccount should be created + +## @section Other parameters + +## ServiceAccount configuration +## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ ## serviceAccount: - ## @param serviceAccount.create Enable the creation of a ServiceAccount for Keycloak pods + ## @param serviceAccount.create Specifies whether a ServiceAccount should be created ## create: true - ## @param serviceAccount.name Name of the created ServiceAccount - ## If not set and create is true, a name is generated using the fullname template + ## @param serviceAccount.name The name of the ServiceAccount to use. + ## If not set and create is true, a name is generated using the common.names.fullname template ## name: "" - ## @param serviceAccount.automountServiceAccountToken Auto-mount the service account token in the pod - ## - automountServiceAccountToken: false - ## @param serviceAccount.annotations Additional custom annotations for the ServiceAccount + ## @param serviceAccount.annotations Additional Service Account annotations (evaluated as a template) ## annotations: {} - ## @param serviceAccount.extraLabels Additional labels for the ServiceAccount + ## @param serviceAccount.automountServiceAccountToken Automount service account token for the server service account + ## + automountServiceAccountToken: true + ## @param serviceAccount.extraLabels Additional Service Account labels (evaluated as a template) ## extraLabels: {} -## Specifies whether RBAC resources should be created -## -rbac: - ## @param rbac.create Whether to create and use RBAC resources or not - ## - create: false - ## @param rbac.rules Custom RBAC rules - ## Example: - ## rules: - ## - apiGroups: - ## - "" - ## resources: - ## - pods - ## verbs: - ## - get - ## - list - ## - rules: [] -## @section Other parameters -## - ## Keycloak Pod Disruption Budget configuration ## ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/ +## @param pdb.create Enable/disable a Pod Disruption Budget creation +## @param pdb.minAvailable Minimum number/percentage of pods that should remain scheduled +## @param pdb.maxUnavailable Maximum number/percentage of pods that may be made unavailable. Defaults to `1` if both `pdb.minAvailable` and `pdb.maxUnavailable` are empty. ## pdb: - ## @param pdb.create Enable/disable a Pod Disruption Budget creation - ## create: true - ## @param pdb.minAvailable Minimum number/percentage of pods that should remain scheduled - ## minAvailable: "" - ## @param pdb.maxUnavailable Maximum number/percentage of pods that may be made unavailable - ## maxUnavailable: "" ## Keycloak Autoscaling configuration -## ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/ -## @param autoscaling.enabled Enable autoscaling for Keycloak -## @param autoscaling.minReplicas Minimum number of Keycloak replicas -## @param autoscaling.maxReplicas Maximum number of Keycloak replicas -## @param autoscaling.targetCPU Target CPU utilization percentage -## @param autoscaling.targetMemory Target Memory utilization percentage +## ref: https://kubernetes.io/docs/concepts/workloads/autoscaling/ ## autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 11 - targetCPU: "" - targetMemory: "" - ## HPA Scaling Behavior - ## ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#configurable-scaling-behavior + ## @param autoscaling.vpa.enabled Enable VPA for Keycloak pods + ## @param autoscaling.vpa.annotations Annotations for VPA resource + ## @param autoscaling.vpa.controlledResources VPA List of resources that the vertical pod autoscaler can control. Defaults to cpu and memory + ## @param autoscaling.vpa.maxAllowed VPA Max allowed resources for the pod + ## @param autoscaling.vpa.minAllowed VPA Min allowed resources for the pod ## - behavior: - ## HPA behavior when scaling up - ## @param autoscaling.behavior.scaleUp.stabilizationWindowSeconds The number of seconds for which past recommendations should be considered while scaling up - ## @param autoscaling.behavior.scaleUp.selectPolicy The priority of policies that the autoscaler will apply when scaling up - ## @param autoscaling.behavior.scaleUp.policies [array] HPA scaling policies when scaling up - ## e.g: - ## Policy to scale 20% of the pod in 60s - ## - type: Percent - ## value: 20 - ## periodSeconds: 60 + vpa: + enabled: false + annotations: {} + controlledResources: [] + maxAllowed: {} + minAllowed: {} + ## @param autoscaling.vpa.updatePolicy.updateMode Autoscaling update policy + ## Specifies whether recommended updates are applied when a Pod is started and whether recommended updates are applied during the life of a Pod + ## Possible values are "Off", "Initial", "Recreate", and "Auto". ## - scaleUp: - stabilizationWindowSeconds: 120 - selectPolicy: Max - policies: [] - ## HPA behavior when scaling down - ## @param autoscaling.behavior.scaleDown.stabilizationWindowSeconds The number of seconds for which past recommendations should be considered while scaling down - ## @param autoscaling.behavior.scaleDown.selectPolicy The priority of policies that the autoscaler will apply when scaling down - ## @param autoscaling.behavior.scaleDown.policies [array] HPA scaling policies when scaling down - ## e.g: - ## Policy to scale one pod in 300s - ## - type: Pods - ## value: 1 - ## periodSeconds: 300 + updatePolicy: + updateMode: Auto + ## @param autoscaling.hpa.enabled Enable HPA for Keycloak pods + ## @param autoscaling.hpa.minReplicas Minimum number of Keycloak replicas + ## @param autoscaling.hpa.maxReplicas Maximum number of Keycloak replicas + ## @param autoscaling.hpa.targetCPU Target CPU utilization percentage + ## @param autoscaling.hpa.targetMemory Target Memory utilization percentage + ## + hpa: + enabled: false + minReplicas: 1 + maxReplicas: 11 + targetCPU: "" + targetMemory: "" + ## HPA Scaling Behavior + ## ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#configurable-scaling-behavior ## - scaleDown: - stabilizationWindowSeconds: 300 - selectPolicy: Max - policies: - - type: Pods - value: 1 - periodSeconds: 300 -## @section Metrics parameters -## + behavior: + ## HPA behavior when scaling up + ## @param autoscaling.hpa.behavior.scaleUp.stabilizationWindowSeconds The number of seconds for which past recommendations should be considered while scaling up + ## @param autoscaling.hpa.behavior.scaleUp.selectPolicy The priority of policies that the autoscaler will apply when scaling up + ## @param autoscaling.hpa.behavior.scaleUp.policies [array] HPA scaling policies when scaling up + ## e.g: + ## Policy to scale 20% of the pod in 60s + ## - type: Percent + ## value: 20 + ## periodSeconds: 60 + ## + scaleUp: + stabilizationWindowSeconds: 120 + selectPolicy: Max + policies: [] + ## HPA behavior when scaling down + ## @param autoscaling.hpa.behavior.scaleDown.stabilizationWindowSeconds The number of seconds for which past recommendations should be considered while scaling down + ## @param autoscaling.hpa.behavior.scaleDown.selectPolicy The priority of policies that the autoscaler will apply when scaling down + ## @param autoscaling.hpa.behavior.scaleDown.policies [array] HPA scaling policies when scaling down + ## e.g: + ## Policy to scale one pod in 300s + ## - type: Pods + ## value: 1 + ## periodSeconds: 300 + ## + scaleDown: + stabilizationWindowSeconds: 300 + selectPolicy: Max + policies: + - type: Pods + value: 1 + periodSeconds: 300 + +## @section Metrics parameters -## Metrics configuration -## metrics: - ## @param metrics.enabled Enable exposing Keycloak statistics - ## ref: https://github.com/bitnami/containers/tree/main/bitnami/keycloak#enabling-statistics + ## @param metrics.enabled Enable exposing Keycloak metrics + ## ref: https://github.com/bitnami/containers/tree/main/bitnami/keycloak#enabling-metrics ## enabled: false ## Keycloak metrics service parameters ## service: + ## @param metrics.service.ports.metrics Metrics service Metrics port + ## ports: - ## @param metrics.service.ports.http Metrics service HTTP port - ## - http: 8080 - ## @param metrics.service.ports.https Metrics service HTTPS port - ## - https: 8443 - ## @param metrics.service.ports.metrics Metrics service Metrics port - ## metrics: 9000 ## @param metrics.service.annotations [object] Annotations for enabling prometheus to access the metrics endpoints ## annotations: prometheus.io/scrape: "true" prometheus.io/port: "{{ .Values.metrics.service.ports.metrics }}" - ## @param metrics.service.extraPorts [array] Add additional ports to the keycloak metrics service (i.e. admin port 9000) + ## @param metrics.service.extraPorts [array] Add additional ports to the keycloak metrics service ## extraPorts: [] ## Prometheus Operator ServiceMonitor configuration ## serviceMonitor: - ## @param metrics.serviceMonitor.enabled Create ServiceMonitor Resource for scraping metrics using PrometheusOperator + ## @param metrics.serviceMonitor.enabled if `true`, creates a Prometheus Operator ServiceMonitor (also requires `metrics.enabled` to be `true`) ## enabled: false - ## @param metrics.serviceMonitor.port Metrics service HTTP port - ## - port: metrics - ## @param metrics.serviceMonitor.scheme Metrics service scheme - ## - scheme: http - ## @param metrics.serviceMonitor.tlsConfig Metrics service TLS configuration - ## - tlsConfig: {} - ## @param metrics.serviceMonitor.endpoints [array] The endpoint configuration of the ServiceMonitor. Path is mandatory. Port, scheme, tlsConfig, interval, timeout and labellings can be overwritten. - ## - endpoints: - - path: '{{ include "keycloak.httpPath" . }}metrics' - - path: '{{ include "keycloak.httpPath" . }}realms/{{ .Values.adminRealm }}/metrics' - port: http - ## @param metrics.serviceMonitor.path Metrics service HTTP path. Deprecated: Use @param metrics.serviceMonitor.endpoints instead - ## - path: "" - ## @param metrics.serviceMonitor.namespace Namespace which Prometheus is running in + ## @param metrics.serviceMonitor.namespace Namespace in which Prometheus is running ## namespace: "" - ## @param metrics.serviceMonitor.interval Interval at which metrics should be scraped + ## @param metrics.serviceMonitor.annotations Additional custom annotations for the ServiceMonitor ## - interval: 30s - ## @param metrics.serviceMonitor.scrapeTimeout Specify the timeout after which the scrape is ended - ## e.g: - ## scrapeTimeout: 30s - ## - scrapeTimeout: "" - ## @param metrics.serviceMonitor.labels Additional labels that can be used so ServiceMonitor will be discovered by Prometheus + annotations: {} + ## @param metrics.serviceMonitor.labels Extra labels for the ServiceMonitor ## labels: {} - ## @param metrics.serviceMonitor.selector Prometheus instance selector labels - ## ref: https://github.com/bitnami/charts/tree/main/bitnami/prometheus-operator#prometheus-configuration + ## @param metrics.serviceMonitor.jobLabel The name of the label on the target service to use as the job name in Prometheus ## - selector: {} - ## @param metrics.serviceMonitor.relabelings RelabelConfigs to apply to samples before scraping - ## - relabelings: [] - ## @param metrics.serviceMonitor.metricRelabelings MetricRelabelConfigs to apply to samples before ingestion - ## - metricRelabelings: [] + jobLabel: "" ## @param metrics.serviceMonitor.honorLabels honorLabels chooses the metric's labels on collisions with target labels ## honorLabels: false - ## @param metrics.serviceMonitor.jobLabel The name of the label on the target service to use as the job name in prometheus. + ## @param metrics.serviceMonitor.tlsConfig [object] TLS configuration used for scrape endpoints used by Prometheus ## - jobLabel: "" + tlsConfig: {} + ## @param metrics.serviceMonitor.interval Interval at which metrics should be scraped. + ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint + ## e.g: + ## interval: 10s + ## + interval: "" + ## @param metrics.serviceMonitor.scrapeTimeout Timeout after which the scrape is ended + ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint + ## e.g: + ## scrapeTimeout: 10s + ## + scrapeTimeout: "" + ## @param metrics.serviceMonitor.metricRelabelings Specify additional relabeling of metrics + ## + metricRelabelings: [] + ## @param metrics.serviceMonitor.relabelings Specify general relabeling + ## + relabelings: [] + ## @param metrics.serviceMonitor.selector Prometheus instance selector labels + ## ref: https://github.com/bitnami/charts/tree/main/bitnami/prometheus-operator#prometheus-configuration + ## selector: + ## prometheus: my-prometheus + ## + selector: {} ## Prometheus Operator alert rules configuration ## prometheusRule: @@ -1114,6 +981,7 @@ metrics: ## labels: ## severity: critical groups: [] + ## @section keycloak-config-cli parameters ## Configuration for keycloak-config-cli @@ -1150,12 +1018,8 @@ keycloakConfigCli: ## pullSecrets: [] ## @param keycloakConfigCli.annotations [object] Annotations for keycloak-config-cli job - ## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ ## - annotations: - helm.sh/hook: "post-install,post-upgrade,post-rollback" - helm.sh/hook-delete-policy: "hook-succeeded,before-hook-creation" - helm.sh/hook-weight: "5" + annotations: {} ## @param keycloakConfigCli.command Command for running the container (set to default if not set). Use array form ## command: [] @@ -1243,10 +1107,10 @@ keycloakConfigCli: ## nodeSelector: {} ## - ## @param keycloakConfigCli.podTolerations Tolerations for job pod assignment + ## @param keycloakConfigCli.tolerations Tolerations for job pod assignment ## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ ## - podTolerations: [] + tolerations: [] ## keycloak-config-cli availability-check configuration ## ref: https://github.com/adorsys/keycloak-config-cli#Configuration ## @param keycloakConfigCli.availabilityCheck.enabled Whether to wait until Keycloak is available @@ -1322,6 +1186,63 @@ keycloakConfigCli: cleanupAfterFinished: enabled: false seconds: 600 + +## @section Default init container parameters + +## Default init Containers +## +defaultInitContainers: + ## 'prepare-write-dirs' init container + ## Copies writable directories to an empty dir volume in order to not break the application functionality + ## + prepareWriteDirs: + ## @param defaultInitContainers.prepareWriteDirs.enabled Enable init container that copies writable directories to an empty dir + ## + enabled: true + ## Configure "prepare-write-dirs" init-container Security Context + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container + ## @param defaultInitContainers.prepareWriteDirs.containerSecurityContext.enabled Enabled "prepare-write-dirs" init-containers' Security Context + ## @param defaultInitContainers.prepareWriteDirs.containerSecurityContext.seLinuxOptions [object,nullable] Set SELinux options in "prepare-write-dirs" init-containers + ## @param defaultInitContainers.prepareWriteDirs.containerSecurityContext.runAsUser Set runAsUser in "prepare-write-dirs" init-containers' Security Context + ## @param defaultInitContainers.prepareWriteDirs.containerSecurityContext.runAsGroup Set runAsGroup in "prepare-write-dirs" init-containers' Security Context + ## @param defaultInitContainers.prepareWriteDirs.containerSecurityContext.runAsNonRoot Set runAsNonRoot in "prepare-write-dirs" init-containers' Security Context + ## @param defaultInitContainers.prepareWriteDirs.containerSecurityContext.privileged Set privileged in "prepare-write-dirs" init-containers' Security Context + ## @param defaultInitContainers.prepareWriteDirs.containerSecurityContext.readOnlyRootFilesystem Set readOnlyRootFilesystem in "prepare-write-dirs" init-containers' Security Context + ## @param defaultInitContainers.prepareWriteDirs.containerSecurityContext.allowPrivilegeEscalation Set allowPrivilegeEscalation in "prepare-write-dirs" init-containers' Security Context + ## @param defaultInitContainers.prepareWriteDirs.containerSecurityContext.capabilities.drop List of capabilities to be dropped in "prepare-write-dirs" init-containers + ## @param defaultInitContainers.prepareWriteDirs.containerSecurityContext.seccompProfile.type Set seccomp profile in "prepare-write-dirs" init-containers + ## + containerSecurityContext: + enabled: true + seLinuxOptions: {} + runAsUser: 1001 + runAsGroup: 1001 + runAsNonRoot: true + privileged: false + readOnlyRootFilesystem: true + allowPrivilegeEscalation: false + capabilities: + drop: ["ALL"] + seccompProfile: + type: "RuntimeDefault" + ## Keycloak "prepare-write-dirs" init container resource requests and limits + ## ref: http://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ + ## @param defaultInitContainers.prepareWriteDirs.resourcesPreset Set Keycloak "prepare-write-dirs" init container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if defaultInitContainers.prepareWriteDirs.resources is set (defaultInitContainers.prepareWriteDirs.resources is recommended for production). + ## More information: https://github.com/bitnami/charts/blob/main/bitnami/common/templates/_resources.tpl#L15 + ## + resourcesPreset: "nano" + ## @param defaultInitContainers.prepareWriteDirs.resources Set Keycloak "prepare-write-dirs" init container requests and limits for different resources like CPU or memory (essential for production workloads) + ## E.g: + ## resources: + ## requests: + ## cpu: 2 + ## memory: 512Mi + ## limits: + ## cpu: 3 + ## memory: 1024Mi + ## + resources: {} + ## @section Database parameters ## PostgreSQL chart configuration @@ -1355,12 +1276,10 @@ postgresql: ## @param externalDatabase.database Keycloak database name ## @param externalDatabase.schema Keycloak database schema ## @param externalDatabase.existingSecret Name of an existing secret resource containing the database credentials -## @param externalDatabase.existingSecretHostKey Name of an existing secret key containing the database host name -## @param externalDatabase.existingSecretPortKey Name of an existing secret key containing the database port ## @param externalDatabase.existingSecretUserKey Name of an existing secret key containing the database user -## @param externalDatabase.existingSecretDatabaseKey Name of an existing secret key containing the database name ## @param externalDatabase.existingSecretPasswordKey Name of an existing secret key containing the database credentials ## @param externalDatabase.annotations Additional custom annotations for external database secret object +## @param externalDatabase.extraParams Additional JDBC connection parameters appended to the JDBC URL (KC_DB_URL). ## externalDatabase: host: "" @@ -1370,34 +1289,7 @@ externalDatabase: schema: public password: "" existingSecret: "" - existingSecretHostKey: "" - existingSecretPortKey: "" existingSecretUserKey: "" - existingSecretDatabaseKey: "" existingSecretPasswordKey: "" annotations: {} -## @section Keycloak Cache parameters - -## Keycloak cache configuration -## ref: https://www.keycloak.org/server/caching -## @param cache.enabled Switch to enable or disable the keycloak distributed cache for kubernetes. -## NOTE: Set to false to use 'local' cache (only supported when replicaCount=1). -## @param cache.stack Set infinispan cache stack to use, sets KC_CACHE_STACK () -## @param cache.configFile Set infinispan cache stack config filename sets KC_CACHE_CONFIG_FILE () -## @param cache.useHeadlessServiceWithAppVersion Set to true to create the headless service used for ispn containing the app version -## -cache: - enabled: true - stack: kubernetes - configFile: "cache-ispn.xml" - useHeadlessServiceWithAppVersion: false -## @section Keycloak Logging parameters - -## Keycloak logging configuration -## ref: https://www.keycloak.org/server/logging -## @param logging.output Alternates between the default log output format or json format -## @param logging.level Allowed values as documented: FATAL, ERROR, WARN, INFO, DEBUG, TRACE, ALL, OFF -## -logging: - output: default - level: INFO + extraParams: "" \ No newline at end of file