Skip to content

Graduate SELinuxMount to GA - #18779

Merged
kubernetes-prow[bot] merged 3 commits into
kubernetes:masterfrom
jsafrane:selinux-ga
Sep 11, 2026
Merged

Graduate SELinuxMount to GA#18779
kubernetes-prow[bot] merged 3 commits into
kubernetes:masterfrom
jsafrane:selinux-ga

Conversation

@jsafrane

@jsafrane jsafrane commented Sep 4, 2026

Copy link
Copy Markdown
Member

Promote the SELinuxMount feature flag from opt-in to enabled-by-default. Instead of being gated only by the flag, SELinux mount support in the AWS EBS and GCP PD CSI drivers is now rendered when the cluster sets spec.containerd.selinuxEnabled: true.

This avoids polluting CSI driver pods with SELinux hostPath mounts on clusters that don't use SELinux, while making the feature work out of the box on clusters that do. On SELinux-enforcing nodes, eligible volumes are then mounted with -o context instead of recursively relabeled, speeding up pod startup for large volumes.

The SELinuxMount flag is kept as an escape hatch: set KOPS_FEATURE_FLAGS=-SELinuxMount to disable the feature unconditionally.

Fixes: #18778

@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 4, 2026
@jsafrane jsafrane changed the title Graduate SELinuxMount to GA WIP: Graduate SELinuxMount to GA Sep 4, 2026
@kubernetes-prow kubernetes-prow Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 4, 2026
@kubernetes-prow kubernetes-prow Bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 7, 2026
@jsafrane jsafrane changed the title WIP: Graduate SELinuxMount to GA Graduate SELinuxMount to GA Sep 8, 2026
@kubernetes-prow kubernetes-prow Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 8, 2026
@jsafrane

jsafrane commented Sep 8, 2026

Copy link
Copy Markdown
Member Author

/retest

@hakman hakman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@jsafrane This seems reasonable, but would move to 1.38 and drop the new tests. There is some complex ones that could maybe be reused to enable this feature.

Comment thread cmd/kops/integration_test.go Outdated
Comment thread cmd/kops/integration_test.go Outdated
Comment thread docs/releases/1.37-NOTES.md Outdated

* The AWS EBS CSI driver addon no longer creates the `ebs-csi-controller-volumemodifier` Service. kOps does not deploy the `volume-modifier-for-k8s` sidecar that this Service selects, because the sidecar image is published only to a registry that kOps does not mirror. The Service has had no endpoints since kOps 1.36, and volume modification through the `ebs.csi.aws.com` annotations has been unavailable for the same period. This addon does not prune, so an existing cluster keeps the Service until you delete it with `kubectl delete service -n kube-system ebs-csi-controller-volumemodifier`.

* On AWS and GCP, kOps now configures the EBS and PD CSI drivers for SELinux mount support (`CSIDriver.spec.seLinuxMount: true`, plus the host mounts it needs) whenever `spec.containerd.selinuxEnabled` is set on the cluster. On a node with SELinux in enforcing mode, this lets the kubelet label eligible volumes with `-o context` at mount time instead of recursively relabeling every file, which speeds up pod startup for large volumes. The behavior is controlled by the `SELinuxMount` feature flag, which now defaults to on; set `KOPS_FEATURE_FLAGS=-SELinuxMount` to disable it as an escape hatch. Clusters that previously set `+SELinuxMount` without `spec.containerd.selinuxEnabled: true` will no longer get the SELinux mount bits — set `spec.containerd.selinuxEnabled: true` to keep them.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A little too late for 1.37.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Moved to 1.38 release notes

Promote the SELinuxMount feature flag from opt-in to enabled-by-default.
Instead of being gated only by the flag, SELinux mount support in the
AWS EBS and GCP PD CSI drivers is now rendered when the cluster sets
spec.containerd.selinuxEnabled: true.

This avoids polluting CSI driver pods with SELinux hostPath mounts on
clusters that don't use SELinux, while making the feature work out of
the box on clusters that do. On SELinux-enforcing nodes, eligible
volumes are then mounted with -o context instead of recursively
relabeled, speeding up pod startup for large volumes.

The SELinuxMount flag is kept as an escape hatch: set
KOPS_FEATURE_FLAGS=-SELinuxMount to disable the feature
unconditionally.
It will check that SELinux propagates where appropriate and CSI drivers are
installed with SELinuxMount support.
@kubernetes-prow kubernetes-prow Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Sep 11, 2026
@hakman

hakman commented Sep 11, 2026

Copy link
Copy Markdown
Member

/test pull-kops-aws-upgrade-k135-ko135-to-k137-kolatest-many-addons

@hakman

hakman commented Sep 11, 2026

Copy link
Copy Markdown
Member

Thanks @jsafrane, nice to see this finally happening!
/lgmt
/approve

@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hakman

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow kubernetes-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 11, 2026
@hakman

hakman commented Sep 11, 2026

Copy link
Copy Markdown
Member

/lgtm

@kubernetes-prow kubernetes-prow Bot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 11, 2026
@kubernetes-prow
kubernetes-prow Bot merged commit 14e1b18 into kubernetes:master Sep 11, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/addons area/documentation cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Promote SELinuxMount feature flag to enabled-by-default, gated by containerd.selinuxEnabled

2 participants