Skip to content

Commit 6f60b85

Browse files
committed
Specify what happens when CSI driver doesn't mount with the right context
And other minor edits
1 parent 693dce4 commit 6f60b85

File tree

1 file changed

+5
-3
lines changed
  • keps/sig-storage/1710-selinux-relabeling

1 file changed

+5
-3
lines changed

keps/sig-storage/1710-selinux-relabeling/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ Following table captures interaction between actual filesystems on a volume and
220220
| NFS1 CSI | true | `-o context=XYZ` | | 4) |
221221
| NFS2 CSI | unset or false | | | 5) |
222222
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.
224224
2) AWS EBS CSI driver ships CSIDriver instance with `SELinuxMountSupported: true`. The behavior is the same as for in-tree volume plugin.
225225
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.
226226
@@ -332,9 +332,11 @@ Apart from the obvious API change and behavior described above, kubelet + volume
332332
* Volume plugins will get SELinux context as a new parameter of `MountDevice` and `SetUp`/`SetupAt` calls (resp. as a new field in `DeviceMounterArgs` / `MounterArgs`).
333333
* 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`).
334334
* 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.
335336
* 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.
337337
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).
338340
* 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.
339341

340342
### Implementation phases
@@ -374,7 +376,7 @@ Even that will help users to avoid recursive relabeling of volumes if their appl
374376
* Alpha of Phase 1:
375377
* Provided all tests defined above are passing and gated by the feature gate `SELinuxMountReadWriteOncePod` and set to a default of `false`.
376378
* Documentation exists.
377-
* Beta of Phase 1:
379+
* Beta of Phase 1:
378380
* The feature gate is `true` by default.
379381
* Evaluation:
380382
* During the next release after Phase 1 is beta (= the feature is enabled by default), collect reports from users about possible breakage.

0 commit comments

Comments
 (0)