7.6.2. 使用 Web 控制台启用功能集

您可以通过编辑 FeatureGate 自定义资源(CR)来使用 OpenShift Container Platform Web 控制台为集群中的所有节点启用功能集。

流程

启用功能集:

  1. 在 OpenShift Container Platform web 控制台中,切换到 AdministrationCustom Resource Definitions 页面。
  2. Custom Resource Definitions 页面中,点击 FeatureGate
  3. Custom Resource Definition Details 页面中,点 Instances 选项卡。
  4. 集群 功能门,然后点 YAML 选项卡。
  5. 编辑集群实例以添加特定的功能集:

    功能门自定义资源示例

    apiVersion: config.openshift.io/v1
    kind: FeatureGate
    metadata:
      name: cluster 1
    ....
    
    spec:
      featureSet: IPv6DualStackNoUpgrade 2

    1
    FeatureGate CR 的名称必须是 cluster
    2
    添加 IPv6DualStackNoUpgrade 功能集,以启用双栈网络模式。

    保存更改后,创建新的机器配置,机器配置池会更新,并在应用更改时在每个节点上调度。

    注意

    启用 IPv6DualStackNoUpgrade 功能集无法撤消,并防止更新。不建议在生产环境集群中使用此功能集。

验证

在节点返回就绪状态后,您可以通过查看节点上的 kubelet.conf 文件来验证是否启用了功能门。

  1. 从 web 控制台中的 Administrator 视角,导航到 ComputeNodes
  2. 选择一个节点。
  3. Node 详情页面中,点 Terminal
  4. 在终端窗口中,将根目录改为主机:

    sh-4.2# chroot /host
  5. 查看 kubelet.conf 文件:

    sh-4.2# cat /etc/kubernetes/kubelet.conf

    输出示例

     ...
    featureGates:
      InsightsOperatorPullingSCA: true,
      LegacyNodeRoleBehavior: false
     ...

    集群中启用了列为 true 的功能。

    注意

    列出的功能因 OpenShift Container Platform 版本而异。