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
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -220,7 +220,7 @@ Following table captures interaction between actual filesystems on a volume and
220
220
| NFS1 CSI | true | `-o context=XYZ` | | 4) |
221
221
| NFS2 CSI | unset or false | | | 5) |
222
222
223
-
1) Kubelet knows that the in-tree AWS CSI plugin supports mounting with `-o context`. The mount option is then used (if pod context is known) and the container runtime does not relabel the volume.
223
+
1) Kubelet knows that the in-tree AWS EBS plugin supports mounting with `-o context`. The mount option is then used (if pod context is known) and the container runtime does not relabel the volume.
224
224
2) AWS EBS CSI driver ships CSIDriver instance with `SELinuxMountSupported: true`. The behavior is the same as for in-tree volume plugin.
225
225
3) Here we show behavior of "old" CSI drivers, that ship their `CSIDriver` with `SELinuxMountSupported` unset (or `false`). Kubelet mounts the volume without any `-o context` option and detects that the volume supports SELinux (by inspecting mount options - it can find `seclabel` there). Therefore, it passes `:Z` to the container runtime to recursively relabel files on the volume.
226
226
@@ -332,9 +332,11 @@ Apart from the obvious API change and behavior described above, kubelet + volume
332
332
* Volume plugins will get SELinux context as a new parameter of `MountDevice` and `SetUp`/`SetupAt`calls (resp. as a new field in `DeviceMounterArgs` / `MounterArgs`).
333
333
* Each volume plugin can choose to use the mount option `-o context=` (e.g. when `CSIDriver.SELinuxRelabelPolicy` is `true`) or ignore it (e.g. in-tree volume plugins for shared filesystems or when `CSIDriver.SELinuxRelabelPolicy` is `false` or `nil`).
334
334
* Each volume plugin then returns `SupportsSELinux` from `GetAttributes()` call, depending on if it wants the container runtime to relabel the volume (`true`) or not (`false`; the volume was already mounted with the right label or it does not support SELinux at all).
335
+
It will report error when the context in `/proc/mounts` does not match the expected value.
335
336
* When a CSI driver announces `SELinuxMountSupported: true`, kubelet will check that `-o context=X` was correctly applied after `NodePublish()`.
336
-
It will report error when the context in `/proc/mounts` does not match the expected value.
337
337
It is a failure on CSI driver side, that it announces something that it is not able to fulfill.
338
+
All pods that use such a volume will be ContainerCreating until the CSI driver fixes the mount (i.e., probably forever), with a message that it's CSI driver fault.
339
+
This error is already part of generic `storage_operation_duration_seconds` metric (with a label for failures).
338
340
* Note that kubelet can't check mount options after `NodeStage`, because a CSI driver does not need to mount during NodeStage or it may choose to mount to another directory than the staging one.
339
341
340
342
### Implementation phases
@@ -374,7 +376,7 @@ Even that will help users to avoid recursive relabeling of volumes if their appl
374
376
* Alpha of Phase1:
375
377
* Provided all tests defined above are passing and gated by the feature gate `SELinuxMountReadWriteOncePod` and set to a default of `false`.
376
378
* Documentation exists.
377
-
* Beta of Phase 1:
379
+
* Beta of Phase1:
378
380
* The feature gate is `true` by default.
379
381
* Evaluation:
380
382
* During the next release after Phase1 is beta (= the feature is enabled by default), collect reports from users about possible breakage.
0 commit comments