Using InfoScale in SELinux environments
If InfoScale CSI is used to provision volumes in an environment where SELinux is enabled in enforcing mode, the pod definition must explicitly specify a SELinux label. Files in the provisioned volume are then re-labeled and the containers associated with the pod are started in the appropriate SELinux context.
For example, the following
securityContext includes explicit SELinux options:
securityContext:
runAsUser: 1000
runAsGroup: 3000
fsGroup: 5000
fsGroupChangePolicy: "OnRootMismatch"
seLinuxOptions:
level: "s0:c447,c946"
To avoid weakening security posture, ensure that you do not reuse the same label for pods that are not expected to access the same volume. Without explicit labels specified, pods may lose access to previously created files, or files that were created from a different node, for the case of
ReadWriteMany volumes.
Related information