1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/microshift-checking-pods-mismatch.adoc

82 lines
2.5 KiB
Plaintext

// Module included in the following assemblies:
//
// * microshift_storage/understanding-persistent-storage-microshift.adoc
:_mod-docs-content-type: PROCEDURE
[id="microshift-checking-pods-mismatch_{context}"]
= Checking the pods for mismatch
Check if the pods have a mismatch by using the following procedure.
[IMPORTANT]
====
* Replace `_<pod_name_a>_` with the name of the first pod in the following procedure.
* Replace `_<pod_name_b>_` with the name of the second pod in the following procedure.
* Replace `_<pvc_mountpoint>_` with the mount point within the pods.
====
.Procedure
. List the mount point within the first pod by running the following command:
+
[source,terminal]
[subs="+quotes"]
----
$ oc get pods -n _<pod_name_a>_ -ojsonpath='{.spec.containers[*].volumeMounts[*].mountPath}' <1>
----
<1> Replace `_<pod_name_a>_` with the name of the first pod.
+
.Example output
[source,terminal]
----
/files /var/run/secrets/kubernetes.io/serviceaccount
----
. List the mount point within the second pod by running the following command:
+
[source,terminal]
[subs="+quotes"]
----
$ oc get pods -n _<pod_name_b>_ -ojsonpath='{.spec.containers[*].volumeMounts[*].mountPath}' <1>
----
<1> Replace `_<pod_name_b>_` with the name of the second pod.
+
.Example output
[source,terminal]
----
/files /var/run/secrets/kubernetes.io/serviceaccount
----
. Check the context and permissions inside the first pod by running the following command:
+
[source,terminal]
[subs="+quotes"]
----
$ oc rsh _<pod_name_a>_ ls -lZah _<pvc_mountpoint>_ <1>
----
<1> Replace `_<pod_name_a>_` with the name of the first pod and replace `_<pvc_mountpoint>_` with the mount point within the first pod.
+
.Example output
[source,terminal]
----
total 12K
dr-xr-xr-x. 1 root root system_u:object_r:container_file_t:s0:c398,c806 40 Feb 17 13:36 .
dr-xr-xr-x. 1 root root system_u:object_r:container_file_t:s0:c398,c806 40 Feb 17 13:36 ..
[...]
----
. Check the context and permissions inside the second pod by running the following command:
+
[source,terminal]
[subs="+quotes"]
----
$ oc rsh _<pod_name_b>_ ls -lZah _<pvc_mountpoint>_ <1>
----
<1> Replace `_<pod_name_b>_` with the name of the second pod and replace `_<pvc_mountpoint>_` with the mount point within the second pod.
+
.Example output
[source,terminal]
----
total 12K
dr-xr-xr-x. 1 root root system_u:object_r:container_file_t:s0:c15,c25 40 Feb 17 13:34 .
dr-xr-xr-x. 1 root root system_u:object_r:container_file_t:s0:c15,c25 40 Feb 17 13:34 ..
[...]
----
. Compare both the outputs to check if there is a mismatch of SELinux context.