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
Copy file name to clipboardExpand all lines: keps/sig-storage/1710-selinux-relabeling/README.md
+29-9
Original file line number
Diff line number
Diff line change
@@ -499,7 +499,7 @@ Therefore, if configured properly, all Pods in the same namespace run with the s
499
499
Kubelet mount behavior stays the same as it is in the previous step.
500
500
Cluster admin can check the cluster metrics and they can proactively opt out from mounting all volumes with SELinux by setting `SELinuxChangePolicy: Recursive` in all Pods that need to mix privileged and unprivileged Pods.
501
501
The field accepts only value `Recursive` at this stage!
502
-
The field value has no effect on volume mounting or relabeling, however, it is reflected in `volume_manager_selinux_volume_context_mismatch_warnings_total`, `selinux_controller_selinux_label_mismatch`, and `selinux_controller_selinux_label_mismatch` metrics.
502
+
The field value has no effect on volume mounting or relabeling, however, it is reflected in `volume_manager_selinux_volume_context_mismatch_warnings_total`and `selinux_warning_controller_selinux_volume_conflict` metrics.
503
503
The cluster admin can see that nr. of problematic Pods decreases.
504
504
* A kubernetes distribution may choose to block upgrade to 1.M (that has `SELinuxMount` enabled), until the cluster admin fixes all problematic Pods.
505
505
4. Cluster admin updates to 1.M, where `SELinuxMount` is enabled by default.
* It is emitted only when the `SELinuxMountReadWriteOncePod` feature gate is enabled (on by default in 1.28).
528
528
* It is emitted by kubelet, in the code path that will really block starting a pod when `SELinuxMount` feature gate is enabled.
529
529
* It misses Pods that run on different nodes that would not run if they landed on the same node.
530
-
* `selinux_controller_selinux_label_mismatch`, `selinux_controller_selinux_change_policy_mismatch`: names of Pods that may not start if `SELinuxMount` feature gate is enabled *and* the Pods land on the same node.
530
+
* `selinux_warning_controller_selinux_volume_conflict`: names of Pods that may not start if `SELinuxMount` feature gate is enabled *and* the Pods land on the same node.
531
531
* SELinuxController, if enabled, will send events to Pods that may not start if `SELinuxMount` feature gate is enabled.
532
532
533
533
As of 2024-09-04, telemetry numbers from OpenShift show that less than 2% of the clusters have `volume_manager_selinux_volume_context_mismatch_warnings_total > 0`.
@@ -587,15 +587,35 @@ When it sees a pair of Pods that conflict, it emits a metric and an event to bot
587
587
* The event either mentions both Pods by name (if both are in the same namespace) or just something generic (when they are in different namespaces, so the event does not leak sensitive information).
588
588
The controller keeps in-memory list of Pods+volumes that were reported, so it does not emit the same event again on re-sync.
Value of the metric for a given pod1+pod2 combination is either 1 or the metric is not reported at all.
595
-
In a cluster without any conflicts, the metrics is empty.
596
-
* This metric must not be reported for Privileged and unprivileged Pods with both having `SELinuxChangePolicy: Recursive`.
597
-
* This metric must not be reported for two Pods with `SELinuxChangePolicy: Recursive` and two different labels using the same volume, but with different subpaths.
598
-
* A cluster admin should be able to list conflicting pods by querying the metric easily.
593
+
* Example of SELinuxChangePolicy conflict on two pods:
* This metric must not be reported for Privileged and unprivileged Pods with both having `SELinuxChangePolicy: Recursive`.
616
+
* This metric must not be reported for two Pods with `SELinuxChangePolicy: Recursive` and two different labels using the same volume.
617
+
User has explicitly opted out from the SELinuxMount behavior, they must have other means how to run two pods with different SELinux labels, for example anti-affinity or using different subpath of the volumes.
618
+
* A cluster admin can list conflicting pods by querying the metric easily.
599
619
600
620
TBD: limit the metric to X thousands of conflicts?
0 commit comments