Skip to content

Adapt the security context automatically on OpenShift - #194

Open
juanbrny wants to merge 1 commit into
quickwit-oss:mainfrom
juanbrny:feat/openshift-security-context
Open

juanbrny wants to merge 1 commit into
quickwit-oss:mainfrom
juanbrny:feat/openshift-security-context

Conversation

@juanbrny

Copy link
Copy Markdown

OpenShift assigns the user ID (UID) and fsGroup of each pod from the namespace range. Its default Security Context Constraint (SCC), restricted-v2, rejects pods that set other values. The chart defaults (runAsUser: 1005 and fsGroup: 1005) are outside that range, so the pods do not start on OpenShift.

Add the openshift.adaptSecurityContext value (auto, force or disabled). In auto mode, the chart removes podSecurityContext.fsGroup and securityContext.runAsUser when the cluster has the security.openshift.io/v1 API. On other clusters, the rendered output does not change.

OpenShift assigns the user ID (UID) and fsGroup of each pod from the
namespace range. Its default Security Context Constraint (SCC),
restricted-v2, rejects pods that set other values. The chart defaults
(runAsUser: 1005 and fsGroup: 1005) are outside that range, so the pods
do not start on OpenShift.

Add the openshift.adaptSecurityContext value (auto, force or disabled).
In auto mode, the chart removes podSecurityContext.fsGroup and
securityContext.runAsUser when the cluster has the
security.openshift.io/v1 API. On other clusters, the rendered output
does not change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T11:49:56.924427Z b63e05a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@juanbrny

Copy link
Copy Markdown
Author

Why?

Add support for OKD, OpenShift Container Platform and OpenShift Kubernetes Engine based environments, without having to tweak the helm chart.

Description

Helm chart adapts the security context automatically on OpenShift based distros (OCP, OKE and OKD).

Three modes: auto, force and disabled.

  • auto: adapt when the cluster has the security.openshift.io/v1 API. (default value)
  • force: always adapt. Use this when the chart is rendered without cluster access, for example with helm template or a GitOps tool.
  • disabled: never adapt.

How was this PR tested?

Updated Helm chart used to deploy Qwickwit on:

  • OpenShift Kubernetes Engine v4.21.36 (Kubernetes v.1.34.9) with both Helm v4.2.3 and Helm v3.10.0. (mode: auto)
  • K3s v1.35.2+k3s1 (mode: auto)

@juanbrny

Copy link
Copy Markdown
Author

@shuheiktgw may you have a look and let me know what do you think?

@shuheiktgw
shuheiktgw self-requested a review October 26, 2026 11:04
@shuheiktgw

Copy link
Copy Markdown
Collaborator

@juanbrny Thanks for looking into OpenShift support! I'd prefer not to add new fields and helpers, as what you propose can already be expressed like the following:

podSecurityContext:
  fsGroup: null
securityContext:
  runAsUser: null

I'd like to keep values.yaml as minimal as possible. Once a field is added, it's hard to remove. For now I personally think adding documentation is enough but what do you think?

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants