Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions charts/substrate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ allow. New installs should set `atelet.enabled=false` and install the
helm template substrate ./charts/substrate
```

On OpenShift the chart leaves pod UIDs and fsGroups for the SCC to assign. It
detects OpenShift from the cluster's API versions, which `helm template` cannot
see, so add `--api-versions security.openshift.io/v1` when rendering for it.
Comment on lines +69 to +71

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could the anyuid upgrade note from the PR description go here too? The repo has no CHANGELOG, so after merge this paragraph is where an OpenShift operator will look. Anyone who keeps the grant gets an unwritable RustFS PVC on a new install.

Also, every test run was a fresh install. Upgrading an anyuid install with data owned by 10001 should still work, because kubelet changes the volume's group to the new fsGroup. Drivers that skip ownership changes don't do that, and many NFS setups are like that. Worth a test, or a line in the note.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

^^ Good catch. Hang on!

@adalundhe adalundhe Nov 19, 2026 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Added to the README in 7fc7e85. I tested the upgrade with RustFS data written as UID 10001:

  • If the storage applies the new fsGroup, RustFS reads and writes.
  • If the storage skips that change, RustFS can read but not write.
  • If anyuid is kept, RustFS runs as UID 10001 and reads and writes.

So the README says to keep anyuid on storage that skips the change.


`manifests/ate-install/` in the repo is the rendered mTLS output and is
regenerated by `hack/render-manifests.sh`. The separate `substrate-crds` chart
mirrors `manifests/ate-install/generated/`.
Expand Down
8 changes: 8 additions & 0 deletions charts/substrate/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,14 @@ definition so the fallback cannot drift between pods.
{{- ((.Values.global).imagePullPolicy) | default "IfNotPresent" -}}
{{- end -}}

{{/*
Empty on OpenShift, whose restricted-v2 SCC assigns each pod's UID and fsGroup
and refuses IDs outside the namespace's range.
*/}}
{{- define "substrate.pinIDs" -}}
{{- if not (.Capabilities.APIVersions.Has "security.openshift.io/v1") }}true{{ end -}}
{{- end -}}

{{/* Object storage settings shared by object-store plugins. */}}
{{- define "substrate.storage.env" -}}
- name: ATE_STORAGE_BACKEND
Expand Down
2 changes: 2 additions & 0 deletions charts/substrate/templates/k8s-credential-provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ spec:
serviceAccountName: {{ include "substrate.fullname" (list "k8s-credential-provider" .) }}
{{- with include "substrate.imagePullSecrets" . }}{{- . | nindent 6 }}{{- end }}
securityContext:
{{- if include "substrate.pinIDs" . }}
runAsUser: 65532
runAsGroup: 65532
{{- end }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This pod may not need the OpenShift check. ko builds it on distroless/static-debian13:nonroot (.ko.yaml), which already runs as 65532:65532. ate-controller, ate-api-server and ate-idp-server use the same base and set only runAsNonRoot: true, and they already pass restricted-v2.

If you drop runAsUser/runAsGroup here on every cluster, vanilla Kubernetes keeps the same UID. OpenShift then doesn't need --api-versions for this pod, and substrate.pinIDs is left with RustFS, which really needs it for fsGroup.

@adalundhe adalundhe Nov 19, 2026 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed in 56f8c7a. The credential provider now sets only runAsNonRoot: true, like the other three pods. Its image runs as UID 65532, so other clusters keep the same UID.

One difference: kubelet now writes its credential bundle as 0644 instead of 0600, the same as for the other three pods.

runAsNonRoot: true
containers:
- name: k8s-credential-provider
Expand Down
2 changes: 2 additions & 0 deletions charts/substrate/templates/rustfs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,12 @@ spec:
app: rustfs
spec:
serviceAccountName: {{ include "substrate.fullname" (list "rustfs" .) }}
{{- if include "substrate.pinIDs" . }}
securityContext:
runAsUser: 10001
runAsGroup: 10001
fsGroup: 10001
{{- end }}
{{- with include "substrate.imagePullSecrets" . }}{{- . | nindent 6 }}{{- end }}
containers:
- name: rustfs
Expand Down
18 changes: 18 additions & 0 deletions charts/substrate/tests/control_plane_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,24 @@ tests:
content:
name: statusz
containerPort: 4040
- it: leaves pod IDs to OpenShift's SCC

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Optional: nothing checks that the IDs stay on vanilla Kubernetes. I made substrate.pinIDs always return empty and all 65 unit tests still passed. render-manifests.sh --check caught the RustFS change, but k8s-credential-provider.yaml is in PRESERVED_FILES, so nothing covers that pod. A mirror case without capabilities would catch it. If you take the credential-provider suggestion, the render check already covers RustFS and you can skip this.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Ooof. Yeah, also this. Hang on.

@adalundhe adalundhe Nov 19, 2026 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Added in add6537. One test checks that RustFS keeps its IDs off OpenShift. Another checks that the credential provider sets no IDs. Your mutation now fails the RustFS test.

templates:
- k8s-credential-provider.yaml
- rustfs.yaml
documentSelector:
path: kind
value: Deployment
matchMany: true
capabilities:
apiVersions:
- security.openshift.io/v1
asserts:
- notExists:
path: spec.template.spec.securityContext.runAsUser
- notExists:
path: spec.template.spec.securityContext.runAsGroup
- notExists:
path: spec.template.spec.securityContext.fsGroup
- it: stops OTLP push without an endpoint but keeps the scraped metrics
template: ate-controller.yaml
documentSelector:
Expand Down
Loading