This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.7.18.2.2. 在 Red Hat Enterprise Linux CoreOS(RHCOS)8 中为 hostpath 置备程序配置 SELinux
在创建 HostPathProvisioner
自定义资源前,您必须配置 SELinux。要在 Red Hat Enterprise Linux CoreOS(RHCOS)8 worker 上配置 SELinux,您必须 在每个节点上创建一个 MachineConfig
对象。
先决条件
在每个节点上为 hostpath 置备程序创建的持久性卷(PV)创建后端目录。
重要后备目录不能位于文件系统的根目录中,因为
/
分区在 RHCOS 上是只读的。例如,您可以使用/var/<directory_name>
,但不能使用/<directory_name>
。
流程
创建
MachineConfig
文件。例如:touch machineconfig.yaml
$ touch machineconfig.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 编辑该文件,确保包含希望 hostpath 置备程序在其中创建 PV 的目录。例如:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- 指定希望置备程序在其中创建 PV 的后备目录。该目录不得位于文件系统的根目录(
/
)中。
创建
MachineConfig
对象:oc create -f machineconfig.yaml -n <namespace>
$ oc create -f machineconfig.yaml -n <namespace>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow