Skip to content

Commit 1fb86ef

Browse files
cniackzPraveenrajmanibalamurugana
authored
Adding SELinux Documentation (#900)
### Objective: When `resuming` or `suspending` a drive in an `OpenShift` cluster, we may encounter a `relabel` issue. Various solutions exist for this problem, but here I am documenting the one we believe to be the best approach. --------- Co-authored-by: Praveen raj Mani <[email protected]> Co-authored-by: Bala FA <[email protected]> Co-authored-by: Bala FA <[email protected]>
1 parent 3629fb6 commit 1fb86ef

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

docs/openshift.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,28 @@ DirectPV runs under project `directpv` in Red Hat OpenShift. Project `directpv`
77
## Limitations
88
* DirectPV does not support volume snapshot feature as per CSI specification. DirectPV is specifically meant for use cases like MinIO where the data availability and resiliency is taken care by the application itself. Additionally, with the AWS S3 versioning APIs and internal healing, snapshots is not a requirement.
99
* DirectPV does not support `ReadWriteMany` volume access mode. The workloads using DirectPV run local to the node and are provisioned from local storage drives in the node. This allows the workloads to directly access data without any additional network hops, unlike remote volumes, network PVs, etc. The additional network hops may lead to poor performance and increases the complexity. With `ReadWriteOnce` access mode, DirectPV provides high performance storage for Pods.
10+
11+
## SELinux in OpenShift
12+
13+
In a SELinux enabled system, pod may fail to start due to `relabel failed` error on suspended volume. As the suspended volumes are read-only, Kublet tries to do SELinux relabeling by `lsetxattr` system call to write extended attributes. This issue is fixable by adding `spec.securityContext.seLinuxOptions.type: spc_t` at pod level or container level along with appropriate Security Context Constraints (SCCs) in place. A complete detail is available at https://access.redhat.com/solutions/7025337. The following example shows how to set `spc_t` SELinux settings at pod level:
14+
15+
```yaml
16+
apiVersion: v1
17+
kind: Pod
18+
metadata:
19+
name: sleep-pod
20+
spec:
21+
securityContext:
22+
seLinuxOptions:
23+
type: "spc_t" # Setting to fix the issue
24+
volumes:
25+
- name: sleep-volume
26+
persistentVolumeClaim:
27+
claimName: sleep-pvc
28+
containers:
29+
- name: sleep-container
30+
image: example.org/test/sleep:v0.0.1
31+
volumeMounts:
32+
- mountPath: "/mnt"
33+
name: sleep-volume
34+
```

0 commit comments

Comments
 (0)