Skip to content

Commit 9b4f896

Browse files
authored
[keycloak] make keycloak run on openshift (CloudPirates-io#225)
make keycloak run on openshift
1 parent 5bf615a commit 9b4f896

File tree

6 files changed

+27
-28
lines changed

6 files changed

+27
-28
lines changed

charts/keycloak/Chart.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ dependencies:
44
version: 1.1.1
55
- name: postgres
66
repository: oci://registry-1.docker.io/cloudpirates
7-
version: 0.6.1
7+
version: 0.7.2
88
- name: mariadb
99
repository: oci://registry-1.docker.io/cloudpirates
10-
version: 0.3.0
11-
digest: sha256:18c857c1e792fb60ef7577d542f549e8732fdcaf59caa47eb21bd75126ddc713
12-
generated: "2025-09-30T07:51:22.5152067+02:00"
10+
version: 0.3.2
11+
digest: sha256:886649f9f78f7bf1f296dabcca5eb8cd0dbd9d0fdb540a327e6a299817fd4b53
12+
generated: "2025-10-07T21:13:04.453964+02:00"

charts/keycloak/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: keycloak
33
description: Open Source Identity and Access Management Solution
44
type: application
5-
version: 0.2.1
5+
version: 0.3.0
66
appVersion: "26.3.4"
77
keywords:
88
- keycloak

charts/keycloak/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,15 @@ The following table lists the configurable parameters of the Keycloak chart and
114114

115115
### Security
116116

117-
| Parameter | Description | Default |
118-
| ------------------------------------------ | ------------------------------------------------- | --------- |
119-
| `podSecurityContext.fsGroup` | Group ID for the volumes of the pod | `1001` |
120-
| `securityContext.allowPrivilegeEscalation` | Enable container privilege escalation | `false` |
121-
| `securityContext.runAsNonRoot` | Configure the container to run as a non-root user | `true` |
122-
| `securityContext.runAsUser` | User ID for the Keycloak container | `1001` |
123-
| `securityContext.runAsGroup` | Group ID for the Keycloak container | `1001` |
124-
| `securityContext.readOnlyRootFilesystem` | Mount container root filesystem as read-only | `false` |
125-
| `securityContext.capabilities.drop` | Linux capabilities to be dropped | `["ALL"]` |
117+
| Parameter | Description | Default |
118+
| --------------------------------------------------- | ------------------------------------------------- | --------- |
119+
| `podSecurityContext.fsGroup` | Group ID for the volumes of the pod | `1001` |
120+
| `containerSecurityContext.allowPrivilegeEscalation` | Enable container privilege escalation | `false` |
121+
| `containerSecurityContext.runAsNonRoot` | Configure the container to run as a non-root user | `true` |
122+
| `containerSecurityContext.runAsUser` | User ID for the Keycloak container | `1001` |
123+
| `containerSecurityContext.runAsGroup` | Group ID for the Keycloak container | `1001` |
124+
| `containerSecurityContext.readOnlyRootFilesystem` | Mount container root filesystem as read-only | `false` |
125+
| `containerSecurityContext.capabilities.drop` | Linux capabilities to be dropped | `["ALL"]` |
126126

127127
### Keycloak Configuration
128128

charts/keycloak/templates/deployment.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,10 @@ spec:
3131
{{- with (include "keycloak.imagePullSecrets" .) }}
3232
{{ . | nindent 6 }}
3333
{{- end }}
34-
securityContext:
35-
{{- toYaml .Values.podSecurityContext | nindent 8 }}
34+
securityContext: {{ include "common.renderPodSecurityContext" . | nindent 8 }}
3635
initContainers:
3736
- name: copy-quarkus-lib
38-
securityContext:
39-
{{- toYaml .Values.securityContext | nindent 12 }}
37+
securityContext: {{ include "common.renderContainerSecurityContext" . | nindent 12 }}
4038
image: {{ include "keycloak.image" . }}
4139
imagePullPolicy: {{ .Values.image.imagePullPolicy }}
4240
command: ["sh", "-c", "cp -r /opt/keycloak/lib/quarkus/* /shared-quarkus/"]
@@ -45,10 +43,12 @@ spec:
4543
mountPath: /shared-quarkus
4644
{{- if .Values.postgres.enabled }}
4745
- name: wait-for-postgres
46+
securityContext: {{ include "common.renderContainerSecurityContext" . | nindent 12 }}
4847
image: {{ .Values.initContainers.waitForPostgres.image }}
4948
command: ["sh", "-c", "until pg_isready -h {{ .Release.Name }}-postgres -p 5432 -U postgres; do echo waiting for database; sleep 2; done;"]
5049
{{- else if .Values.mariadb.enabled }}
5150
- name: wait-for-mariadb
51+
securityContext: {{ include "common.renderContainerSecurityContext" . | nindent 12 }}
5252
image: {{ .Values.initContainers.waitForMariadb.image }}
5353
command: ["sh", "-c", "until mysqladmin ping -h {{ .Release.Name }}-mariadb -P 3306 --silent; do echo waiting for database; sleep 2; done;"]
5454
{{- end }}
@@ -57,8 +57,7 @@ spec:
5757
{{- end }}
5858
containers:
5959
- name: {{ .Chart.Name }}
60-
securityContext:
61-
{{- toYaml .Values.securityContext | nindent 12 }}
60+
securityContext: {{ include "common.renderContainerSecurityContext" . | nindent 12 }}
6261
image: {{ include "keycloak.image" . }}
6362
imagePullPolicy: {{ .Values.image.imagePullPolicy }}
6463
command:

charts/keycloak/values.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
}
104104
}
105105
},
106-
"securityContext": {
106+
"containerSecurityContext": {
107107
"type": "object",
108108
"properties": {
109109
"allowPrivilegeEscalation": {

charts/keycloak/values.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,18 @@ podSecurityContext:
5959
## @param podSecurityContext.fsGroup Group ID for the volumes of the pod
6060
fsGroup: 1001
6161

62-
securityContext:
63-
## @param securityContext.allowPrivilegeEscalation Enable container privilege escalation
62+
containerSecurityContext:
63+
## @param containerSecurityContext.allowPrivilegeEscalation Enable container privilege escalation
6464
allowPrivilegeEscalation: false
65-
## @param securityContext.runAsNonRoot Configure the container to run as a non-root user
65+
## @param containerSecurityContext.runAsNonRoot Configure the container to run as a non-root user
6666
runAsNonRoot: true
67-
## @param securityContext.runAsUser User ID for the Keycloak container
67+
## @param containerSecurityContext.runAsUser User ID for the Keycloak container
6868
runAsUser: 1001
69-
## @param securityContext.runAsGroup Group ID for the Keycloak container
69+
## @param containerSecurityContext.runAsGroup Group ID for the Keycloak container
7070
runAsGroup: 1001
71-
## @param securityContext.readOnlyRootFilesystem Mount container root filesystem as read-only
71+
## @param containerSecurityContext.readOnlyRootFilesystem Mount container root filesystem as read-only
7272
readOnlyRootFilesystem: false
73-
## @param securityContext.capabilities.drop Linux capabilities to be dropped
73+
## @param containerSecurityContext.capabilities.drop Linux capabilities to be dropped
7474
capabilities:
7575
drop:
7676
- ALL

0 commit comments

Comments
 (0)