Skip to content

charts: let OpenShift's SCC assign pod IDs - #180

Draft
adalundhe wants to merge 1 commit into
mainfrom
fix/openshift-scc-assigned-ids
Draft

adalundhe wants to merge 1 commit into
mainfrom
fix/openshift-scc-assigned-ids

Conversation

@adalundhe

Copy link
Copy Markdown

OpenShift's default SCC, restricted-v2, assigns each pod a UID and fsGroup from its namespace's range. It refuses a runAsUser or fsGroup outside that range. The chart pins RustFS to 10001 and k8s-credential-provider to 65532, so OpenShift refuses both pods at admission until an admin grants another SCC.

The chart now leaves runAsUser, runAsGroup and fsGroup unset on these pods when the cluster serves security.openshift.io/v1. Other clusters render the same manifests as before. helm template cannot see the cluster, so the README says to pass --api-versions security.openshift.io/v1 when rendering for OpenShift.

Upgrade note: if you granted anyuid to the RustFS ServiceAccount as a workaround, remove the grant. anyuid takes priority over restricted-v2 and assigns no fsGroup, so a new RustFS PVC is not writable. A nonroot-v2 grant does no harm, because restricted-v2 sorts ahead of it.

Not covered: the kustomize manifests in manifests/ate-install/ and manifests/egress-credential-injection/ still pin these IDs.

Tested:

  • Without the OpenShift API, helm template output matches main byte for byte for six value sets. With --api-versions security.openshift.io/v1, only the pinned IDs drop.
  • The new helm-unittest case fails against main's templates, and when either template change is reverted.
  • RustFS 1.0.3 in Docker, as UID 1000680000 and GID 0 with the fsGroup as a supplementary group on an empty volume, starts and serves S3. It logs to stdout because it cannot write /logs.
  • helm lint, hack/render-manifests.sh --check and helm unittest charts/substrate pass.
  • Not yet run on an OpenShift cluster.

AI use: written with Claude Code. A second agent session reviewed it and tried to break it.

  • Tests pass
  • Docs updated

🤖 Generated with Claude Code

OpenShift's default SCC, restricted-v2, assigns each pod a UID and
fsGroup from its namespace's range and refuses a runAsUser or fsGroup
outside it. RustFS and k8s-credential-provider pin theirs, so a default
install on OpenShift never starts them.

Leave runAsUser, runAsGroup and fsGroup unset when the cluster serves
security.openshift.io/v1, so these pods run in group 0 like other pods
with an assigned UID. Other clusters render the same manifests as
before. RustFS runs as an arbitrary UID with a group-writable /data; it
logs to stdout when it cannot write /logs.

Signed-off-by: Ada Lundhe <adalundhe@lundhe.audio>
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.

1 participant