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: content/zh-cn/blog/_posts/2023-04-18-efficient-selinux-relabeling-beta.md
+15-11Lines changed: 15 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -87,7 +87,7 @@ If a Pod and its volume meet **all** of the following conditions, Kubernetes wil
87
87
88
88
Without Kubernetes knowing at least the SELinux `level`, the container runtime will assign a random one _after_ the volumes are mounted. The container runtime will still relabel the volumes recursively in that case.
89
89
-->
90
-
3. Pod 必须在其 [Pod 安全上下文](/zh-cn/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context)中至少分配
90
+
3. Pod 必须在其 [Pod 安全上下文](/zh-cn/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context)中至少设置
91
91
`seLinuxOptions.level`,或者所有 Pod 容器必须在[安全上下文](/zh-cn/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context-1)中对其进行设置。
@@ -101,15 +101,16 @@ If a Pod and its volume meet **all** of the following conditions, Kubernetes wil
101
101
102
102
If running two Pods with two different SELinux contexts and using different `subPaths` of the same volume is necessary in your deployments, please comment in the [KEP](https://github.com/kubernetes/enhancements/issues/1710) issue (or upvote any existing comment - it's best not to duplicate). Such pods may not run when the feature is extended to cover all volume access modes.
1. The volume plugin or the CSI driver responsible for the volume supports mounting with SELinux mount options.
@@ -138,18 +139,21 @@ If a Pod and its volume meet **all** of the following conditions, Kubernetes wil
138
139
When all aforementioned conditions are met, kubelet will pass `-o context=<SELinux label>` mount option to the volume plugin or CSI driver. CSI driver vendors must ensure that this mount option is supported by their CSI driver and, if necessary, the CSI driver appends other mount options that are needed for `-o context` to work.
For example, NFS may need `-o context=<SELinux label>,nosharecache`, so each volume mounted from the same NFS server can have a different SELinux label value. Similarly, CIFS may need `-o context=<SELinux label>,nosharesock`.
It's up to the CSI driver vendor to test their CSI driver in a SELinux enabled environment before setting `seLinuxMount: true` in the CSIDriver instance.
@@ -159,7 +163,7 @@ It's up to the CSI driver vendor to test their CSI driver in a SELinux enabled e
159
163
<!--
160
164
SELinux in containers: see excellent [visual SELinux guide](https://opensource.com/business/13/11/selinux-policy-guide) by Daniel J Walsh. Note that the guide is older than Kubernetes, it describes *Multi-Category Security* (MCS) mode using virtual machines as an example, however, a similar concept is used for containers.
161
165
-->
162
-
容器中的 SELinux:请参阅 Daniel J Walsh 撰写的优秀 [可视化 SELinux 指南(英文)](https://opensource.com/business/13/11/selinux-policy-guide)。
166
+
容器中的 SELinux:请参阅 Daniel J Walsh 撰写的[可视化 SELinux 指南(英文)](https://opensource.com/business/13/11/selinux-policy-guide)。
0 commit comments