Skip to content

Add compatibility with OKD and OpenShift#887

Open
hlavki wants to merge 2 commits intocodecentric:masterfrom
hlavki:master
Open

Add compatibility with OKD and OpenShift#887
hlavki wants to merge 2 commits intocodecentric:masterfrom
hlavki:master

Conversation

@hlavki
Copy link
Copy Markdown

@hlavki hlavki commented Mar 11, 2026

This change adds compatibility with OKD and OpenShift.

The rendering of security contexts has been adjusted to allow the container to run on these platforms without explicitly setting UID and GID. This aligns with the security model used by OKD/OpenShift, where these values are typically assigned dynamically.

The implementation is based on logic from the Bitnami Helm charts repository (Apache License).

The change preserves backward compatibility with existing configurations.

hlavki and others added 2 commits August 20, 2024 08:29
Signed-off-by: Michal Hlavac <miso@hlavki.eu>
# Conflicts:
#	charts/keycloakx/templates/_helpers.tpl
@hlavki hlavki requested a review from a team as a code owner March 11, 2026 13:57
@dominiquemetz dominiquemetz self-assigned this Mar 26, 2026
Copy link
Copy Markdown
Contributor

@dominiquemetz dominiquemetz left a comment

Choose a reason for hiding this comment

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

Thank your for your contribution, this already looks great!
I added two comments, please take a look.

Please update the Configuration section in the README and document the adaptSecurityContext property as well.

securityContext:
{{- toYaml .Values.dbchecker.securityContext | nindent 12 }}
{{- if .Values.podSecurityContext.enabled }}
securityContext: {{- include "keycloak.renderSecurityContext" (dict "secContext" .Values.podSecurityContext "context" $) | nindent 12 }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This security context belongs to the dbchecker, which should be set via .Values.dbchecker.securityContext. Please adapt your solution to use this securityContext


# SecurityContext for the entire Pod. Every container running in the Pod will inherit this SecurityContext. This might be relevant when other components of the environment inject additional containers into running Pods (service meshes are the most prominent example for this)
podSecurityContext:
enabled: true
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are the "enabled" flags necessary for this feature? Why would I need to disable the rendering of the security contexts in the context of OKD and OpenShift support? If not strictly necessary, I would ask you to remove the enabled flag and have no conditional rendering of the securityContexts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants