Skip to content

Commit

Permalink
[keycloak] add support for topologySpreadConstraints. Fixes #463.
Browse files Browse the repository at this point in the history
Signed-off-by: Raffael Sahli <[email protected]>
  • Loading branch information
raffis authored and thomasdarimont committed Sep 6, 2021
1 parent c8f6273 commit a64ea8a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/keycloak/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
2 changes: 2 additions & 0 deletions charts/keycloak/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 | `{}` |
Expand Down Expand Up @@ -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.

Expand Down
4 changes: 4 additions & 0 deletions charts/keycloak/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
3 changes: 3 additions & 0 deletions charts/keycloak/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ affinity: |
- test
topologyKey: failure-domain.beta.kubernetes.io/zone
# Topology spread constraints template
topologySpreadConstraints:

# Node labels for Pod assignment
nodeSelector: {}

Expand Down

0 comments on commit a64ea8a

Please sign in to comment.