请参阅此示例,在跨三个 vSphere 区域 部署的 主管 上置备 v1beta1 集群。

v1beta1 示例:跨 vSphere 区域的集群

以下示例 YAML 使用 v1beta1 API 在 vSphere Zone 拓扑中置备集群。此示例基于 v1beta1 示例:默认集群而构建。

此示例实施了多个工作节点池。每个节点池都引用一个映射到 vSphere 区域的故障域。有关 vSphere 区域的详细信息,请参见安装和配置 vSphere IaaS 控制平面

apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
  name: cluster-zoned
  namespace: tkg-cluster-ns
spec:
  clusterNetwork:
    services:
      cidrBlocks: ["198.51.100.0/12"]
    pods:
      cidrBlocks: ["192.0.2.0/16"]
    serviceDomain: "cluster.local"
  topology:
    class: tanzukubernetescluster
    version: v1.25.7---vmware.3-fips.1-tkg.1
    controlPlane:
      replicas: 3
    workers:
      #muliple node pools are used
      machineDeployments:
        - class: node-pool
          name: node-pool-1
          replicas: 3
          #failure domain the machines will be created in
          #maps to a vSphere Zone; name must match exactly
          failureDomain: vsphere-zone1
        - class: node-pool
          name: node-pool-2
          replicas: 3
          #failure domain the machines will be created in
          #maps to a vSphere Zone; name must match exactly
          failureDomain: vsphere-zone2
        - class: node-pool
          name: node-pool-3
          replicas: 3
          #failure domain the machines will be created in
          #maps to a vSphere Zone; name must match exactly
          failureDomain: vsphere-zone3
    variables:
      - name: vmClass
        value: guaranteed-medium
      - name: storageClass
        value: tkg-storage-policy