4.9. Verifying pods after resolving a mismatch


Verify the security context constraint (SCC) and the SELinux label of both the pods by using the following verification steps.

Verification

  1. Verify that the same SCC is assigned to the first pod by running the following command:

    $ oc describe pod <pod_name_a> |grep -i scc 
    1
    1
    Replace <pod_name_a> with the name of the first pod.

    Example output

    openshift.io/scc: restricted

  2. Verify that the same SCC is assigned to first second pod by running the following command:

    $ oc describe pod <pod_name_b> |grep -i scc 
    1
    1
    Replace <pod_name_b> with the name of the second pod.

    Example output

    openshift.io/scc: restricted

  3. Verify that the same SELinux label is applied to first pod by running the following command:

    $ oc exec <pod_name_a> -- ls -laZ <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

    total 4
    drwxrwsrwx. 2 root       1000670000 system_u:object_r:container_file_t:s0:c10,c26 19 Aug 29 18:17 .
    dr-xr-xr-x. 1 root       root       system_u:object_r:container_file_t:s0:c10,c26 61 Aug 29 18:16 ..
    -rw-rw-rw-. 1 1000670000 1000670000 system_u:object_r:container_file_t:s0:c10,c26 29 Aug 29 18:17 test1
    [...]

  4. Verify that the same SELinux label is applied to second pod by running the following command:

    $ oc exec <pod_name_b> -- ls -laZ <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

    total 4
    drwxrwsrwx. 2 root       1000670000 system_u:object_r:container_file_t:s0:c10,c26 19 Aug 29 18:17 .
    dr-xr-xr-x. 1 root       root       system_u:object_r:container_file_t:s0:c10,c26 61 Aug 29 18:16 ..
    -rw-rw-rw-. 1 1000670000 1000670000 system_u:object_r:container_file_t:s0:c10,c26 29 Aug 29 18:17 test1
    [...]

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部