3.2.2. 清单示例
以下示例 YAML 文件使用 nodePlacement
、affinity(关联性)
和 tolerations(容限)
对象为 OpenShift Virtualization 组件自定义节点放置。
3.2.2.1. Operator Lifecycle Manager Subscription 对象
3.2.2.1.1. 示例:在 OLM 订阅对象中使用 nodeSelector 的节点放置
在本例中,配置了 nodeSelector
,OLM 将 OpenShift Virtualization Operator 放置到标记为 example.io/example-infra-key = example-infra-value
的节点上。
apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: hco-operatorhub namespace: openshift-cnv spec: source: redhat-operators sourceNamespace: openshift-marketplace name: kubevirt-hyperconverged startingCSV: kubevirt-hyperconverged-operator.v2.6.10 channel: "stable" config: nodeSelector: example.io/example-infra-key: example-infra-value
3.2.2.1.2. 示例:将容限放置在 OLM 订阅对象中
在本例中,为 OLM 部署 OpenShift Virtualization Operator 保留的节点使用 key=virtualization:NoSchedule
污点标记。只有具有与容限匹配的 pod 才会调度到这些节点。
apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: hco-operatorhub namespace: openshift-cnv spec: source: redhat-operators sourceNamespace: openshift-marketplace name: kubevirt-hyperconverged startingCSV: kubevirt-hyperconverged-operator.v2.6.10 channel: "stable" config: tolerations: - key: "key" operator: "Equal" value: "virtualization" effect: "NoSchedule"