You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: add spec.security.seLinuxRelabel opt-out for relabel init container (#98)
* fix: add spec.security.seLinuxRelabel opt-out for relabel init container
The operator unconditionally adds a privileged "selinux-relabel" init
container whenever persistence is enabled. On clusters where SELinux
relabeling does not apply (NFS-backed storage, or nodes that are not
SELinux-enforcing such as Ubuntu with AppArmor), the container's chcon
fails permanently with "Operation not supported", leaving the pod stuck
in Init:CrashLoopBackOff and the Service returning 503. There was no way
to disable it via the Instance CRD.
Add a backward-compatible opt-out field, spec.security.seLinuxRelabel
(*bool, default true). The init container is now gated on both
PersistenceEnabled and SELinuxRelabelEnabled. Unset preserves today's
behavior so existing SELinux-enforcing clusters are unaffected; an
explicit false skips the init container entirely.
Closes#96
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* docs: regenerate api-reference for seLinuxRelabel field
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/api-reference.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1090,6 +1090,7 @@ _Appears in:_
1090
1090
| --- | --- | --- | --- |
1091
1091
|`podSecurityContext`_[PodSecurityContext](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.33/#podsecuritycontext-v1-core)_| PodSecurityContext specifies security settings for the pod. || Optional: \{\} <br /> |
1092
1092
|`containerSecurityContext`_[SecurityContext](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.33/#securitycontext-v1-core)_| ContainerSecurityContext specifies security settings for the Paperclip container. || Optional: \{\} <br /> |
1093
+
| `seLinuxRelabel` _boolean_ | SELinuxRelabel controls whether the operator adds a privileged<br />"selinux-relabel" init container that runs chcon on the data volume when<br />persistence is enabled. This relabel is required on SELinux-enforcing<br />nodes so the data directory's MCS categories match the pod's SELinux<br />level; without it the pod cannot read its own persistent data.<br />It defaults to true to preserve the legacy behavior (the init container is<br />always added when persistence is enabled). Set it to false on clusters<br />where the relabel does not apply and would fail permanently, e.g. NFS-<br />backed storage or nodes that are not SELinux-enforcing (Ubuntu with<br />AppArmor). On those clusters chcon returns "Operation not supported",<br />leaving the pod stuck in Init:CrashLoopBackOff.<br />A pointer is required so an explicit `false` survives marshaling: a plain<br />bool with omitempty is dropped on marshal and the API server re-defaults<br />it to true on every controller update (same bug class as<br />PersistenceSpec.Enabled and NetworkPolicySpec.Enabled). | true | Optional: \{\} <br /> |
0 commit comments