用户集群配置文件 1.30

本页面介绍了 Google Distributed Cloud 用户集群配置文件中的字段。

生成配置文件模板

如果您使用 gkeadm 创建管理员工作站,则 gkeadm 会为您的用户集群配置文件生成一个模板。此外,gkeadm 还为您填写了一些字段。

如果您未使用 gkeadm 创建管理员工作站,则可以使用 gkectl 为用户集群配置文件生成模板。

如需为用户集群配置文件生成模板,请运行以下命令:

gkectl create-config cluster --config=OUTPUT_FILENAME --gke-on-prem-version=VERSION

替换以下内容:

OUTPUT_FILENAME:您为生成的模板选择的路径。如果省略此标志,则 gkectl 将该文件命名为 user-cluster.yaml,并将其放在当前目录中。

VERSION:所需的版本号。例如:gkectl create-config cluster --gke-on-prem-version=1.10.0-gke.8

模板

apiVersion: v1
kind: UserCluster
# (Required) A unique name for this cluster
name: ""
# (Required) GKE on-prem version (example: 1.3.0-gke.16)
gkeOnPremVersion: ""
# # (Optional) Specify the prepared secret configuration which can be added or edited
# # only during cluster creation
# preparedSecrets:
#   # reference to the secret namespace for a group of secrets; it should be prepared
#   # beforehand by 'gkectl prepare secrets' command; it is immutable.
#   namespace: ""
# (Optional) Enable controlplane v2. Default is true
enableControlplaneV2: true
# # (Optional) vCenter configuration (default: inherit from the admin cluster)
# vCenter:
#   # # (Optional) vCenter server to use. Controlplane v2 needs to be enabled when the address
#   # # is different from that in the admin cluster configuration
#   # address: ""
#   datacenter: ""
#   cluster: ""
#   # Resource pool to use. Specify [VSPHERE_CLUSTER_NAME]/Resources to use the default
#   # resource pool
#   resourcePool: ""
#   # Storage policy to use for cluster VM storage and default StorageClass. Do not
#   # specify it together with datastore
#   storagePolicyName: ""
#   # # Datastore to use for cluster VM storage and default StorageClass. Do not specify
#   # # it together with storagePolicyName
#   # datastore: ""
#   # Provide the path to vCenter CA certificate pub key for SSL verification
#   caCertPath: ""
#   # The credentials to connect to vCenter
#   credentials:
#     # reference to external credentials file
#     fileRef:
#       # read credentials from this file
#       path: ""
#       # entry in the credential file
#       entry: ""
#     # # (Optional) reference to the credential secret; it should be prepared beforehand
#     # # by 'gkectl prepare secrets' command
#     # secretRef:
#     #   # The version for this prepared secret; it can be specified as 'latest' or integer
#     #   # string; it will be defaulted to latest version if it is not specified when creating
#     #   # a cluster; it is allowed to be empty when creating a cluster; it is not allowed
#     #   # to be empty when rotating credentials
#     #   version: ""
#   # (Optional) vSphere folder where cluster VMs will be located. Defaults to the the
#   # datacenter wide folder if unspecified.
#   folder: ""
# # (Optional) The absolute or relative path to the GCP service account key for pulling
# # GKE images (default: inherit from the admin cluster)
# componentAccessServiceAccountKeyPath: ""
# # (Optional) The prepared credentials for component access service account key
# componentAccessServiceAccountKey:
#   # reference to the credential secret; it should be prepared beforehand by 'gkectl
#   # prepare secrets' command
#   secretRef:
#     # The version for this prepared secret; it can be specified as 'latest' or integer
#     # string; it will be defaulted to latest version if it is not specified when creating
#     # a cluster; it is allowed to be empty when creating a cluster; it is not allowed
#     # to be empty when rotating credentials
#     version: ""
# # (Optional) Use a private registry to host GKE images
# privateRegistry:
#   # Do not include the scheme with your registry address
#   address: ""
#   credentials:
#     # reference to external credentials file
#     fileRef:
#       # read credentials from this file
#       path: ""
#       # entry in the credential file
#       entry: ""
#     # # (Optional) reference to the credential secret; it should be prepared beforehand
#     # # by 'gkectl prepare secrets' command
#     # secretRef:
#     #   # The version for this prepared secret; it can be specified as 'latest' or integer
#     #   # string; it will be defaulted to latest version if it is not specified when creating
#     #   # a cluster; it is allowed to be empty when creating a cluster; it is not allowed
#     #   # to be empty when rotating credentials
#     #   version: ""
#   # The absolute or relative path to the CA certificate for this registry
#   caCertPath: ""
# (Required) Network configuration; vCenter section is optional and inherits from
# the admin cluster if not specified
network:
  # (Required when using "static" ipMode.type; "Seesaw" loadBalancer.kind; or setting
  # enableControlplaneV2 to "true") This section overrides ipMode.ipBlockFilePath
  # values when ipMode.type=static. It's also used for control-plane nodes when controlplane
  # v2 is enabled and seesaw nodes
  hostConfig:
    # List of DNS servers
    dnsServers:
    - ""
    # List of NTP servers
    ntpServers:
    - ""
    # # List of DNS search domains
    # searchDomainsForDNS:
    # - ""
  ipMode:
    # (Required) Define what IP mode to use ("dhcp" or "static")
    type: static
    # (Required when using "static" mode) The absolute or relative path to the yaml
    # file to use for static IP allocation. Hostconfig part will be overwritten by
    # network.hostconfig if specified
    ipBlockFilePath: ""
  # (Required) The Kubernetes service CIDR range for the cluster. Must not overlap
  # with the pod CIDR range
  serviceCIDR: 10.96.0.0/20
  # (Required) The Kubernetes pod CIDR range for the cluster. Must not overlap with
  # the service CIDR range
  podCIDR: 192.168.0.0/16
  vCenter:
    # vSphere network name
    networkName: ""
  # # (Optional) List of additional node network interfaces feature enabled by multipleNetworkInterfaces
  # additionalNodeInterfaces:
  # # vSphere network name
  # - networkName: ""
  #   # (Required) Define what IP mode to use ("dhcp" "static" or "none")
  #   type: static
  #   # # (Required when using "static" mode) The absolute or relative path to the yaml file
  #   # # to use for static IP allocation. Hostconfig part will be overwritten by network.hostconfig
  #   # # if specified
  #   # ipBlockFilePath: ""
  # (Required when setting enableControlplaneV2 to "true") Specify the IPs to use
  # for control-plane nodes when controlplane v2 is enabled. 1 IP is needed for non-HA
  # cluster and 3 for HA cluster. Non-empty controlPlaneIPBlock is not allowed when
  # controlplane v2 is disabled
  controlPlaneIPBlock:
    netmask: ""
    gateway: ""
    ips:
    - ip: ""
      hostname: ""
    - ip: ""
      hostname: ""
    - ip: ""
      hostname: ""
# (Required) Load balancer configuration
loadBalancer:
  # (Required) The VIPs to use for load balancing
  vips:
    # Used to connect to the Kubernetes API
    controlPlaneVIP: ""
    # Shared by all services for ingress traffic
    ingressVIP: ""
  # (Required) Which load balancer to use "F5BigIP" "Seesaw" "ManualLB" or "MetalLB".
  # Uncomment the corresponding field below to provide the detailed spec
  kind: MetalLB
  # # (Required when using "ManualLB" kind) Specify pre-defined nodeports
  # manualLB:
  #   # NodePort for ingress service's http (only needed for user cluster)
  #   ingressHTTPNodePort: 30243
  #   # NodePort for ingress service's https (only needed for user cluster)
  #   ingressHTTPSNodePort: 30879
  #   # NodePort for konnectivity server service (only needed for controlplane v1 user
  #   # cluster)
  #   konnectivityServerNodePort: 30563
  #   # NodePort for control plane service (not needed for HA admin cluster or controlplane
  #   # V2 user cluster)
  #   controlPlaneNodePort: 30562
  # # (Required when using "F5BigIP" kind) Specify the already-existing partition and
  # # credentials
  # f5BigIP:
  #   address: ""
  #   credentials:
  #     # reference to external credentials file
  #     fileRef:
  #       # read credentials from this file
  #       path: ""
  #       # entry in the credential file
  #       entry: ""
  #     # # (Optional) reference to the credential secret; it should be prepared beforehand
  #     # # by 'gkectl prepare secrets' command
  #     # secretRef:
  #     #   # The version for this prepared secret; it can be specified as 'latest' or integer
  #     #   # string; it will be defaulted to latest version if it is not specified when creating
  #     #   # a cluster; it is allowed to be empty when creating a cluster; it is not allowed
  #     #   # to be empty when rotating credentials
  #     #   version: ""
  #   partition: ""
  #   # # (Optional) Specify a pool name if using SNAT
  #   # snatPoolName: ""
  # # (Only used in 1.16 and older versions for using "Seesaw" kind) Specify the Seesaw
  # # configs
  # seesaw:
  #   # (Required) The absolute or relative path to the yaml file to use for IP allocation
  #   # for LB VMs. Must contain one or two IPs. Hostconfig part will be overwritten by
  #   # network.hostconfig if specified.
  #   ipBlockFilePath: ""
  #   # (Required) The Virtual Router IDentifier of VRRP for the Seesaw group. Must be
  #   # between 1-255 and unique in a VLAN.
  #   vrid: 0
  #   # (Required) The IP announced by the master of Seesaw group
  #   masterIP: ""
  #   # (Required) The number CPUs per machine
  #   cpus: 4
  #   # (Required) Memory size in MB per machine
  #   memoryMB: 3072
  #   # (Optional) Network that the LB interface of Seesaw runs in (default: cluster network)
  #   vCenter:
  #     # vSphere network name
  #     networkName: ""
  #   # (Optional) Run two LB VMs to achieve high availability (default: false)
  #   enableHA: false
  #   # (Optional) Avoid using VRRP MAC and rely on gratuitous ARP to do failover. In
  #   # this mode MAC learning is not needed but the gateway must refresh arp table based
  #   # on gratuitous ARP. It's recommended to turn this on to avoid MAC learning configuration.
  #   # In vsphere 7+ it must be true to enable HA. It is supported in GKE on-prem version
  #   # 1.7+. (default: false)
  #   disableVRRPMAC: true
  # (Required when using "MetalLB" kind in user clusters) Specify the MetalLB configs
  metalLB:
    # (Required) A list of non-overlapping IP pools used by load balancer typed services.
    # Must include ingressVIP of the cluster.
    addressPools:
    # (Required) Name of the address pool
    - name: address-pool-1
      # (Required) The addresses that are part of this pool. Each address must be
      # either in the CIDR form (1.2.3.0/24) or range form (1.2.3.1-1.2.3.5).
      addresses:
      - ""
      # # (Optional) Avoid using IPs ending in .0 or .255. This avoids buggy consumer devices
      # # mistakenly dropping IPv4 traffic for those special IP addresses (default: false)
      # avoidBuggyIPs: false
      # # (Optional) Prevent IP addresses to be automatically assigned from this pool (default:
      # # false)
      # manualAssign: false
# (Optional) Enable dataplane v2
enableDataplaneV2: true
# # (Optional) DataplaneV2 configuration
# dataplaneV2:
#   # (Optional) Specify dataplanev2 forward mode (snat or dsr)
#   forwardMode: snat
# # (Optional) Enable support for multiple networking interfaces
# multipleNetworkInterfaces: false
# # (Optional) Enable advanced dataplane v2 networking features such as Egress NAT Gateway
# # and it requires enableDataplaneV2 to be set
# advancedNetworking: false
# # (Optional) Disable installation of bundled ingress
# disableBundledIngress: false
# # (Optional) Storage specification for the cluster
# storage:
#   # # Whether to disable vSphere CSI components deployment. The feature is enabled by
#   # # default
#   # vSphereCSIDisabled: false
# (Optional) User cluster master nodes must have either 1 or 3 replicas (default:
# 4 CPUs; 8192 MB memory; 1 replica)
masterNode:
  cpus: 4
  memoryMB: 8192
  # How many machines of this type to deploy
  replicas: 3
  # # Enable auto resizing on master
  # autoResize:
  #   # Whether to enable auto resize for master. Defaults to false.
  #   enabled: false
  # vsphere:
  #   # (Optional) vSphere datastore the master nodes will be created on (default: vCenter.datastore)
  #   datastore: ""
  #   # (Optional) Storage policy to use for user master VM storage and datadisk (default:
  #   # vCenter.storagePolicyName)
  #   storagePolicyName: ""
# (Required) List of node pools. The total un-tainted replicas across all node pools
# must be greater than or equal to 3
nodePools:
- name: pool-1
  # # (Optional) GKE on-prem version (example: 1.13.0-gke.16); it will be defaulted to
  # # cluster version if it is not specified; it can be used to roll back a node pool
  # # if it is specified as the previous node pool version
  # gkeOnPremVersion: ""
  cpus: 4
  memoryMB: 8192
  # How many machines of this type to deploy
  replicas: 3
  # # (Optional) boot disk size; must be at least 40 (default: 40)
  # bootDiskSizeGB: 40
  # (Optional) Specify the type of OS image; available options can be set to "ubuntu"
  # "ubuntu_containerd" "cos" "ubuntu_cgv2" "cos_cgv2" or "windows". Default is "ubuntu_containerd".
  osImageType: ubuntu_cgv2
  # # (Required when using "windows" osImageType) Specify the OS image template in vCenter
  # osImage: ""
  # # Labels to apply to Kubernetes Node objects
  # labels: {}
  # # Taints to apply to Kubernetes Node objects
  # taints:
  # - key: ""
  #   value: ""
  #   effect: ""
  # vsphere:
  #   # (Optional) vSphere datastore the node pool will be created on (default: vCenter.datastore)
  #   datastore: ""
  #   # (Optional) Storage policy to use for nodepool (default: vCenter.storagePolicyName)
  #   storagePolicyName: ""
  #   # (Optional) Existing host groups used for VM/Host affinity. VM groups will be created
  #   # to bind with these host groups via vm-host affinity rules
  #   hostgroups:
  #   - ""
  #   # (Optional) vSphere tags to be attached to the virtual machines in the node pool.
  #   # It is supported in GKE on-prem version 1.7+
  #   tags:
  #   - category: ""
  #     name: ""
  # # (Optional) Horizontal autoscaling for the nodepool; replicas should not be edited
  # # while updating the nodepool if this is turned on
  # autoscaling:
  #   # min number of replicas in the NodePool
  #   minReplicas: 0
  #   # max number of replicas in the NodePool
  #   maxReplicas: 0
  # (Optional) Allow traffic of LoadBalancer typed services flow through nodes of
  # this pool. This is only needed for MetalLB mode. Set it to true for at least one
  # node pool in the cluster. Default is false.
  enableLoadBalancer: true
  # # (Optional/Preview) Update strategy for this node pool (it will overwrite nodePoolUpdatePolicy.updateStrategy
  # # setting)
  # updateStrategy:
  #   # # (Optional/Preview) Rolling update strategy for machines of the node pool
  #   # rollingUpdate:
  #   #   # # (Optional/Preview) The maximum number of machines that can be scheduled simultaneously
  #   #   # # during update/upgrade (default: 1)
  #   #   # maxSurge: "1"
# Spread nodes across at least three physical hosts (requires at least three hosts)
antiAffinityGroups:
  # Set to false to disable DRS rule creation
  enabled: true
# # (Optional/Preview) Track user cluster VMs with vSphere tags
# enableVMTracking: false
# # Configure node pool update policy for the cluster
# nodePoolUpdatePolicy:
#   # (Optional/Preview) Number of node pools to update at a time. 0 means no limit.
#   # 1 means updating one by one.
#   maximumConcurrentNodePoolUpdate: 0
#   # # (Optional/Preview) Cluster wide default node pool update strategy. A node pool will
#   # # use this setting if it doesn't set specific updateStrategy
#   # updateStrategy:
#   #   # # (Optional/Preview) Rolling update strategy for machines of the node pool
#   #   # rollingUpdate:
#   #   #   # # (Optional/Preview) The maximum number of machines that can be scheduled simultaneously
#   #   #   # # during update/upgrade (default: 1)
#   #   #   # maxSurge: "1"
# # (Optional) Configure additional authentication.
# authentication:
#   # (Optional) Provide an additional serving certificate for the API server
#   sni:
#     certPath: ""
#     keyPath: ""
# # (Optional) Configure BinAuthz to enable deploy-time security control to the container
# # images.
# binaryAuthorization:
#   # (Optional) Set value to string "disabled" or "project_singleton_policy_enforce".
#   # Default is "disabled".
#   evaluationMode: ""
# (Required) Specify which GCP project to register your GKE OnPrem cluster to
gkeConnect:
  projectID: ""
  # # (Optional) The location of the GKE Hub and Connect service where the cluster is
  # # registered to. It can be any GCP region or "global". Default to "global" when unspecified.
  # location: us-central1
  # The absolute or relative path to the key file for a GCP service account used to
  # register the cluster
  registerServiceAccountKeyPath: ""
  # # (Optional) The prepared credentials for register service account key
  # registerServiceAccountKey:
  #   # reference to the credential secret; it should be prepared beforehand by 'gkectl
  #   # prepare secrets' command
  #   secretRef:
  #     # The version for this prepared secret; it can be specified as 'latest' or integer
  #     # string; it will be defaulted to latest version if it is not specified when creating
  #     # a cluster; it is allowed to be empty when creating a cluster; it is not allowed
  #     # to be empty when rotating credentials
  #     version: ""
# # (Optional) Specify if you wish to explicitly enable/disable the cloud hosted gkeonprem
# # API to enable/disable cluster lifecycle management from gcloud UI and Terraform.
# gkeOnPremAPI:
#   enabled: false
# (Required) Specify which GCP project to connect your logs and metrics to
stackdriver:
  # The project ID for logs and metrics. It should be the same with gkeconnect.projectID.
  projectID: ""
  # A GCP region where you would like to store logs and metrics for this cluster.
  clusterLocation: us-central1
  # The absolute or relative path to the key file for a GCP service account used to
  # send logs and metrics from the cluster
  serviceAccountKeyPath: ""
  # # (Optional) The prepared credentials for stackdriver service account key
  # serviceAccountKey:
  #   # reference to the credential secret; it should be prepared beforehand by 'gkectl
  #   # prepare secrets' command
  #   secretRef:
  #     # The version for this prepared secret; it can be specified as 'latest' or integer
  #     # string; it will be defaulted to latest version if it is not specified when creating
  #     # a cluster; it is allowed to be empty when creating a cluster; it is not allowed
  #     # to be empty when rotating credentials
  #     version: ""
  # (Optional) Disable vsphere resource metrics collection from vcenter.  False by
  # default
  disableVsphereResourceMetrics: false
# # (Optional/Preview) Configure the GKE usage metering feature
# usageMetering:
#   bigQueryProjectID: ""
#   # The ID of the BigQuery Dataset in which the usage metering data will be stored
#   bigQueryDatasetID: ""
#   # The absolute or relative path to the key file for a GCP service account used by
#   # gke-usage-metering to report to BigQuery
#   bigQueryServiceAccountKeyPath: ""
#   # # (Optional) The prepared credentials for big query service account key
#   # bigQueryServiceAccountKey:
#   #   # reference to the credential secret; it should be prepared beforehand by 'gkectl
#   #   # prepare secrets' command
#   #   secretRef:
#   #     # The version for this prepared secret; it can be specified as 'latest' or integer
#   #     # string; it will be defaulted to latest version if it is not specified when creating
#   #     # a cluster; it is allowed to be empty when creating a cluster; it is not allowed
#   #     # to be empty when rotating credentials
#   #     version: ""
#   # Whether or not to enable consumption-based metering
#   enableConsumptionMetering: false
# (Optional) Configure kubernetes apiserver audit logging
cloudAuditLogging:
  # The project ID for logs and metrics. It should be the same with gkeconnect.projectID.
  projectID: ""
  # A GCP region where you would like to store audit logs for this cluster.
  clusterLocation: us-central1
  # The absolute or relative path to the key file for a GCP service account used to
  # send audit logs from the cluster
  serviceAccountKeyPath: ""
  # # (Optional) The prepared credentials for cloud audit logging service account key
  # serviceAccountKey:
  #   # reference to the credential secret; it should be prepared beforehand by 'gkectl
  #   # prepare secrets' command
  #   secretRef:
  #     # The version for this prepared secret; it can be specified as 'latest' or integer
  #     # string; it will be defaulted to latest version if it is not specified when creating
  #     # a cluster; it is allowed to be empty when creating a cluster; it is not allowed
  #     # to be empty when rotating credentials
  #     version: ""
# Enable auto repair for the cluster
autoRepair:
  # Whether to enable auto repair feature. Set false to disable.
  enabled: true
# # Encrypt Kubernetes secrets at rest
# secretsEncryption:
#   # Secrets Encryption Mode. Possible values are: GeneratedKey
#   mode: GeneratedKey
#   # GeneratedKey Secrets Encryption config
#   generatedKey:
#     # # key version
#     # keyVersion: 1
#     # # disable secrets encryption
#     # disabled: false

必填字段和默认值

如果某个字段被标记为“必需”,则在完成的配置文件中必须为该字段填写值。

部分字段是条件性必填字段。例如,如果 loadBalancer.kind 等于 MetalLB,则 loadBalancer.metalLB.addressPools 是必填字段。

如果为某个字段提供了默认值,则在您没有为该字段输入任何内容时,集群将使用该值。您可以通过输入值来替换默认值。

如果某个字段未标记为“必需”且未提供默认值,则该字段为可选字段。您可以在该字段与您有关时进行填写,但不是必须填写。

填写配置文件

在配置文件中,按照以下部分的说明输入字段值。

name

必需
字符串

您为用户集群选择的名称。该名称必须:

  • 最多包含 40 个字符
  • 只能包含小写字母数字字符或连字符 (-)
  • 以字母字符开头
  • 以字母数字字符结尾

示例:

name: "my-user-cluster"

gkeOnPremVersion

必需
可变
字符串

用户集群的 Google Distributed Cloud 版本。

示例:

gkeOnPremVersion: "1.29.0-gke.1456"

preparedSecrets.namespace

如果您想使用准备好的凭据,请填写此字段。否则,请移除此字段或将其注释掉。

不可变
字符串
可能的值:以“gke-onprem-secrets-”开头的字符串

管理员集群中 Kubernetes 命名空间的名称,其中为用户集群保留了准备好的 Secret。

示例:

preparedSecrets:
  namespace: "gke-onprem-secrets-alice"

enableControlplaneV2

不可变
布尔值
预填充值:true
默认值:true

在 1.30 及更高版本中,新用户集群必须使用 Controlplane V2。如果您在配置文件中添加此字段,则必须将其设置为 true。使用 Controlplane V2 时,用户集群的控制平面在用户集群本身的一个或多个节点上运行。Controlplane V2 的优势包括:

  • 管理员集群和用户集群之间的架构一致性。

  • 故障隔离。管理员集群故障不会影响用户集群。

  • 运维分离。管理员集群升级不会导致用户集群停机。

  • 部署分离。您可以将管理员集群和用户集群放在不同的故障域或地理站点中。例如,边缘位置中的用户集群可能与管理员集群位于不同的地理站点。

不可变
布尔值
预填充值:true
默认值:true

如需启用 Controlplane V2,请在用户集群配置文件中将 enableControlplaneV2 设置为 true 或从中移除该设置。否则,请将其设置为 false。 使用 Controlplane V2 时,用户集群的控制平面在用户集群本身的一个或多个节点上运行。 未启用 Controlplane V2 时,用户集群控制平面在管理员集群中运行。

我们建议您启用 Controlplane V2。

示例:

enableControlplaneV2: true

vCenter

本部分包含有关您的 vSphere 环境以及与 vCenter Server 的连接的信息。

如果您希望本部分中的某字段与您为管理员集群指定的字段相同,请移除该字段或将其注释掉。

如果您希望某字段与您为管理员集群指定的字段不同,请在这里填写该字段。您在 vCenter 部分中填写的任何字段都将覆盖管理员集群配置文件中的相应字段。

vCenter.address

不可变
字符串
默认值:继承自管理员集群

要用于用户集群的 vCenter Server 实例的 IP 地址或主机名。

如需了解详情,请参阅查找 vCenter 服务器地址

如果您指定的值与管理员集群使用的 vCenter Server 实例不同,则必须启用 Controlplane V2,并且您必须提供 network.vCenter.networkName 的值以及 vCenter 部分中所有必填字段的值。

示例:

vCenter:
  address: "203.0.113.101"
vCenter:
  address: "my-vcenter-server-2.my-domain.example"

vCenter.datacenter

不可变
字符串
默认值:继承自管理员集群

vSphere 数据中心的相对路径。

如果为此字段指定了值,则还必须指定:

  • vCenter.networkName
  • vCenter.datastorevCenter.storagePolicyName
  • vCenter.clustervCenter.resourcePool

您指定的值相对于名为 / 的根文件夹。

如果数据中心位于根文件夹中,则该值是数据中心的名称。

示例:

vCenter:
  datacenter: "my-uc-data-center"

否则,该值是相对路径,其中包含一个或多个文件夹以及数据中心的名称。

示例:

vCenter:
  datacenter: "data-centers/data-center-2"

vCenter.cluster

不可变
字符串
默认值:继承自管理员集群

vSphere 集群的相对路径,代表用户集群虚拟机将在其中运行的 ESXi 主机。此 vSphere 集群代表 vCenter 数据中心内的物理 ESXi 主机的一部分。

如果为此字段指定了值,则还必须指定:

  • vCenter.networkName
  • vCenter.datacenter
  • vCenter.datastorevCenter.storagePolicyName

您指定的值相对于 /.../DATA_CENTER/vm/

如果 vSphere 集群位于 /.../DATA_CENTER/vm/ 文件夹中,则该值是 vSphere 集群的名称

示例:

vCenter:
  cluster: "my-uc-vsphere-cluster"

否则,该值是相对路径,其中包含一个或多个文件夹以及 vSphere 集群的名称。

示例:

vCenter:
  cluster: "clusters/vsphere-cluster-2"

vCenter.resourcePool

不可变
字符串
默认值:继承自管理员集群

用户集群虚拟机的 vCenter 资源池

如果您要使用默认资源池,请将此字段设置为 VSPHERE_CLUSTER/Resources

示例:

vCenter:
  resourcePool: "my-uc-vsphere-cluster/Resources"

您指定的值相对于 /.../DATA_CENTER/host/.../VSPHERE_CLUSTER/Resources/

如果资源池是 /.../DATA_CENTER/host/.../VSPHERE_CLUSTER/Resources/ 的直接子级,则该值是资源池的名称。

示例:

vCenter:
  resourcePool: "my-uc-resource-pool"

否则,该值是相对路径,其中包含两个或更多个资源池。

示例:

vCenter:
  resourcePool: "uc-resource-pool-1/uc-resource-pool-2"

vCenter.datastore

可选
不可变
字符串
默认值:继承自管理员集群

用户集群的 vSphere 数据存储区的名称。

您指定的值必须是名称,而不是路径。请勿在值中包含任何文件夹。

示例:

vCenter:
  datastore: "my-datastore"

如果为此字段指定了值,则请勿为 vCenter.storagePolicyName 指定值。vCenter.datastore 字段不可变,但在将数据存储区迁移到基于存储政策的管理 (SPBM) 时,您可以将该字段设置为空字符串。

vCenter.storagePolicyName

可选
不可变
字符串

集群节点的虚拟机存储政策的名称。

您还可以为特定节点池中的节点指定虚拟机存储政策。但是,此处指定的政策适用于没有自己的政策的任何节点池。

如需了解详情,请参阅配置存储政策

如果为此字段指定了值,则请勿为 vCenter.datastore 指定值。

vCenter.caCertPath

可变
字符串
默认值:继承自管理员集群

您的 vCenter 服务器的 CA 证书的路径。 如需了解详情,请参阅获取 vCenter CA 证书

示例:

vCenter:
  caCertPath: "/usr/local/google/home/me/certs/vcenter-ca-cert-2.pem"

如需了解如何更新此字段,请参阅更新 vCenter 证书引用

vCenter.credentials.fileRef.path

可变
字符串
默认值:继承自管理员集群

如果您为 preparedSecrets.namespace 提供了值,则请不要为此字段提供值。而是为 vCenter.credentials.secretRef.version 提供值。

凭据配置文件的路径,该文件包含您的 vCenter 用户账号的用户名和密码。用户账号必须具有 Administrator 角色或同等特权。请参阅 vSphere 要求

您可以使用 gkectl update credentials 在现有集群中更新此字段。如需了解详情,请参阅轮替服务账号密钥

如需了解如何更新 vCenter 凭据,请参阅更新集群凭据

示例:

vCenter:
  credentials:
    fileRef:
      path: "my-config-directory/my-credentials-2.yaml"

vCenter.credentials.fileRef.entry

可变
字符串
默认值:继承自管理员集群

凭据配置文件中的凭据块名称,该文件包含您的 vCenter 用户账号的用户名和密码。

示例:

vCenter:
  credentials:
    fileRef:
      entry: "vcenter-credentials-2"

vCenter.credentials.secretRef.version

字符串
可能的值:整数字符串或“latest”
默认值:“latest”

如果您为 preparedSecrets.namespace 提供了值,请填写此字段。否则,请移除此字段或将其注释掉。

管理员集群中准备好的 Secret 的版本,其中包含您要用于用户集群的 vCenter Server 实例的用户名和密码。

示例:

vCenter:
  credentials:
    secretRef:
      version: "1"

vCenter.folder

不可变
字符串
默认值:继承自管理员集群

您已创建的 vSphere 文件夹的相对路径。此文件夹用于存放用户集群虚拟机。

如果未指定值,则用户集群虚拟机将放在 /.../DATA_CENTER/vm/ 中。

如果指定了值,则它相对于 /.../DATA_CENTER/vm/

该值可以是文件夹的名称。

示例:

vCenter:
  folder: "my-uc-folder"

或者,该值可以是相对路径,其中包含多个文件夹。

示例:

vCenter:
  folder: "folders/folder-2"

componentAccessServiceAccountKeyPath

可变
字符串
默认值:继承自管理员集群

组件访问服务账号的 JSON 密钥文件的路径。

示例:

componentAccessServiceAccountKeyPath: "my-key-folder/uc-access-key.json"

componentAccessServiceAccountKey.secretRef.version

可变
字符串
可能的值:整数字符串或“latest”
默认值:“latest”

管理员集群中准备好的 Secret 的版本,其中包含组件访问服务账号的 JSON 密钥。

示例:

componentAccessServiceAccountKey:
  secretRef:
    version: "1"

privateRegistry

仅当管理员集群使用私有注册表并且您希望用户集群使用其他私有注册表时,才填写此部分。否则,请移除此部分或将其注释掉。

如果您希望配置一些与管理员集群设置不同的设置:

  • 不同的用户名、密码、证书

  • 仅适用于控制平面 V2)不同的私有注册表地址

在此处填写 privateRegistry 字段。在集群创建和更新期间,系统会获取新设置。

privateRegistry.address

不可变
字符串
默认值:继承自管理员集群

运行您的私有 Docker 注册表的机器的 IP 地址或 FQDN(完全限定域名)。

示例:

privateRegistry:
  address: "203.0.113.10"
privateRegistry:
  address: "fqdn.example.com"

privateRegistry.credentials.fileRef.path

可变
字符串
默认值:继承自管理员集群

如果您打算将准备好的 Secret 用于私有注册表,请勿为此字段提供值。而是为 privateRegistry.credentials.secretRef.version 提供值。

凭据配置文件的路径,该文件包含 Google Distributed Cloud 可用于访问您的私有 Docker 仓库的账号的用户名和密码。

示例:

privateRegistry:
  credentials:
    fileRef:
      path: "my-config-folder/admin-creds.yaml"

privateRegistry.credentials.fileRef.entry

可变
字符串
默认值:继承自管理员集群

凭据配置文件中的凭据块名称,该文件包含您的私有 Docker 注册表账号的用户名和密码。

privateRegistry:
  credentials:
    fileRef:
      entry: "private-registry-creds"

privateRegistry.credentials.secretRef.version

字符串
可能的值:整数字符串或“latest”
默认值:“latest”

如果您为 preparedSecrets.namespace 提供了值,并且想要将准备好的 Secret 用于私有注册表,请填写此字段。否则,请移除此字段或将其注释掉。

管理员集群中准备好的 Secret 的版本,其中包含您要用于用户集群的 vCenter Server 实例的用户名和密码。

示例:

privateRegistry:
  credentials:
    secretRef:
      version: "1"

privateRegistry.caCertPath

可变
字符串
默认值:继承自管理员集群

当 Docker 从您的私有注册表中拉取映像时,该注册表必须通过提供证书来证明其身份。注册表的证书由证书授权机构 (CA) 签名。Docker 使用 CA 的证书来验证该注册表的证书。

将此字段设置为 CA 证书的路径。

示例:

privateRegistry:
  caCertPath: "my-cert-folder/registry-ca.crt"

network

本部分包含有关用户集群网络的信息。

network.hostConfig

本部分包含有关集群节点虚拟机使用的 NTP 服务器、DNS 服务器和 DNS 搜索网域的信息。

如果符合以下一个或多个条件,则此部分是必需的:

  • network.ipMode.type 设置为 static
  • enableControlplaneV2 设置为 true 或允许默认为 true。 请注意,新用户集群必须使用 Controlplane V2。

本部分包含有关集群节点虚拟机使用的 NTP 服务器、DNS 服务器和 DNS 搜索网域的信息。如果您使用的是 Seesaw 负载均衡器,则此信息也适用于 Seesaw 虚拟机。

如果符合以下一个或多个条件,则此部分是必需的:

  • network.ipMode.type 设置为 static
  • enableControlplaneV2 设置为 true 或允许默认为 true。 启用了 Controlplane V2 的集群不支持 Seesaw 负载均衡器。
  • loadBalancer.kind 设置为 "Seesaw"

network.hostConfig.dnsServers

必需
不可变
字符串数组。
数组中的元素数量上限为 3。

虚拟机的 DNS 服务器的地址。

示例:

network:
  hostConfig:
    dnsServers:
    - "172.16.255.1"
    - "172.16.255.2"

network.hostConfig.ntpServers

必需
不可变
字符串数组

供虚拟机使用的时间服务器地址。

示例:

network:
  hostConfig:
    ntpServers:
    - "216.239.35.0"

network.hostConfig.searchDomainsForDNS

不可变
字符串数组

供主机使用的 DNS 搜索域。这些网域会用作网域搜索列表的一部分。

示例:

network:
  hostConfig:
    searchDomainsForDNS:
    - "my.local.com"

network.ipMode.type

不可变
字符串
预填充值:“static”
默认值:“dhcp”

如果您希望集群节点从 DHCP 服务器获取其 IP 地址,请将此设置为 "dhcp"。如果您希望集群节点从您提供的列表中选择静态 IP 地址,请将此设置为 "static"

示例:

network:
  ipMode:
    type: "static"

network.ipMode.ipBlockFilePath

必需(如果 network.ipMode.type = static
不可变
字符串

集群的 IP 地址块文件的路径。

示例:

network:
  ipMode:
    ipBlockFilePath: "/my-config-folder/user-cluster-ipblock.yaml"

network.serviceCIDR

不可变
字符串
预填充值:“10.96.0.0/20”
>

用于集群中 Service 的 IP 地址范围(采用 CIDR 格式)。范围必须至少为 /24。

示例:

network:
  serviceCIDR: "10.96.0.0/20"

network.podCIDR

不可变
字符串
预填充值:“192.168.0.0/16”
默认值:“192.168.0.0/16”

用于集群中 Pod 的 IP 地址范围(采用 CIDR 格式)。范围必须至少为 /18。

示例:

network:
  podCIDR: "192.168.0.0/16"

Service 范围不得与 Pod 范围重叠。

Service 和 pod 范围不得与您要从集群内部访问的任何集群外部地址重叠。

例如,假设您的 Service 范围为 10.96.232.0/24,您的 Pod 范围为 192.168.0.0/16。从 Pod 发送到上述任一范围中的地址的任何流量都将被视为集群内的流量,并且不会到达集群外部的任何目的地。

具体来说,Service 和 pod 范围不得与以下各项重叠:

  • 任何集群中节点的 IP 地址

  • 负载均衡器使用的 IP 地址

  • 控制平面节点和负载均衡器使用的 VIP 地址

  • vCenter 服务器、DNS 服务器和 NTP 服务器的 IP 地址

我们建议您的 Service 和 Pod 范围位于 RFC 1918 地址空间中。

以下是建议使用 RFC 1918 地址的一个原因。假设您的 Pod 或 Service 范围包含外部 IP 地址。从 Pod 发送到其中一个外部地址的任何流量都将被视为集群内流量,并且不会到达外部目标。

network.vCenter.networkName

如果 vCenter.address 与您用于管理员集群的 vCenter 地址不同,则为必填字段。
不可变
字符串

您的用户集群节点所在的 vSphere 网络的名称。

示例:

network:
  vCenter:
    networkName: "my-network"

如果名称中包含特殊字符,您必须对其使用转义序列。

特殊字符 转义序列
正斜杠 (/) %2f
反斜杠 (\) %5c
百分号 (%) %25

如果网络名称在数据中心内不是唯一的,则可以指定完整路径。

示例:

network:
  vCenter:
    networkName: "/my-uc-datacenter/network/my-network"

network.additionalNodeInterfaces

如果将 multipleNetworkInterfaces 设置为 true,请填写此部分。 否则,请移除此部分或将其注释掉。

不可更改

对象数组,其中每个对象都描述一个可用于全部或部分集群节点的网络接口。

network.additionalNodeInterfaces[i].networkName

必需(如果 multipleNetworkInterfaces = true
不可变
字符串

此额外的节点接口将连接到的 vSphere 网络的名称。

示例:

network:
  additionalNodeInterfaces:
  - networkName: "my-node-interface-1"

network.additionalNodeInterfaces[i].type

必需(如果 multipleNetworkInterfaces = true
不可变
字符串

示例:

network:
  additionalNodeInterfaces:
  - name: "my-node-interface-1"
    type: "static"

network.additionalNodeInterfaces[i].ipBlockFilePath

必需(如果 network.additionalNodeInterfaces[i].type = static
不可变
字符串

IP 地址块文件的路径,该文件包含在具有此网络接口的节点上用于此网络接口的 IP 地址。

示例:

network:
  additionalNodeInterfaces:
  - name: "my-node-interface-1"
    type: "static"
    ipBlockFilePath: "my-ipblock-file-1"

network.controlPlaneIPBlock

如果将 enableControlplaneV2 设置为 true,请填写此部分。否则,请移除此部分或将其注释掉。

network.controlPlaneIPBlock.netmask

必需(如果 enableControlplaneV2 = true
不可变
字符串

示例:

network:
  controlPlaneIPBlock:
    netmask: "255.255.255.0"

network.controlPlaneIPBlock.gateway

必需(如果 enableControlplaneV2 = true
不可变
字符串

示例:

network:
  controlPlaneIPBlock:
    gateway: "172.16.21.1"

network.controlPlaneIPBlock.ips

必需(如果 enableControlplaneV2 = true
不可变
对象数组,其中每个对象都具有 IP 地址和可选主机名。

对于高可用性 (HA) 用户集群,该数组有三个元素。对于非 HA 用户集群,该数组有一个元素。

示例:

network:
  controlPlaneIPBlock:
    ips:
    - ip: "172.16.21.6"
      hostname: "cp-vm-1"
    - ip: "172.16.21.7"
      hostname: "cp-vm-2"
    - ip: "172.16.21.8"
      hostname: "cp-vm-3"

loadBalancer

本部分包含有关用户集群的负载均衡器的信息。

loadBalancer.vips.controlPlaneVIP

必需
不可变
字符串

您已选择在负载均衡器上为用户集群的 Kubernetes API 服务器配置的 IP 地址。

示例:

loadBalancer:
  vips:
    controlplaneVIP: "203.0.113.3"

loadBalancer.vips.ingressVIP

必需
不可变
字符串

您选择在负载均衡器上为入站流量代理配置的 IP 地址。

示例:

loadBalancer:
  vips:
    ingressVIP: "203.0.113.4"

loadBalancer.kind

必需
不可变
字符串
预填充值:“MetalLB”

字符串。请将此设置为 "ManualLB""MetalLB"

如果您有第三方负载均衡器(例如 F5 BIG-IP 或 Citrix),请使用 "ManualLB";对于我们的捆绑解决方案,请使用 "MetalLB"

虽然您可以升级将 kind 设置为 "F5BigIP""Seesaw" 的集群,但无法在具有其中任一负载均衡器配置的现有集群上使用 Dataplane V2 或 Controlplane V2。如需了解如何迁移负载均衡配置,请参阅以下内容:

示例:

loadBalancer:
  kind: "MetalLB"

必需
不可变
字符串
预填充值:“MetalLB”

请将此设置为 "ManualLB""F5BigIP""Seesaw""MetalLB"

如需启用 Dataplane V2 和 Controlplane V2,如果您有第三方负载均衡器(例如 F5 BIG-IP 或 Citrix),我们建议您使用 "ManualLB";对于我们的捆绑解决方案,建议使用 "MetalLB"

示例:

loadBalancer:
  kind: "MetalLB"

loadBalancer.manualLB

如果将 loadbalancer.kind 设置为 "manualLB",请填写此部分。否则,请移除此部分或将其注释掉。

loadBalancer.manualLB.ingressHTTPNodePort

必需(如果 loadBalancer.kind = ManualLB
不可变
整数
预填充值:30243

用户集群中的入站流量代理由 LoadBalancer 类型的 Kubernetes Service 公开。该 Service 具有用于 HTTP 的 ServicePort。您必须为 HTTP ServicePort 选择 nodePort 值。

将此字段设置为 nodePort 值。

示例:

loadBalancer:
  manualLB:
    ingressHTTPNodePort: 32527

loadBalancer.manualLB.ingressHTTPSNodePort

必需(如果 loadBalancer.kind = ManualLB
不可变
整数
预填充值:30879

用户集群中的入站流量代理由 LoadBalancer 类型的 Service 公开。该 Service 具有用于 HTTPS 的 ServicePort。您必须为 HTTPS ServicePort 选择 nodePort 值。

将此字段设置为 nodePort 值。 示例:

loadBalancer:
  manualLB:
    ingressHTTPSNodePort: 30139

loadBalancer.manualLB.controlPlaneNodePort

必需(如果 loadBalancer.kind = ManualLBenableControlplaneV2 = false
不可变
整数
预填充值:30562

在管理员集群中运行并由 LoadBalancer 类型的 Service 公开的用户集群的 Kubernetes API 服务器。您必须为 Service 选择 nodePort 值。

将此字段设置为 nodePort 值。

示例:

loadBalancer:
  manualLB:
    controlPlaneNodePort: 30968

loadBalancer.manualLB.konnectivityServerNodePort

必需(如果 loadBalancer.kind = ManualLBenableControlplaneV2 = false
不可变
整数
预填充值:30563

使用 kubeception 的用户集群的 Kubernetes API 服务器在管理员集群中运行,并由 LoadBalancer 类型的 Service 公开。Konnectivity 服务器会通过不同的 nodePort 值重复使用此 Service。您必须为 Konnectivity 服务器选择 nodePort 值。

将此字段设置为 Konnectivity 服务器的 nodePort 值。

示例:

loadBalancer:
  manualLB:
    konnectivityServerNodePort: 30969

loadBalancer.f5BigIP

在 1.30 及更高版本中,对于新用户集群,loadbalancer.kind 不允许使用值 "F5BigIP"。如果配置文件中包含 loadBalancer.f5BigIP 部分,请将其移除或注释掉。

您仍然可以将 F5 BIG-IP 负载均衡器与新用户集群搭配使用,但配置不同。如需了解配置详细信息,请参阅启用手动负载均衡模式

如果将 loadbalancer.kind 设置为 "f5BigIP",请填写此部分。否则,请移除此部分或将其注释掉。

如需启用新功能和高级功能,我们建议您为 F5 BIG-IP 负载均衡器配置手动负载均衡。如需启用手动负载均衡,请将 loadbalancer.kind 设置为 "ManualLB",并填写 loadBalancer.manualLB 部分。如需了解详情,请参阅启用手动负载均衡模式

如果您已有 F5-BIG-IP 负载均衡器,并且集群配置使用此部分,则在升级到 1.29 或更高版本后,我们建议您迁移到手动负载均衡

loadBalancer.f5BigIP.address

不允许用于新集群
必需(如果 loadBalancer.kind = "f5BigIP"
字符串

F5 BIG-IP 负载均衡器的地址。

示例:

loadBalancer:
  f5BigIP:
      address: "203.0.113.2"

如果 loadBalancer.kind = "f5BigIP",则为必需
字符串

F5 BIG-IP 负载均衡器的地址。

示例:

loadBalancer:
  f5BigIP:
      address: "203.0.113.2"

loadBalancer.f5BigIP.credentials.fileRef.path

不允许用于新集群
必需(如果 loadBalancer.kind = "f5BigIP"
字符串

凭据文件的路径,该文件包含 Google Distributed Cloud 用于连接到 F5 BIG-IP 负载均衡器的账号的用户名和密码。

用户账号必须拥有有充分权限设置和管理负载均衡器的用户角色。管理员角色或资源管理员角色足够。

如需了解如何更新 F5 BIG-IP 凭据,请参阅更新集群凭据

示例:

loadBalancer:
  f5BigIP:
    credentials:
      fileRef:
        path: "my-config-folder/user-creds.yaml"

如果 loadBalancer.kind = "f5BigIP",则为必需
字符串

凭据文件的路径,该文件包含 Google Distributed Cloud 用于连接到 F5 BIG-IP 负载均衡器的账号的用户名和密码。

用户账号必须拥有有充分权限设置和管理负载均衡器的用户角色。管理员角色或资源管理员角色足够。

如需了解如何更新 F5 BIG-IP 凭据,请参阅更新集群凭据

示例:

loadBalancer:
  f5BigIP:
    credentials:
      fileRef:
        path: "my-config-folder/user-creds.yaml"

loadBalancer.f5BigIP.credentials.fileRef.entry

不允许用于新集群
必需(如果 loadBalancer.kind = "f5BigIP"
字符串

凭据配置文件中的凭据块名称,该文件包含 F5 BIG-IP 账号的用户名和密码。

示例:

loadBalancer:
  f5BigIP:
    credentials:
      fileRef:
        entry: "f5-creds"

如果 loadBalancer.kind = "f5BigIP",则为必需
字符串

凭据配置文件中的凭据块名称,该文件包含 F5 BIG-IP 账号的用户名和密码。

示例:

loadBalancer:
  f5BigIP:
    credentials:
      fileRef:
        entry: "f5-creds"

loadBalancer.f5BigIP.partition

不允许用于新集群
必需(如果 loadBalancer.kind = "f5BigIP"
字符串

您为用户集群创建的 BIG-IP 分区的名称。

示例:

loadBalancer:
  f5BigIP:
    partition: "my-f5-user-partition"

如果 loadBalancer.kind = "f5BigIP",则为必需
字符串

您为用户集群创建的 BIG-IP 分区的名称。

示例:

loadBalancer:
  f5BigIP:
    partition: "my-f5-user-partition"

loadBalancer.f5BigIP.snatPoolName

不允许用于新集群
必需(如果 loadBalancer.kind = "f5BigIP" 并且您使用 SNAT)
字符串

SNAT 池的名称。

示例:

loadBalancer:
  f5BigIP:
    snatPoolName: "my-snat-pool"

如果 loadBalancer.kind = "f5BigIP" 并且您使用 SNAT,则为必需
字符串

SNAT 池的名称。

示例:

loadBalancer:
  f5BigIP:
    snatPoolName: "my-snat-pool"

loadBalancer.seesaw

在 1.30 及更高版本中,对于新用户集群,loadbalancer.kind 不允许使用值 "Seesaw",因为此负载均衡器不支持新的高级功能。如果配置文件中包含 loadBalancer.seesaw 部分,请将其移除或注释掉。

您可以改为配置捆绑式 MetalLB 负载均衡器。如需启用 MetalLB 负载均衡器,请将 loadbalancer.kind 设置为 "MetalLB",并填写 loadBalancer.metalLB 部分。如需了解详情,请参阅使用 MetalLB 进行捆绑式负载均衡

如果将 loadbalancer.kind 设置为 "Seesaw",请填写此部分。否则,请移除此部分或将其注释掉。

请注意 SeeSaw 负载均衡器的以下限制:

如需使用这些功能,我们建议您配置 MetalLB 负载均衡器。如需启用 MetalLB 负载均衡器,请将 loadbalancer.kind 设置为 "MetalLB",并填写 loadBalancer.metalLB 部分。如需了解详情,请参阅使用 MetalLB 进行捆绑式负载均衡

loadBalancer.seesaw.ipBlockFilePath

不允许用于新集群
必需(如果 loadBalancer.kind = Seesaw
不可变
字符串

您的 Seesaw 虚拟机的 IP 地址块文件的路径。

示例:

loadBalancer:
  seesaw:
    ipBlockFilePath: "config-folder/user-seesaw-ipblock.yaml"

必需(如果 loadBalancer.kind = Seesaw
不可变
字符串

Seesaw 虚拟机的 IP 地址块文件的路径。

示例:

loadBalancer:
  seesaw:
    ipBlockFilePath: "config-folder/user-seesaw-ipblock.yaml"

loadBalancer.seesaw.vrid

不允许用于新集群
必需(如果 loadBalancer.kind = Seesaw
不可变
整数
可能的值:1 - 255
预填充值:0

您的 Seesaw 虚拟机的虚拟路由器标识符。此标识符(您选择的整数)在 VLAN 中必须是唯一的。

示例:

loadBalancer:
  seesaw:
    vrid: 125

必需(如果 loadBalancer.kind = Seesaw
不可变
整数
可能的值:1 - 255
预填充值:0

您的 Seesaw 虚拟机的虚拟路由器标识符。此标识符(您选择的整数)在 VLAN 中必须是唯一的。

示例:

loadBalancer:
  seesaw:
    vrid: 125

loadBalancer.seesaw.masterIP

不允许用于新集群
必需(如果 loadBalancer.kind = Seesaw
不可变
字符串

主 Seesaw 虚拟机上配置的虚拟 IP 地址。

示例:

loadBalancer:
  seesaw:
    masterIP: 172.16.20.21

必需(如果 loadBalancer.kind = Seesaw
不可变
字符串

主 Seesaw 虚拟机上配置的虚拟 IP 地址。

示例:

loadBalancer:
  seesaw:
    masterIP: 172.16.20.21

loadBalancer.seesaw.cpus

不允许用于新集群
必需(如果 loadBalancer.kind = Seesaw
可变
整数
预填充值:4

每个 Seesaw 虚拟机的 CPU 数量。

示例:

loadBalancer:
  seesaw:
    cpus: 8

必需(如果 loadBalancer.kind = Seesaw
可变
整数
预填充值:4

每个 Seesaw 虚拟机的 CPU 数量。

示例:

loadBalancer:
  seesaw:
    cpus: 8

loadBalancer.seesaw.memoryMB

不允许用于新集群
必需(如果 loadBalancer.kind = Seesaw
可变
整数
预填充值:3072

每个 Seesaw 虚拟机的内存大小(以 MiB 为单位)。

示例:

loadBalancer:
  seesaw:
    memoryMB: 8192

注意:此字段指定内存兆比字节 (MiB) 数,而不是兆字节 (MB) 数。1 MiB 为 220 = 1,048,576 字节。1 MB 为 106 = 100 万字节。

必需(如果 loadBalancer.kind = Seesaw
可变
整数
预填充值:3072

每个 Seesaw 虚拟机的内存大小(以 MiB 为单位)。

示例:

loadBalancer:
  seesaw:
    memoryMB: 8192

注意:此字段指定内存兆比字节 (MiB) 数,而不是兆字节 (MB) 数。1 MiB 为 220 = 1,048,576 字节。1 MB 为 106 = 100 万字节。

loadBalancer.seesaw.vCenter.networkName

不允许用于新集群
不可变
字符串
默认值:与集群节点相同

包含 Seesaw 虚拟机的 vCenter 网络的名称。

示例:

loadBalancer:
  seesaw:
    vCenter:
      networkName: "my-seesaw-network"

不可变
字符串
默认值:与集群节点相同

包含 Seesaw 虚拟机的 vCenter 网络的名称。

示例:

loadBalancer:
  seesaw:
    vCenter:
      networkName: "my-seesaw-network"

loadBalancer.seesaw.enableHA

不允许用于新集群
不可变
相关(如果 loadBalancer.kind = Seesaw
布尔值
预填充值:false
默认值:false

如果要创建高可用性 (HA) Seesaw 负载均衡器,请将此值设置为 true。否则,请将其设置为 false。高可用性 Seesaw 负载均衡器使用(主备)虚拟机对

示例:

loadBalancer:
  seesaw:
    enableHA: true

不可变
相关(如果 loadBalancer.kind = Seesaw
布尔值
预填充值:false
默认值:false

如果要创建高可用性 (HA) Seesaw 负载均衡器,请将此值设置为 true。否则,请将其设置为 false。高可用性 Seesaw 负载均衡器使用(主备)虚拟机对

示例:

loadBalancer:
  seesaw:
    enableHA: true

loadBalancer.seesaw.disableVRRPMAC

不允许用于新集群
不可变
相关(如果 loadBalancer.kind = Seesaw
布尔值
预填充值:true
默认值:true

如果将此值设置为 true,则 Seesaw 负载均衡器不会使用 MAC 学习进行故障切换,而是会使用免费 ARP。如果将其设置为 false,则 Seesaw 负载均衡器会使用 MAC 学习。我们建议您将此值设置为 true。如果您使用的是 vSphere 7 或更高版本,并且具有高可用性 Seesaw 负载均衡器,则必须将此值设置为 true

示例:

loadBalancer:
  seesaw:
    disableVRRPMAC: true

不可变
相关(如果 loadBalancer.kind = Seesaw
布尔值
预填充值:true
默认值:true

如果将此值设置为 true,则 Seesaw 负载均衡器不会使用 MAC 学习进行故障切换,而是会使用免费 ARP。如果将其设置为 false,则 Seesaw 负载均衡器会使用 MAC 学习。我们建议您将此值设置为 true。如果您使用的是 vSphere 7 或更高版本,并且具有高可用性 Seesaw 负载均衡器,则必须将此值设置为 true

示例:

loadBalancer:
  seesaw:
    disableVRRPMAC: true

loadBalancer.metalLB

如果将 loadbalancer.kind 设置为 "MetalLB",请填写此部分。否则,请移除此部分或将其注释掉。

如需了解详情,请参阅使用 MetalLB 进行捆绑式负载均衡

loadBalancer.metalLB.addressPools

必需(如果 loadBalancer.kind =“MetalLB”)
可变

对象数组,每个对象都保存有关 MetalLB 负载均衡器要使用的地址池的信息。

loadBalancer.metalLB.addressPools[i].name

必需(如果 loadBalancer.kind = MetalLB
可变
字符串

您为地址池选择的名称。

示例:

loadBalancer:
  metalLB:
    addressPools:
    - name: "my-address-pool-1"
loadBalancer.metalLB.addressPools[i].addresses

必需(如果 loadBalancer.kind = MetalLB
可变

字符串数组,其中每个字符串都是一个地址范围。每个范围都必须采用 CIDR 格式或带连字符的范围格式。

示例:

loadBalancer:
  metalLB:
    addressPools:
    - name: "my-address-pool-1"
      addresses:
      - "192.0.2.0/26"
      - "192.0.2.64-192.0.2.72"
loadBalancer.metalLB.addressPools[i].avoidBuggyIPs

相关(如果 loadBalancer.kind = MetalLB
可变
布尔值
预填充值:false
默认值:false

如果将该字段设置为 true,则 MetalLB 控制器不会将以 .0 或 .255 结尾的 IP 地址分配给 Service。这样可以避免有问题的用户设备错误地丢弃发送到这些特殊 IP 地址的流量。

示例:

loadBalancer:
  metalLB:
    addressPools:
    - name: "my-address-pool-1"
      - "192.0.2.0/26"
      - "192.0.2.64-192.0.2.72"
      avoidBuggyIPs: true
loadBalancer.metalLB.addressPools[i].manualAssign

相关(如果 loadBalancer.kind = MetalLB
可变
布尔值
预填充值:false
默认值:false

如果您不希望 MetalLB 控制器自动将此池中的 IP 地址分配给 Service,请将该字段设置为 true。之后,开发者便可以创建 LoadBalancer 类型的 Service 并手动指定池中的一个地址。

否则,请将其设置为 false

示例:

loadBalancer:
  metalLB:
    addressPools:
    - name: "my-address-pool-1"
      manualAssign: true

enableDataplaneV2

不可变
布尔值
预填充值:true
默认值:true

在 1.30 及更高版本中,新用户集群必须使用 Dataplane V2。如果您在配置文件中添加此字段,则必须将其设置为 true。使用 Controlplane V2 需要 Dataplane V2。Dataplane V2 的优势包括:

  • 与之前的容器网络接口 (CNI) 选项 Calico 相比,Dataplane V2 为您提供了更高级且功能更强大的 CNI。Calico 处于维护模式,这意味着它只会收到关键问题修复和安全更新,而不会进行新功能开发。相比之下,Dataplane V2 会积极进行开发和增强,确保您可以使用最新的网络创新和功能。

  • Dataplane V2 是 GKE 和其他 Google Distributed Cloud 产品的首选 CNI。

不可变
布尔值
预填充值:true
默认值:false

如果要启用 Dataplane V2 或者想要使用 Controlplane V2,请将其设置为 true。否则,请将其设置为 false

我们建议您启用 Dataplane V2。

示例:

  enableDataplaneV2: true

如需了解问题排查步骤,请参阅数据平面 V2 问题排查

dataplaneV2.forwardMode

不可变
字符串
可能的值:“snat”,“dsr”
预填充值:“snat”
默认值:“snat”

启用了 Dataplane V2 的集群的转发模式。

使用来源网络地址转换 (SNAT) 模式时,数据包在从负载均衡器节点转发到后端 Pod 时会进行 SNAT 转换。Pod 无法查看原始来源 IP 地址,并且返回数据包必须通过负载均衡器节点。

使用直接服务器返回 (DSR) 模式时,数据包在从负载均衡器节点转发到后端 Pod 时会保留其原始来源 IP 地址。Pod 可以查看原始来源 IP 地址,返回数据包直接发送到客户端,而无需通过负载均衡器节点。

示例:

dataplaneV2:
  forwardMode: "dsr"

multipleNetworkInterfaces

不可变
布尔值
预填充值:false
默认值:false

如果要为 Pod 启用多个网络接口,请将此值设置为 true。否则,请将其设置为 false

如需了解详情,请参阅为 Pod 配置多个网络接口

示例:

multipleNetworkInterfaces: true

advancedNetworking

不可变
布尔值
预填充值:false
默认值:false

如果您计划创建出站 NAT 网关,请将此字段设置为 true。否则,请将其设置为 false

如果您将此字段设置为 true,则还必须将 enableDataplaneV2 设置为 true

示例:

advancedNetworking: true

disableBundledIngress

如果要为集群停用捆绑式入站流量,请将此值设置为 true。否则,请将其设置为 false

布尔值
可变
预填充值:false
默认值:false

示例:

disableBundledIngress: true

storage.vSphereCSIDisabled

如果要停用 vSphere CSI 组件的部署,请将此字段设置为 true。否则,请将其设置为 false

可变
布尔值
预填充值:false
默认值:false

示例:

storage:
  vSphereCSIDisabled: false

masterNode

本部分包含有关用作此用户集群控制平面节点的节点的信息。

masterNode.cpus

可变
整数
预填充值:4
默认值:4

用作此用户集群控制平面的每个节点的 CPU 数。

示例:

masterNode:
  cpus: 8

masterNode.memoryMB

可变
整数
预填充值:8192
默认值:8192

用作此用户集群控制平面的每个节点的内存大小(以 MiB 为单位)。必须是 4 的倍数。

示例:

masterNode:
  memoryMB: 8192

注意:此字段指定内存兆比字节 (MiB) 数,而不是兆字节 (MB) 数。1 MiB 为 2^20 = 1048576 字节。1 MB 为 10^6 = 100 万字节。

masterNode.replicas

不可变
整数
可能的值:1 或 3
预填充值:1
默认值:1

此用户集群的控制平面节点数量。创建集群后,此数字便无法更改。如果您希望稍后更新副本数量,则必须重新创建用户集群。

示例:

masterNode:
  replicas: 3

masterNode.autoResize.enabled

可变
布尔值
预填充值:false
默认值:false

将此字段设置为 true 以启用用户集群控制平面节点的自动大小调整功能。否则,请将其设置为 false

如需了解详情,请参阅为用户集群的控制平面节点启用节点大小调整

示例:

masterNode:
  autoResize:
    enabled: true

masterNode.vsphere.datastore

可选
不可变
字符串
默认值:vCenter.datastore 的值

将在其中创建此用户集群的控制平面节点的数据存储区。

您指定的值必须是名称,而不是路径。请勿在值中包含任何文件夹。

示例:

masterNode:
  vSphere:
    datastore: "control-plane-datastore"

如果为此字段指定了值,则请勿为 masterNode.vsphere.storagePolicyName 指定值。masterNode.vsphere.datastore 字段不可变,但在将数据存储区迁移到基于存储政策的管理 (SPBM) 时,您可以将该字段设置为空字符串。

masterNode.vsphere.storagePolicyName

可选
不可变
字符串
默认值:vCenter.storagePolicyName 的值

控制平面节点的虚拟机存储政策的名称。

如需了解详情,请参阅配置存储政策

示例:

masterNode:
  vSphere:
    storagePolicyName: "control-plane-storage-policy"

如果为此字段指定了值,则请勿为 masterNode.vsphere.datastore 指定值。

nodePools

必需
可变
对象数组,其中每个对象描述了一个节点池。

如需了解详情,请参阅创建和管理节点池

nodePools[i].name

必需
不可变
字符串

您为节点池选择的名称。该名称必须:

  • 最多包含 40 个字符
  • 只能包含小写字母数字字符或连字符 (-)
  • 以字母字符开头
  • 以字母数字字符结尾

示例:

nodePools:
- name: "my-node-pool-1"

nodePools[i].gkeOnPremVersion

升级用户集群时,您可以指定所选节点池保持为先前版本。

如果您希望此节点池保持先前版本,请将此字段设置为先前版本。否则,请移除此字段或将其设置为空字符串。如需了解详情,请参阅升级节点池

可变
字符串
默认值:集群 gkeOnPremVersion

示例:

nodePools:
- name: "my-node-pool"
  gkeOnPremVersion: "1.13.0-gke.16"

nodePools[i].cpus

必需
可变
整数
预填充值:4

池中每个节点的 vCPU 数量。

示例:

nodePools"
- name: "my-node-pool"
  cpus: 8

nodePools[i].memoryMB

必需
可变
整数
预填充值:8192

池中每个节点的内存大小(以 MiB 为单位)。必须是 4 的倍数。

示例:

nodePools"
- name: "my-node-pool"
  memoryMB: 8192

注意:此字段指定内存兆比字节 (MiB) 数,而不是兆字节 (MB) 数。1 MiB 为 2^20 = 1048576 字节。1 MB 为 10^6 = 100 万字节。

nodePools[i].replicas

必需
可变
整数
预填充值:3
可能的值:集群的所有节点池中未污染的节点总数必须至少为 3。

池中的节点数。

示例:

nodePools:
- name: "my-node-pool"
  replicas: 5

nodePools[i].bootDiskSizeGB

可变
整数
预填充值:40
默认值:40

池中每个节点的启动磁盘的大小(以吉比字节为单位)。

示例:

nodePools
- name: "my-node-pool"
  bootDiskSizeGB: 40

nodePools[i].osImageType

可变
字符串
可能的值:“ubuntu_containerd”“cos”“ubuntu_cgv2”“cos_cgv2”“windows”
预填充值:“ubuntu_cgv2”
默认值:“ubuntu_containerd”

要在节点池中的虚拟机上运行的操作系统映像类型。

如果您指定 ubuntu_cgv2cos_cgv2,则必须先运行 gkectl prepare --extra-os-image-types=cgroupv2,然后再创建/更新集群。

示例:

nodePools
- name: "my-node-pool"
  osImageType: "ubuntu_cgv2"

nodePools[i].osImage

必需(如果 nodePools[i].osImageType = windows
可变
字符串

Windows 虚拟机模板的名称。该模板必须基于具有 en-US 语言/区域标记的 Windows Server 2019 ISO。

如需了解详情,请参阅 Windows Server 操作系统节点池用户指南

nodePools[i].labels

可变
映射

要应用于池中每个 Kubernetes 节点对象的标签。

示例:

nodePools:
- name: "my-node-pool"
  labels:
    environment: "production"
    tier: "cache"

出于安全原因,kubelet 无法在某些命名空间中向自身应用标签。

预留的节点标签命名空间为:kubernetes.iok8s.iogoogleapis.com

nodePools[i].taints

可变
对象数组,其中每个对象描述应用于池中每个节点的一个 Kubernetes 污点。污点是与 effect 相关联的键值对。污点可与容忍设置一起用来进行 Pod 调度。为 effect 指定以下其中一项:NoSchedulePreferNoScheduleNoExecute

示例:

nodePools:
- name: "my-node-pool"
  taints:
  - key: "staging"
    value: "true"
    effect: "NoSchedule"

nodePools[i].vsphere.datastore

可变
字符串
默认值:vCenter.datastore 的值

将在其中创建节点的 vCenter 数据存储区的名称。

示例:

nodePools:
- name: "my-node-pool"
  vsphere:
    datastore: "my-datastore"

如果为此字段指定了值,则请勿为 nodePools[i].vsphere.storagePolicyName 指定值。

nodePools[i].vsphere.storagePolicyName

可变
字符串
默认值:vCenter.storagePolicyName 的值

池中节点的虚拟机存储政策的名称。

如需了解详情,请参阅配置存储政策

示例:

nodePools:
- name: "my-node-pool"
  vsphere:
    storagePolicyName: "my-storage-policy"

如果为此字段指定了值,则请勿为 nodePools[i].vsphere.datastore 指定值。

nodePools[i].vsphere.hostgroups

如果您要将集群配置为使用虚拟机主机亲和性,请填写此部分。

可变
字符串数组,其中每个字符串都是主机 DRS 组的名称。

此数组只能有一个元素。

示例:

nodePools:
- name: "my-node-pool"
  vsphere:
    hostgroups:
    - "my-hostgroup"

nodePools[i].vsphere.tags

可变
对象数组,其中每个对象描述了要放置在节点池中的虚拟机上的 vSphere 标记

每个标记都有一个类别和名称。

示例:

nodePools:
- name: "my-node-pool"
  vsphere:
    tags:
    - category: "purpose"
      name: "testing"

如果要将标记附加到节点池中的所有虚拟机,您的 vCenter 用户账号必须具有以下 vSphere 标记权限

  • vSphere 标记。分配或取消分配 vSphere 标记
  • vSphere 标记。在对象上分配或取消分配 vSphere 标记 (vSphere 7)

nodePools[i].autoscaling

可变

如果要为节点池启用自动扩缩功能,请填写此部分。否则,请移除此部分或将其注释掉。

nodePools[i].autoscaling.minReplicas

可变
整数
可能的值:大于或等于 1
预填充值:0

自动扩缩器可以为池设置的最小节点数。

示例:

nodePools:
- name: "my-node-pool"
  autoscaling:
    minReplicas: 5

nodePools[i].autoscaling.maxReplicas

可变
整数
预填充值:0

自动扩缩器可以为池设置的最大节点数。

示例:

nodePools:
- name: "my-node-pool"
  autoscaling:
    maxReplicas: 10

nodePools[i].enableLoadBalancer

相关(如果 loadBalancer.kind = "MetalLB"
可变
布尔值
预填充值:true
默认值:false

如果要允许 MetalLB speaker 在池中的节点上运行,请将此值设置为 true。否则,请将其设置为 false

如需了解详情,请参阅使用 MetalLB 进行捆绑式负载均衡

示例:

nodePools:
- name: "my-node-pool"
  enableLoadBalancer: true

nodePools[i].updateStrategy.rollingUpdate.maxSurge

预览版
可变
整数
默认值:1

在更新或升级期间,节点池中可同时更新的机器数量上限。

nodePools:
- name: "my-node-pool"
  updateStrategy:
    rollingUpdate:
      maxSurge: 3

antiAffinityGroups.enabled

可变
布尔值
预填充值:true 默认值:

将此值设为 true 可启用 DRS 规则创建。否则,请将其设置为 false

示例:

antiAffinityGroups:
  enabled: true

如果此字段为 true,则 Google Distributed Cloud 会为您的用户集群节点创建 VMware 分布式资源调度器 (DRS) 反亲和性规则,使它们分布在数据中心的至少三个物理 ESXi 主机上。

为了使用此功能,您的 vSphere 环境必须满足以下条件:

  • VMware DRS 已启用。VMware DRS 需要 vSphere Enterprise Plus 许可版本。

  • 您的 vSphere 用户账号具有 Host.Inventory.Modify cluster 特权。

  • 至少有四个 ESXi 主机可用。

即使该规则要求群集节点分布在三个 ESXi 主机上,我们强烈建议您至少有四个可用的 ESXi 主机。

回想一下,如果您拥有 vSphere Standard 许可,则无法启用 VMware DRS。

如果您未启用 DRS,或没有至少四个主机可供安排 vSphere 虚拟机,请将 antiAffinityGroups.enabled 设置为 false

enableVMTracking

预览版
不可变
预填充值:false

将此值设为 true 以启用基于 vSphere 标记的虚拟机跟踪。否则,请将其设置为 false

如需了解详情,请参阅启用虚拟机跟踪

示例:

enableVMTracking: true

nodePoolUpdatePolicy.maximumConcurrentNodePoolUpdate

可变
整数
可能的值:0 或 1
预填充值:0 默认值:

一次要更新的节点池数。值 1 指定一次可以更新一个节点池。值 0 指定一次可以更新无限数量的节点池。

示例:

nodePoolUpdatePolicy:
  maximumConcurrentNodePoolUpdate: 1

nodePoolUpdatePolicy.updateStrategy.rollingUpdate.maxSurge

预览版
可变
整数
默认值:1

在更新或升级期间,节点池中可同时更新的机器数量上限。适用于未指定自己的更新策略的任何节点池。

nodePools:
- name: "my-node-pool"
  updateStrategy:
    rollingUpdate:
      maxSurge: 3

authentication

本部分包含有关如何对集群用户进行身份验证和授权的信息。

authentication.oidc

请勿使用本部分。请改为在创建集群后,按照使用 OIDC 为 Anthos Identity Service 配置集群中所述修改 ClientConfig 自定义资源。

authentication.sni

如果要为集群的 Kubernetes API 服务器提供其他服务证书,请填写此部分。否则,请移除此部分或将其注释掉。

authentication.sni.certPath

字符串

Kubernetes API 服务器服务证书的路径。

示例:

authentication:
  sni:
    certPath: "my-cert-folder/example.com.crt"

authentication.sni.keyPath

可选
字符串

证书私钥文件的路径。

示例:

authentication:
  sni:
    keyPath: "my-cert-folder/example.com.key"

gkeConnect

必需
不可变

本部分包含您在向 Google Cloud 舰队注册您的集群时,需要用到的 Google Cloud 项目和服务账号的信息。

gkeConnect.projectID

必需
不可变
字符串

舰队宿主项目的 ID。 对于新集群,此项目 ID 必须与 stackdriver.projectIDcloudAuditLogging.projectID 中设置的 ID 相同。如果项目 ID 不同,集群创建将失败。此要求不适用于现有集群。

示例:

gkeConnect:
  projectID: "my-fleet-host-project"

gkeConnect.location

不可变
字符串
默认值:global

每个集群的舰队成员资格由 Fleet 服务 (gkehub.googleapis.com) 和 Connect 服务 (gkeconnect.googleapis.com) 管理。这些服务的位置可以是全球级的,也可以是区域级的。在 1.28 版及更高版本中,您可以选择指定 Fleet 和 Connect 服务运行的 Google Cloud 区域。如果未指定,则使用服务的全球实例。请注意以下几点:

  • 在 1.28 版之前创建的用户集群由全球舰队和 Connect 服务管理。

  • 使用 GKE On-Prem API 客户端(Google Cloud 控制台、Google Cloud CLI 或 Terraform)创建的新集群会使用您为 GKE On-Prem API 指定的同一区域。

  • 对于新集群,如果添加此字段,则您指定的区域必须与 cloudAuditLogging.clusterLocationstackdriver.clusterLocationgkeOnPremAPI.location 中配置的区域相同。如果区域不相同,集群创建将失败。

示例:

gkeConnect:
  location: "us-central1"

gkeConnect.registerServiceAccountKeyPath

必需
可变
字符串

连接和注册服务账号的 JSON 密钥文件的路径。

要更新此字段的值,请使用 gkectl update cluster

如需了解如何更改连接和注册服务账号密钥,请参阅轮替服务账号密钥

示例:

gkeConnect:
  registerServiceAccountKeyPath: "my-key-folder/connect-register-key.json"

gkeConnect.registerServiceAccountKey.secretRef.version

可变
字符串
可能的值:整数字符串或“latest”
默认值:“latest”

管理员集群中准备好的 Secret 的版本,其中包含连接注册服务账号的 JSON 密钥。

示例:

gkeConnect:
  registerServiceAccountKey:
    secretRef:
      version: "1"

gkeOnPremAPI

在 1.16 及更高版本中,如果在 Google Cloud 项目中启用了 GKE On-Prem API,则项目中的所有集群会在 stackdriver.clusterLocation 中配置的区域中自动注册 GKE On-Prem API

  • 如果您想要在 GKE On-Prem API 中注册项目中的所有集群,请务必执行准备工作中的步骤,以在项目中激活和使用 GKE On-Prem API。

  • 如果您不想在 GKE On-Prem API 中注册集群,请添加此部分并将 gkeOnPremAPI.enabled 设置为 false。如果您不想注册项目中的任何集群,请在项目中停用 gkeonprem.googleapis.com(GKE On-Prem API 的服务名称)。如需查看相关说明,请参阅停用服务

通过在 GKE On-Prem API 中注册用户集群,您可以使用标准工具(Google Cloud 控制台、Google Cloud CLI 和 Terraform)来管理集群的生命周期。此外,注册集群后,您可以使用控制台或 gcloud CLI 来查看集群详细信息。例如,您可以运行 gcloud 命令来获取有关用户集群的信息

添加此部分并创建或更新集群后,如果后续您移除此部分并更新集群,更新将失败。

gkeOnPremAPI.enabled

可变
布尔值
默认值:true

默认情况下,如果项目中启用了 GKE On-Prem API,则集群会在 GKE On-Prem API 中注册。如果您不想注册集群,请设置为 false

在 GKE On-Prem API 中注册集群后,如果您需要取消注册集群,请进行以下更改然后更新集群:

gkeOnPremAPI:
  enabled: false

gkeOnPremAPI.location

不可变
字符串
默认值:stackdriver.clusterLocation

Google Cloud 区域,GKE On-Prem API 在其中运行和存储集群元数据。选择一个支持的区域。您必须使用在 gkeConnect.locationstackdriver.clusterLocationcloudAuditLogging.clusterLocation 中配置的同一区域。如果 gkeOnPremAPI.enabledfalse,请勿添加此字段。

stackdriver

默认为必需
可变

如果要为集群启用 Cloud Logging 和 Cloud Monitoring,请填写此部分的信息。否则,请移除此部分或将其注释掉。

默认情况下,此部分是必需的。也就是说,如果您不包括此部分,则必须在运行 gkectl create cluster 时添加 --skip-validation-stackdriver 标志。

如果您要在 Google Cloud 控制台中管理用户集群的生命周期,则此部分在用户集群中是必需的。

stackdriver.projectID

对于 Logging 和 Monitoring 是必需的
不可变
字符串

舰队宿主项目的 ID。 对于新集群,此项目 ID 必须与 gkeConnect.projectIDcloudAuditLogging.projectID 中设置的 ID 相同。如果项目 ID 不同,集群创建将失败。此要求不适用于现有集群。

如果需要,您可以在此项目中配置日志路由器,以将日志路由到另一个项目中的日志存储桶。如需了解如何配置日志路由器,请参阅支持的目标位置

示例:

stackdriver:
  projectID: "my-fleet-host-project"

stackdriver.clusterLocation

对于 Logging 和 Monitoring 是必需的
不可变
字符串
预填充值:“us-central1”

您要在其中存储日志的 Google Cloud 区域。建议选择一个靠近您的本地数据中心的区域。

对于新集群,如果您在配置文件中添加 gkeOnPremAPIcloudAuditLogging 部分,则您在此处设置的区域必须与您在 gkeConnect.locationgkeOnPremAPI.locationcloudAuditLogging.clusterLocation 中设置的区域相同。如果区域不相同,集群创建将失败。

示例:

stackdriver:
  clusterLocation: "us-central1"

stackdriver.enableVPC

不可变
布尔值
预填充值:false

如果集群的网络由 VPC 控制,请将此字段设置为 true。这样可以确保所有遥测流都通过 Google 的受限 IP 地址。否则,请将其设置为 false

示例:

stackdriver:
  enableVPC: false

stackdriver.serviceAccountKeyPath

对于 Logging 和 Monitoring 是必需的
可变
字符串

您的日志记录和监控服务账号的 JSON 密钥文件的路径。

要更新此字段的值,请使用 gkectl update cluster

如需了解如何更改日志记录和监控服务账号密钥,请参阅轮替服务账号密钥

示例:

stackdriver:
  serviceAccountKeyPath: "my-key-folder/log-mon-key.json"

stackdriver.serviceAccountKey.secretRef.version

可变
字符串
可能的值:整数字符串或“latest”
默认值:“latest”

管理员集群中准备好的 Secret 的版本,其中包含日志记录监控服务账号的 JSON 密钥。

示例:

stackdriver:
  serviceAccountKey:
    secretRef:
      version: "1"

stackdriver.disableVsphereResourceMetrics

可变
布尔值
预填充值:false
默认值:false

将此属性设置为 true 可停用从 vSphere 收集指标。否则,请将其设置为 false

示例:

stackdriver:
  disableVsphereResourceMetrics: true

usageMetering

预览版
不可变

如果要为集群启用用量计量功能,请填写此部分。否则,请移除此部分或将其注释掉。

usageMetering.bigQueryProjectID

预览版
对于用量计量是必需的
不可变
字符串

您要在其中存储用量计量数据的 Google Cloud 项目的 ID。

示例:

usageMetering:
  bigQueryProjectID: "my-bq-project"

usageMetering.bigQueryDatasetID

预览版
对于用量计量是必需的
不可变
字符串

您要在其中存储用量计量数据的 BigQuery 数据集的 ID。示例:

usageMetering:
  bigQueryDatasetID: "my-bq-dataset"

usageMetering.bigQueryServiceAccountKeyPath

预览版
对于用量计量是必需的
不可变
字符串。

BigQuery 服务账号的 JSON 密钥文件的路径。

要更新此字段的值,请使用 gkectl update cluster

如需了解如何更改 BigQuery 服务账号密钥,请参阅轮替服务账号密钥

示例:

usageMetering:
  bigQueryServiceAccountKeyPath: "my-key-folder/bq-key.json"

usageMetering.bigQueryServiceAccountKey.secretRef.version

可变
字符串
可能的值:整数字符串或“latest”
默认值:“latest”

管理员集群中准备好的 Secret 的版本,其中包含 BigQuery 服务账号的 JSON 密钥。

示例:

gkeConnect:
  bigQueryServiceAccountKey:
    secretRef:
      version: "1"

usageMetering.enableConsumptionMetering

预览版
对于用量计量是必需的
不可变
布尔值
预填充值:false

如果要启用基于消耗量的计量功能,请将此值设置为 true。否则,请将其设置为 false。

示例:

usageMetering:
  enableConsumptionMetering: true

cloudAuditLogging

如果要将集群的 Kubernetes API 服务器中的审核日志与 Cloud Audit Logs 集成,请填写此部分。否则,请移除此部分或将其注释掉。

cloudAuditLogging.projectID

对于 Cloud Audit Logs 是必需的
不可变
字符串

舰队宿主项目的 ID。对于新集群,此项目 ID 必须与 gkeConnect.projecIDstackdriver.projectID 中设置的 ID 相同。如果项目 ID 不同,集群创建将失败。此要求不适用于现有集群。

如果需要,您可以在此项目中配置日志路由器,以将日志路由到另一个项目中的日志存储桶。如需了解如何配置日志路由器,请参阅支持的目标位置

示例:

cloudAuditLogging:
  projectID: "my-fleet-host-project"

cloudAuditLogging.clusterLocation

对于 Cloud Audit Logs 是必需的
不可变
字符串

您要在其中存储审核日志的 Google Cloud 区域。建议选择一个靠近您的本地数据中心的区域

对于新集群,如果您在配置文件中添加 gkeOnPremAPIstackdriver 部分,则您在此处设置的区域必须与您在 gkeConnect.locationgkeOnPremAPI.locationstackdriver.clusterLocation 中设置的区域相同。如果区域不相同,集群创建将失败。

示例:

cloudAuditLogging:
  clusterLocation: "us-central1"

cloudAuditLogging.serviceAccountKeyPath

对于 Cloud Audit Logs 是必需的
可变
字符串

审核日志记录服务账号的 JSON 密钥文件的路径。

要更新此字段的值,请使用 gkectl update cluster

如需了解如何更改审核和日志记录服务账号密钥,请参阅轮替服务账号密钥

示例:

cloudAuditLogging:
  serviceAccountKeyPath: "my-key-folder/audit-log-key.json"

cloudAuditLogging.serviceAccountKey.secretRef.version

可变
字符串
可能的值:整数字符串或“latest”
默认值:“latest”

管理员集群中准备好的 Secret 的版本,其中包含审核日志记录服务账号的 JSON 密钥。

示例:

cloudAuditLogging:
  serviceAccountKey:
    secretRef:
      version: "1"

autoRepair.enabled

可选
可变
布尔值
预填充值:true

将此属性设置为 true 以启用节点自动修复。否则,请将其设置为 false

示例:

autoRepair:
  enabled: true

secretsEncryption

如果您想加密 Secret 而无需外部 KMS(密钥管理服务)或任何其他依赖项,请填写此部分。否则,请移除此部分或将其注释掉。

secretsEncryption.mode

对于 Secret 加密是必需的
不可变
字符串
可能的值:“GeneratedKey”
预填充值:“GeneratedKey”

Secret 加密模式。

secretsEncryption:
  mode: "GeneratedKey"

secretsEncryption.generatedKey.keyVersion

对于 Secret 加密是必需的
可变
整数
预填充值:1

您选择用于密钥版本号的整数。我们建议您从 1 开始。

如需了解如何为现有集群更新此字段,请参阅始终开启的 Secret 加密

示例:

secretsEncryption:
  generatedKey:
    keyVersion: 1

secretsEncryption.generatedKey.disabled

可变
布尔值
预填充值:false

将此值设置为 true 以停用 Secret 加密。否则,请将其设置为 false

如需了解如何为现有集群更新此字段,请参阅始终开启的 Secret 加密

示例:

secretsEncryption:
  generatedKey:
    disabled: false