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
* link:https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/managing_file_systems/mounting-file-systems_managing-file-systems#common-mount-options_mounting-file-systems[Common mount options]
dr-xr-xr-x. 1 root root system_u:object_r:container_file_t:s0:c15,c25 40 Feb 17 13:34 ..
80
80
[...]
81
81
----
82
-
. Compare both the outputs to check if there is a mismatch of SELinux context.
83
-
. When there is a mismatch of the SELinux content, create a new SCC and assign it to both PODs. To create a SCC see link: https://docs.openshift.com/container-platform/4.15/authentication/managing-security-context-constraints.html#security-context-constraints-creating_configuring-internal-oauth[Creating security context constraints].
84
-
. Update the SELinuxContext as shown in the following example:
85
-
+
86
-
.Example output
87
-
[source,terminal]
88
-
----
89
-
[...]
90
-
securityContext:privileged
91
-
seLinuxOptions:MustRunAs
92
-
level: "s0:cXX,cYY"
93
-
[...]
94
-
----
95
-
96
-
.Verification
97
-
98
-
. Verify that the same SCC is assigned to the first pod by running the following command:
99
-
+
100
-
[source,terminal]
101
-
[subs="+quotes"]
102
-
----
103
-
$ oc describe pod _<pod_name_A>_ |grep -i scc <1>
104
-
----
105
-
<1> Replace `_<pod_name_A>_` with the name of the first pod.
106
-
+
107
-
.Example output
108
-
[source,terminal]
109
-
----
110
-
openshift.io/scc: restricted
111
-
----
112
-
. Verify that the same SCC is assigned to first second pod by running the following command:
113
-
+
114
-
[source,terminal]
115
-
[subs="+quotes"]
116
-
----
117
-
$ oc describe pod _<pod_name_B>_ |grep -i scc <1>
118
-
----
119
-
<1> Replace `_<pod_name_B>_` with the name of the second pod.
120
-
+
121
-
.Example output
122
-
[source,terminal]
123
-
----
124
-
openshift.io/scc: restricted
125
-
----
126
-
. Verify that the same SELinux label is applied to first pod by running the following command:
127
-
+
128
-
[source,terminal]
129
-
[subs="+quotes"]
130
-
----
131
-
$ oc exec _<pod_name_A>_ -- ls -laZ _<PVC_mountpoint>_ <1>
132
-
----
133
-
<1> Replace `_<pod_name_A>_` with the name of the first pod and replace `_<PVC_mountpoint>_` with the mount point within the first pod.
134
-
+
135
-
.Example output
136
-
[source,terminal]
137
-
----
138
-
total 4
139
-
drwxrwsrwx. 2 root 1000670000 system_u:object_r:container_file_t:s0:c10,c26 19 Aug 29 18:17 .
140
-
dr-xr-xr-x. 1 root root system_u:object_r:container_file_t:s0:c10,c26 61 Aug 29 18:16 ..
141
-
-rw-rw-rw-. 1 1000670000 1000670000 system_u:object_r:container_file_t:s0:c10,c26 29 Aug 29 18:17 test1
142
-
[...]
143
-
----
144
-
. Verify that the same SELinux label is applied to second pod by running the following command:
145
-
+
146
-
[source,terminal]
147
-
[subs="+quotes"]
148
-
----
149
-
$ oc exec _<pod_name_B>_ -- ls -laZ _<PVC_mountpoint>_ <1>
150
-
----
151
-
<1> Replace `_<pod_name_B>_` with the name of the second pod and replace `_<PVC_mountpoint>_` with the mount point within the second pod.
152
-
+
153
-
.Example output
154
-
[source,terminal]
155
-
----
156
-
total 4
157
-
drwxrwsrwx. 2 root 1000670000 system_u:object_r:container_file_t:s0:c10,c26 19 Aug 29 18:17 .
158
-
dr-xr-xr-x. 1 root root system_u:object_r:container_file_t:s0:c10,c26 61 Aug 29 18:16 ..
159
-
-rw-rw-rw-. 1 1000670000 1000670000 system_u:object_r:container_file_t:s0:c10,c26 29 Aug 29 18:17 test1
160
-
[...]
161
-
----
82
+
. Compare both the outputs to check if there is a mismatch of SELinux context.
Update the SELinux context of the pods if a mismatch is found by using the following procedure.
10
+
11
+
.Procedure
12
+
13
+
. When there is a mismatch of the SELinux content, create a new security context constraint (SCC) and assign it to both pods. To create a SCC, see link:https://docs.openshift.com/container-platform/4.15/authentication/managing-security-context-constraints.html#security-context-constraints-creating_configuring-internal-oauth[Creating security context constraints].
14
+
. Update the SELinux context as shown in the following example:
0 commit comments