为何取消 Portieris 集群映像安全实施安装?

虚拟私有云 传统基础设施

排查导致集群主节点操作无法完成的、出现故障的 Webhook 应用程序相关问题。

Portieris 图像安全强制执行插件无法安装。 您将看到类似于以下内容的主状态:

Image security enforcement update canceled. CAE008: can't enable Portieris image security enforcement because the cluster already has a conflicting image admission controller installed. For more information, see the troubleshooting docs: 'https://ibm.biz/portieris_enable'

集群已安装有冲突的映像许可控制器,这将阻止安装映像安全实施集群附加组件。

当集群中有多个映像许可控制器时,pod 可能不会运行。

潜在的冲突图像许可控制器源包括:

  • 不推荐使用的容器映像安全性实施 Helm Chart。
  • 开放式源代码 Portieris 项目的先前手动安装。

识别并除去有冲突的图像许可控制器。

  1. 检查现有映像许可控制器。

    • 检查集群中是否有现有容器映像安全实施部署。 如果未返回任何输出,那么表示您没有部署。
        oc get deploy cise-ibmcloud-image-enforcement -n ibm-system
        ```
        示例输出
        ```sh {: pre}
        NAME                              READY   UP-TO-DATE   AVAILABLE   AGE
        cise-ibmcloud-image-enforcement   3/3     3            3           129m
        ```
    *   检查集群中是否有现有的 Portieris 部署。 如果未返回任何输出,那么表示您没有部署。
    ```sh {: pre}
        oc get deployment --all-namespaces -l app=portieries
        ```
        示例输出
        ```sh {: pre}
        NAMESPACE     NAME        READY   UP-TO-DATE   AVAILABLE   AGE
        portieris     portieris   3/3     3            3           8m8s
        ```
    
  2. 卸载有冲突的部署。

    oc delete deployment <deployment> -n <namespace>
    
  3. 通过检查集群是否不再具有图像许可控制器的突变 Webhook 配置,确认已移除有冲突的许可控制器。

    oc get MutatingWebhookConfiguration image-admission-config
    

    示例输出

    Error from server (NotFound): mutatingwebhookconfigurations.admissionregistration.k8s.io "image-admission-config" not found
    
  4. 通过运行 ibmcloud oc cluster image-security enable 命令,重试安装附加组件。