請參閱此範例,在跨三個 vSphere 區域 部署的 主管 上佈建 v1beta1 叢集。

v1beta1 範例:跨 vSphere 區域的叢集

以下範例 YAML 使用 v1beta1 API 在 vSphere 區域拓撲中佈建叢集。此範例根據 v1beta1 範例:預設叢集而建置。

此範例實作了多個 worker 節點集區。每個節點集區都參考一個對應到 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