6.2. 安装 NUMA Resources Operator

NUMA Resources Operator 部署资源,供您调度 NUMA 感知工作负载和部署。您可以使用 OpenShift Container Platform CLI 或 Web 控制台安装 NUMA Resources Operator。

6.2.1. 使用 CLI 安装 NUMA Resources Operator

作为集群管理员,您可以使用 CLI 安装 Operator。

先决条件

  • 安装 OpenShift CLI(oc)。
  • 以具有 cluster-admin 特权的用户身份登录。

流程

  1. 为 NUMA Resources Operator 创建命名空间:

    1. 将以下 YAML 保存到 nro-namespace.yaml 文件中:

      apiVersion: v1
      kind: Namespace
      metadata:
        name: openshift-numaresources
    2. 运行以下命令来创建 Namespace CR:

      $ oc create -f nro-namespace.yaml
  2. 为 NUMA Resources Operator 创建 operator 组:

    1. nro-operatorgroup.yaml 文件中保存以下 YAML:

      apiVersion: operators.coreos.com/v1
      kind: OperatorGroup
      metadata:
        name: numaresources-operator
        namespace: openshift-numaresources
      spec:
        targetNamespaces:
        - openshift-numaresources
    2. 运行以下命令来创建 OperatorGroup CR:

      $ oc create -f nro-operatorgroup.yaml
  3. 为 NUMA Resources Operator 创建订阅:

    1. 将以下 YAML 保存到 nro-sub.yaml 文件中:

      apiVersion: operators.coreos.com/v1alpha1
      kind: Subscription
      metadata:
        name: numaresources-operator
        namespace: openshift-numaresources
      spec:
        channel: "4.12"
        name: numaresources-operator
        source: redhat-operators
        sourceNamespace: openshift-marketplace
    2. 运行以下命令来创建 Subscription CR:

      $ oc create -f nro-sub.yaml

验证

  1. 通过检查 openshift-numaresources 命名空间中的 CSV 资源来验证安装是否成功。运行以下命令:

    $ oc get csv -n openshift-numaresources

    输出示例

    NAME                             DISPLAY                  VERSION   REPLACES   PHASE
    numaresources-operator.v4.12.2   numaresources-operator   4.12.2               Succeeded

6.2.2. 使用 Web 控制台安装 NUMA Resources Operator

作为集群管理员,您可以使用 Web 控制台安装 NUMA Resources Operator。

步骤

  1. 为 NUMA Resources Operator 创建命名空间:

    1. 在 OpenShift Container Platform web 控制台中,点 AdministrationNamespaces
    2. Create Namespace,在 Name 字段中输入 openshift-numaresources,然后点 Create
  2. 安装 NUMA Resources Operator:

    1. 在 OpenShift Container Platform Web 控制台中,点击 OperatorsOperatorHub
    2. 从可用的 Operator 列表中选择 NUMA Resources Operator,然后点 Install
    3. Installed Namespaces 字段中,选择 openshift-numaresources 命名空间,然后点 Install
  3. 可选:验证 NUMA Resources Operator 是否已成功安装:

    1. 切换到 OperatorsInstalled Operators 页面。
    2. 确保 openshift-numaresources 命名空间中列出 NUMA Resources OperatorStatusInstallSucceeded

      注意

      在安装过程中,Operator 可能会显示 Failed 状态。如果安装过程结束后有 InstallSucceeded 信息,您可以忽略这个 Failed 信息。

      如果 Operator 没有被成功安装,请按照以下步骤进行故障排除:

      • 进入 OperatorsInstalled Operators 页面,检查 Operator SubscriptionsInstall Plans 选项卡中的 Status 项中是否有任何错误。
      • 进入 WorkloadsPods 页面,检查 default 项目中的 pod 的日志。