Skip to content

Commit 9d80955

Browse files
authored
DEVOPS-2781-changed-keycloak-switch-to-statefulset (#80)
1 parent 4808155 commit 9d80955

File tree

4 files changed

+7
-12
lines changed

4 files changed

+7
-12
lines changed

chart/templates/helpers/_helpers.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,10 @@ Container SecurityContext of lightrun keycloak
148148
{{/*
149149
helper that return the semver of `deplyoments.keycloak.image.tag`
150150
In case of invalid semver it return 1.38.0
151-
We then use the version to set Keycloak properties accordingly in file - templates/keycloak-deployment.yaml
151+
We then use the version to set Keycloak properties accordingly in file - templates/keycloak-statefulset.yaml
152152
We need this helper as Keycloak in version 25 onwards introduced hostname:v2 and we want to keep backwards compatability
153153
More info here - https://www.keycloak.org/docs/25.0.2/upgrading/#migrating-to-25-0-0
154-
Currently, here is what we do in file templates/keycloak-deployment.yaml:
154+
Currently, here is what we do in file templates/keycloak-statefulset.yaml:
155155
{{- $version := include "lightrun-keycloak.getParsedVersion" .Values.deployments.keycloak.image.tag -}}
156156
{{- if semverCompare ">=1.38.0" $version }}
157157
- name: KC_HOSTNAME

chart/templates/keycloak-deployment.yaml renamed to chart/templates/keycloak-statefulset.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{- $version := include "lightrun-keycloak.getSemanticVersion" .Values.deployments.keycloak.image.tag -}}
22
apiVersion: apps/v1
3-
kind: Deployment
3+
kind: StatefulSet
44
metadata:
55
name: {{ include "lightrun-keycloak.name" . }}
66
labels:
@@ -10,8 +10,9 @@ metadata:
1010
{{ toYaml . | nindent 4 }}
1111
{{- end }}
1212
spec:
13-
strategy:
14-
type: {{ .Values.deployments.keycloak.rollout_strategy }}
13+
serviceName: {{ include "lightrun-keycloak.name" . }}
14+
updateStrategy:
15+
type: RollingUpdate
1516
# For clusters with more than 3 pods, consider changing the number of "owner nodes" as described in
1617
# https://www.keycloak.org/server/caching#_configuring_caches -> Configuring caches for availability
1718
replicas: {{ .Values.deployments.keycloak.replicas }}

chart/values.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,6 @@ deployments:
665665
# https://www.keycloak.org/server/caching#_configuring_caches -> Configuring caches for availability
666666
clusterMode: true
667667
replicas: 1
668-
rollout_strategy: "Recreate"
669668
image:
670669
repository: lightruncom/keycloak
671670
tag: ""

docs/components/keycloak.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### Overview
22

3-
The keycloak service provides the authentication. It is deployed as a Kubernetes pod and can be configured for scaling, resource allocation, and health monitoring.
3+
The keycloak service provides the authentication. It is deployed as a Kubernetes StatefulSet and can be configured for scaling, resource allocation, health monitoring, and clustering.
44
configuration is defined under **`deployments.keycloak`** in the **`values.yaml`**
55
### Configuration Options
66

@@ -21,11 +21,6 @@ configuration is defined under **`deployments.keycloak`** in the **`values.yaml`
2121
replicas: 1 # Default number of replicas
2222
```
2323
24-
#### Deployment Strategy
25-
26-
```yaml
27-
rollout_strategy: "Recreate" # Defines the rollout strategy
28-
```
2924
3025
#### Image Configuration
3126

0 commit comments

Comments
 (0)