10.4. control plane 机器集配置
使用 control plane 机器集自动管理和恢复集群中的 control plane 机器。
10.4.1. control plane 机器集自定义资源的 YAML 示例 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
使用此示例 YAML 作为在任何受支持的平台上创建或修改 control plane 机器集配置的起点。
ControlPlaneMachineSet CR YAML 文件示例
apiVersion: machine.openshift.io/v1
kind: ControlPlaneMachineSet
metadata:
name: cluster
namespace: openshift-machine-api
spec:
replicas: 3
selector:
matchLabels:
machine.openshift.io/cluster-api-cluster: <cluster_id>
machine.openshift.io/cluster-api-machine-role: master
machine.openshift.io/cluster-api-machine-type: master
state: Active
strategy:
type: RollingUpdate
template:
machineType: machines_v1beta1_machine_openshift_io
machines_v1beta1_machine_openshift_io:
failureDomains:
platform: <platform>
<platform_failure_domains>
metadata:
labels:
machine.openshift.io/cluster-api-cluster: <cluster_id>
machine.openshift.io/cluster-api-machine-role: master
machine.openshift.io/cluster-api-machine-type: master
spec:
providerSpec:
value:
<platform_provider_spec>
其中:
name: cluster-
指定
ControlPlaneMachineSetCR 的名称,即集群。不要更改这个值。 replicas: 3-
指定 control plane 机器的数量。仅支持具有三个 control plane 机器的集群,因此
replicas值为3。不支持水平扩展。不要更改这个值。 <cluster_id>指定基于置备集群时所设置的集群 ID 的基础架构 ID。在创建
ControlPlaneMachineSetCR 时,您必须指定这个值。如果已安装 OpenShift CLI(oc)软件包,您可以通过运行以下命令来获取基础架构 ID:$ oc get -o jsonpath='{.status.infrastructureName}{"\n"}' infrastructure clusterstate: Active指定 Operator 的状态。当状态为
Inactive时,Operator 无法正常工作。您可以通过将值设置为Active来激活 Operator。重要在激活 Operator 前,您必须确保
ControlPlaneMachineSetCR 配置适合您的集群要求。有关激活 Control Plane Machine Set Operator 的更多信息,请参阅"使用 control plane 机器集入门"。type: RollingUpdate-
指定集群的更新策略。允许的值是
OnDelete和RollingUpdate。默认值为RollingUpdate。有关更新策略的更多信息,请参阅"更新 control plane 配置"。 platform: <platform>- 指定云供应商平台名称。不要更改这个值。
<platform_failure_domains>- 指定集群的故障域配置。本节的格式和值特定于提供程序。如需更多信息,请参阅您的云供应商的故障域配置示例。
<platform_provider_spec>- 指定集群的供应商 spec 配置。本节的格式和值特定于提供程序。如需更多信息,请参阅云供应商的供应商规格示例。