Skip to content

[bitnami/keycloak] Improvements to Keycloak cache handling #32885

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions bitnami/keycloak/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Changelog

## 24.6.6 (2025-05-08)
## 24.6.7 (2025-05-12)

* [bitnami/keycloak] :zap: :arrow_up: Update dependency references ([#33565](https://github.com/bitnami/charts/pull/33565))
* [bitnami/keycloak] Improvements to Keycloak cache handling ([#32885](https://github.com/bitnami/charts/pull/32885))

## <small>24.6.6 (2025-05-08)</small>

* [bitnami/keycloak] :zap: :arrow_up: Update dependency references (#33565) ([e750bc1](https://github.com/bitnami/charts/commit/e750bc1d7f2228c15181e003b6589eff8133d155)), closes [#33565](https://github.com/bitnami/charts/issues/33565)

## <small>24.6.5 (2025-05-06)</small>

Expand Down
2 changes: 1 addition & 1 deletion bitnami/keycloak/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ maintainers:
name: keycloak
sources:
- https://github.com/bitnami/charts/tree/main/bitnami/keycloak
version: 24.6.6
version: 24.6.7
14 changes: 7 additions & 7 deletions bitnami/keycloak/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -686,12 +686,12 @@ As an alternative, you can use of the preset configurations for pod affinity, po

### Keycloak Cache parameters

| Name | Description | Value |
| ---------------------------------------- | ----------------------------------------------------------------------------------- | ------------ |
| `cache.enabled` | Switch to enable or disable the keycloak distributed cache for kubernetes. | `true` |
| `cache.stackName` | Set infinispan cache stack to use | `kubernetes` |
| `cache.stackFile` | Set infinispan cache stack filename to use | `""` |
| `cache.useHeadlessServiceWithAppVersion` | Set to true to create the headless service used for ispn containing the app version | `false` |
| 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 (<https://www.keycloak.org/server/all-config?q=cache-stack>) | `kubernetes` |
| `cache.configFile` | Set infinispan cache stack config filename sets KC_CACHE_CONFIG_FILE (<https://www.keycloak.org/server/all-config?q=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

Expand Down Expand Up @@ -867,4 +867,4 @@ Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
12 changes: 6 additions & 6 deletions bitnami/keycloak/templates/configmap-env-vars.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,20 @@ data:
KEYCLOAK_SPI_TRUSTSTORE_FILE: {{ printf "/opt/bitnami/keycloak/spi-certs/%s" .Values.spi.truststoreFilename }}
{{- end }}
{{- if .Values.cache.enabled }}
KEYCLOAK_CACHE_TYPE: "ispn"
{{- if .Values.cache.stackName }}
KEYCLOAK_CACHE_STACK: {{ .Values.cache.stackName | quote }}
KC_CACHE_TYPE: "ispn"
{{- if .Values.cache.stack }}
KC_CACHE_STACK: {{ .Values.cache.stack | quote }}
{{- end }}
{{- if .Values.cache.stackFile }}
KEYCLOAK_CACHE_CONFIG_FILE: {{ .Values.cache.stackFile | quote }}
{{- 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 }}
{{- end }}
{{- else }}
KEYCLOAK_CACHE_TYPE: "local"
KC_CACHE_TYPE: "local"
{{- end }}
{{- if .Values.logging }}
KEYCLOAK_LOG_OUTPUT: {{ .Values.logging.output | quote }}
Expand Down
8 changes: 4 additions & 4 deletions bitnami/keycloak/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1380,14 +1380,14 @@ externalDatabase:
## 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.stackName Set infinispan cache stack to use
## @param cache.stackFile Set infinispan cache stack filename to use
## @param cache.stack Set infinispan cache stack to use, sets KC_CACHE_STACK (<https://www.keycloak.org/server/all-config?q=cache-stack>)
## @param cache.configFile Set infinispan cache stack config filename sets KC_CACHE_CONFIG_FILE (<https://www.keycloak.org/server/all-config?q=cache-config-file>)
## @param cache.useHeadlessServiceWithAppVersion Set to true to create the headless service used for ispn containing the app version
##
cache:
enabled: true
stackName: kubernetes
stackFile: ""
stack: kubernetes
configFile: "cache-ispn.xml"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that I explicitly set the configFile here as of https://www.keycloak.org/docs/latest/release_notes/index.html#infinispan-default-xml-configuration-location

With Keycloak versions >= 26.1.0 this should not be necessary anymore, but is maybe still better to be explicitly set then implicitly assumed.

useHeadlessServiceWithAppVersion: false
## @section Keycloak Logging parameters

Expand Down
Loading