From a64ea8a936bc85b9e529877d0f657461f670cb02 Mon Sep 17 00:00:00 2001 From: Raffael Sahli Date: Mon, 6 Sep 2021 16:38:13 +0200 Subject: [PATCH] [keycloak] add support for topologySpreadConstraints. Fixes #463. Signed-off-by: Raffael Sahli --- charts/keycloak/Chart.yaml | 2 +- charts/keycloak/README.md | 2 ++ charts/keycloak/templates/statefulset.yaml | 4 ++++ charts/keycloak/values.yaml | 3 +++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/charts/keycloak/Chart.yaml b/charts/keycloak/Chart.yaml index d28460b4..6f2f324a 100644 --- a/charts/keycloak/Chart.yaml +++ b/charts/keycloak/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: keycloak -version: 15.0.1 +version: 15.0.2 appVersion: 15.0.2 description: Open Source Identity and Access Management For Modern Applications and Services keywords: diff --git a/charts/keycloak/README.md b/charts/keycloak/README.md index 3b38f9af..2fb0a5e9 100644 --- a/charts/keycloak/README.md +++ b/charts/keycloak/README.md @@ -72,6 +72,7 @@ The following table lists the configurable parameters of the Keycloak chart and | `extraEnvFrom` | Additional environment variables for Keycloak mapped from a Secret or ConfigMap | `""` | | `priorityClassName` | Pod priority class name | `""` | | `affinity` | Pod affinity | Hard node and soft zone anti-affinity | +| `topologySpreadConstraints` | Topology spread constraints | Constraints used to spread pods | | `nodeSelector` | Node labels for Pod assignment | `{}` | | `tolerations` | Node taints to tolerate | `[]` | | `podLabels` | Additional Pod labels | `{}` | @@ -210,6 +211,7 @@ It is used for the following values: * `livenessProbe` * `readinessProbe` * `startupProbe` +* `topologySpreadConstraints` Additionally, custom labels and annotations can be set on various resources the values of which being passed through `tpl` as well. diff --git a/charts/keycloak/templates/statefulset.yaml b/charts/keycloak/templates/statefulset.yaml index ebc464d2..25d4aa64 100644 --- a/charts/keycloak/templates/statefulset.yaml +++ b/charts/keycloak/templates/statefulset.yaml @@ -167,6 +167,10 @@ spec: affinity: {{- tpl . $ | nindent 8 }} {{- end }} + {{- with .Values.topologySpreadConstraints }} + topologySpreadConstraints: + {{- tpl . $ | nindent 8 }} + {{- end }} {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} diff --git a/charts/keycloak/values.yaml b/charts/keycloak/values.yaml index 9921e114..b532f518 100644 --- a/charts/keycloak/values.yaml +++ b/charts/keycloak/values.yaml @@ -138,6 +138,9 @@ affinity: | - test topologyKey: failure-domain.beta.kubernetes.io/zone +# Topology spread constraints template +topologySpreadConstraints: + # Node labels for Pod assignment nodeSelector: {}