• Русский
  • Подготовка параметров для кластера VMware vSphere

    Этот документ поможет вам собрать значения, необходимые для создания workload-кластера VMware vSphere из кластера global. Выполните этот контрольный список перед применением манифестов в Создание кластера в кластере global.

    Сценарии

    Используйте этот контрольный список в следующих сценариях:

    • Вы готовите развертывание нового кластера VMware vSphere.
    • Вы хотите проверить внешние зависимости до начала развертывания.
    • Вы планируете включить расширенные сценарии, такие как несколько датацентров, несколько NIC или дополнительные worker-узлы.

    Предварительные требования

    Перед началом убедитесь, что выполнены следующие условия:

    • У вас есть доступ к кластеру global через kubectl.
    • Объекты workload-кластера должны храниться в namespace cpaas-system.
    • У вас есть доступ к целевым инвентарям vCenter, сетям, datastore и шаблонам.

    Как использовать этот контрольный список

    Используйте этот контрольный список в следующем порядке:

    1. Соберите параметры развертывания, перечисленные в этом документе.
    2. Замените каждый placeholder в шаблонах манифестов фактическими значениями, собранными здесь.
    3. Повторно используйте одно и то же значение везде, где один и тот же placeholder встречается в нескольких манифестах.
    4. Если опциональная функция не включена, удалите соответствующий блок YAML в точности так, как описано в документе расширения.
    5. Если опциональное поле (например, deviceName) не требуется, удалите всю строку из YAML-манифеста.

    Терминология

    Следующие термины последовательно используются во всех документах по созданию кластера VMware vSphere.

    machine config pool

    machine config pool — это custom resource VSphereMachineConfigPool. Он предварительно определяет слоты узлов. Каждый слот может включать:

    • hostname узла
    • целевой датацентр
    • статическую IP-конфигурацию для каждого NIC
    • определения постоянных дисков
    WARNING

    На каждый VSphereMachineConfigPool может ссылаться только один KubeadmControlPlane или один MachineDeployment. Не используйте один VSphereMachineConfigPool совместно для нескольких control plane или worker-групп. Если pool уже привязан к другому потребителю, VSphereMachine сообщит о condition MachineConfigPoolReady=False с причиной PoolBoundToOtherConsumer.

    Слот узла

    Слот узла — это запись в VSphereMachineConfigPool.spec.configs[]. Один слот обычно соответствует одному узлу, например cp-01 или worker-01. hostname слота определяет имя узла Kubernetes, DNS SAN сертификата kubelet serving certificate и (в сочетании с разрешенными адресами primary NIC) node-ip kubelet; он должен быть допустимым DNS-1123 subdomain.

    Схема сети слота

    Каждый слот объявляет свою схему NIC в network.primary и network.additional:

    • network.primary обязателен. Его networkName должен быть задан и используется как источник node-ip для kubelet.
    • network.additional — это необязательный список дополнительных NIC, который объединяется после primary NIC в указанном порядке.

    deviceName

    deviceName — это необязательное поле в конфигурации сети VSphereMachineConfigPool. Оно используется для управления именем NIC, которое видно внутри гостевой операционной системы, например eth0 или eth1.

    Используйте следующие различия при заполнении значений:

    • networkName — это имя сети или port group в vCenter.
    • deviceName — это имя NIC внутри гостевой операционной системы.
    • Если deviceName опущен, CAPV обычно назначает имена eth0, eth1 и eth2 по порядку NIC.

    vCenter resource pool

    vCenter resource pool — это нативный объект инвентаря vCenter, например:

    /Datacenter1/host/cluster1/Resources

    В сценариях расширения этот путь используется VSphereDeploymentZone.spec.placementConstraint.resourcePool.

    Compute cluster

    Compute cluster — это имя целевого compute-cluster в vCenter. В этих документах оно в основном используется, когда VSphereFailureDomain сопоставляется с конкретной целью развертывания.

    Datastore

    Datastore — это хранилище vSphere, в котором размещаются диски VM. И системные диски, и диски данных должны размещаться на конкретных datastore.

    VM template

    VM template — это исходный шаблон, который используется для создания виртуальных машин узлов. При включении нескольких датацентров один и тот же шаблон должен уже существовать в каждом целевом датацентре и должен определяться по одному и тому же имени шаблона.

    Thumbprint

    Thumbprint — это SHA-1 fingerprint сертификата сервера vCenter. CAPV использует его для проверки целевого сервера vCenter.

    Используйте следующую команду, чтобы получить его:

    openssl s_client -connect <vsphere_server>:443 -servername <vsphere_server> </dev/null 2>/dev/null | openssl x509 -noout -fingerprint -sha1

    Предварительные требования к management-кластеру

    Используйте следующую таблицу для записи требуемых значений и результатов проверки.

    ParameterPlaceholderRequiredValidation or NotesExampleActual Value
    global cluster kubeconfig path-Yeskubectl get ns succeeds with this kubeconfig./path/to/kubeconfig-
    Workload object namespace<namespace>YesThe namespace that stores workload cluster objects. Must be cpaas-system.cpaas-system-
    cluster-api-provider-vsphere is installed-Yeskubectl get minfo -l cpaas.io/module-name=cluster-api-provider-vsphere returns a result.Yes-
    cluster-api-provider-kubeadm is installed-Yeskubectl get minfo -l cpaas.io/module-name=cluster-api-provider-kubeadm returns a result.Yes-
    ClusterResourceSet=true is enabled-YesThe capi-controller-manager arguments include ClusterResourceSet=true.Yes-

    Предварительные требования к vCenter и шаблону

    Информация о подключении к vCenter

    ParameterPlaceholderRequiredValidation or NotesExampleActual Value
    vCenter server<vsphere_server>YesUse the vCenter IP address or FQDN.vc.example.local-
    vCenter username<vsphere_username>YesUsed by CAPV to authenticate to vCenter.svc-capv@example.local-
    vCenter password<vsphere_password>YesUsed by CAPV to authenticate to vCenter.******-
    Thumbprint<thumbprint>YesRetrieve it with the openssl command shown earlier.AA:BB:CC:...-

    Примечание: В этих документах предполагается стандартный HTTPS-port vCenter 443.

    Требования к VM template

    ParameterPlaceholderRequiredValidation or NotesExampleActual Value
    VM template name<template_name>YesUsed to clone control plane and worker nodes.microos-k8s-template-
    vCenter credential secret name<credentials_secret_name>YesUse a stable name such as <cluster_name>-vsphere-credentials.demo-cluster-vsphere-credentials-
    Clone mode<clone_mode>YesAllowed values: linkedClone, fullClone. Default is linkedClone. linkedClone requires the VM template to have at least one snapshot; if none exists, CAPV falls back to fullClone. When linkedClone is used, diskGiB is ignored; the system disk stays at the template's size. Choose fullClone if you need diskGiB to take effect.linkedClone-
    Power-off mode<power_off_mode>YesAllowed values: hard, soft, trySoft. Default is hard. soft and trySoft require VMware Tools / open-vm-tools in the template for graceful shutdown; trySoft falls back to hard after the guest-soft-power-off timeout.trySoft-
    SSH public key<ssh_public_key>YesInjected into control plane and worker nodes.ssh-rsa AAAA...-

    Шаблон также должен соответствовать следующим требованиям:

    • Он использует операционную систему, поддерживаемую вашей policy образов платформы.
    • Он включает cloud-init.
    • Он включает VMware Tools или open-vm-tools.
    • Он включает containerd.
    • Он включает базовые компоненты, необходимые для bootstrap kubeadm.
    • Он включает заранее экспортированные container image tar files в /root/images/. Эти файлы импортируются в containerd скриптом capv-load-local-images.sh до запуска kubeadm, чтобы bootstrap узла не зависел от загрузки образов из удаленного registry.
    • Файлы /root/images/*.tar обязательно должны включать sandbox (pause) image, ссылка на который в точности совпадает со значением sandbox_image (containerd v1) или sandbox (containerd v2), настроенным в /etc/containerd/config.toml. Например, если containerd настроен с sandbox_image = "registry.example.com/tkestack/pause:3.10", один из tar-файлов должен содержать именно эту ссылку на образ. Несоответствие приводит к тому, что containerd будет загружать sandbox image из сети, что сводит на нет смысл локальной предварительной загрузки и приводит к сбою в air-gapped окружениях.

    Предварительные требования к Load Balancer

    ParameterPlaceholderRequiredValidation or NotesExampleActual Value
    Control plane VIP<vip>YesThe VIP is already allocated.10.10.10.10-
    API server port<api_server_port>YesThe default port is 6443.6443-
    VIP connectivity-YesThe execution environment can reach VIP:6443.Yes-
    Real server maintenance ownership-YesDefine who maintains the backend targets if the load balancer does not update them automatically.Platform team-

    Базовые параметры кластера

    ParameterPlaceholderRequiredValidation or NotesExampleActual Value
    Cluster name<cluster_name>YesUse the same value in all manifests.demo-cluster-
    Kubernetes version<k8s_version>YesUse the version required by the target platform release.v1.33.7-2-
    Control plane replicas<cp_replicas>YesThe baseline topology uses 3.3-
    Worker replicas<worker_replicas>YesThe baseline topology uses 1.1-
    Pod CIDR<pod_cidr>YesMust not overlap with existing networks.10.244.0.0/16-
    Service CIDR<service_cidr>YesMust not overlap with existing networks.10.96.0.0/12-
    Image registry<image_registry>YesPrivate registry address. kubeadm imageRepository is set to <image_registry>/tkestack.registry.example.local-
    kube-ovn version<kube_ovn_version>YesMust match the platform network plugin requirements.v4.2.26-
    kube-ovn-join-cidr<kube_ovn_join_cidr>YesMust not overlap with other networks.100.64.0.0/16-
    CoreDNS image tag<dns_image_tag>YesUse the tag approved for the Kubernetes version.1.12.4-
    etcd image tag<etcd_image_tag>YesUse the tag approved for the Kubernetes version.v3.5.0-
    Encryption provider secret<encryption_provider_secret>YesBase64-encoded AES key for secret encryption at rest. Generate with head -c 32 /dev/urandom | base64. Do not reuse example values.(generated)-

    Минимальные параметры для single-datacenter

    Размещение датацентра и ресурсов

    ParameterPlaceholderRequiredValidation or NotesExampleActual Value
    Default datacenter<default_datacenter>YesUsed by the baseline topology.dc-a-

    Параметры primary NIC

    ParameterPlaceholderRequiredValidation or NotesExampleActual Value
    vCenter network name<nic1_network_name>YesThe first network or port group name in vCenter.pg-business-
    Guest NIC name<nic1_device_name>NoSet it only when you need to force the guest NIC name. If not needed, remove the deviceName line from the YAML manifests.eth0-
    Gateway<nic1_gateway>YesDefault gateway for the primary NIC.10.10.10.1-
    Prefix length<nic1_prefix>YesUsed with each node IP address.24-
    DNS server 1<nic1_dns_1>YesDNS server for the primary NIC.10.10.0.10-

    machine config pool control plane

    ParameterPlaceholderRequiredValidation or NotesExampleActual Value
    Control plane pool name<cp_pool_name>Yesmachine config pool name for control plane nodes.demo-cluster-control-plane-pool-
    Control plane node 1 hostname<cp_node_name_1>YesNode name and kubelet serving cert SAN for the first control plane node. Must be a valid DNS-1123 subdomain.cp-01-
    Control plane node 1 datacenter<master_01_datacenter>YesUsually the same as the default datacenter.dc-a-
    Control plane node 1 IP address<master_01_nic1_ip>YesIPv4 address only, without the prefix length.10.10.10.11-
    Control plane node 2 hostname<cp_node_name_2>YesNode name and kubelet serving cert SAN for the second control plane node. Must be a valid DNS-1123 subdomain.cp-02-
    Control plane node 2 datacenter<master_02_datacenter>YesUsually the same as the default datacenter.dc-a-
    Control plane node 2 IP address<master_02_nic1_ip>YesIPv4 address only, without the prefix length.10.10.10.12-
    Control plane node 3 hostname<cp_node_name_3>YesNode name and kubelet serving cert SAN for the third control plane node. Must be a valid DNS-1123 subdomain.cp-03-
    Control plane node 3 datacenter<master_03_datacenter>YesUsually the same as the default datacenter.dc-a-
    Control plane node 3 IP address<master_03_nic1_ip>YesIPv4 address only, without the prefix length.10.10.10.13-

    machine config pool worker

    ParameterPlaceholderRequiredValidation or NotesExampleActual Value
    Worker pool name<worker_pool_name>Yesmachine config pool name for worker nodes.demo-cluster-worker-pool-
    Worker node 1 hostname<worker_node_name_1>YesNode name and kubelet serving cert SAN for the first worker node. Must be a valid DNS-1123 subdomain.worker-01-
    Worker node 1 datacenter<worker_01_datacenter>YesUsually the same as the default datacenter.dc-a-
    Worker node 1 IP address<worker_01_nic1_ip>YesIPv4 address only, without the prefix length.10.10.10.21-
    Worker node 2 hostname<worker_node_name_2>NoUsed when you scale out the worker pool.worker-02-
    Worker node 2 datacenter<worker_02_datacenter>NoUsed when you scale out the worker pool.dc-b-
    Worker node 2 IP address<worker_02_nic1_ip>NoUsed when you scale out the worker pool.10.10.10.22-
    releaseDelayHours<release_delay_hours>YesDelay before CAPV reuses a released slot.24-

    Параметры вычислительных ресурсов

    ParameterPlaceholderRequiredValidation or NotesExampleActual Value
    Control plane CPU<cp_num_cpus>YesCPU count per control plane node.4-
    Control plane memory MiB<cp_memory_mib>YesMemory per control plane node.8192-
    Control plane system datastore<cp_system_datastore>YesDatastore for the control plane system disk.datastore-cp-
    Control plane system disk size GiB<cp_system_disk_gib>YesBaseline example value is 300. Ignored when <clone_mode> is linkedClone; the system disk then stays at the template's size.300-
    Worker CPU<worker_num_cpus>YesCPU count per worker node.2-
    Worker memory MiB<worker_memory_mib>YesMemory per worker node.4096-
    Worker system datastore<worker_system_datastore>YesDatastore for the worker system disk.datastore-worker-
    Worker system disk size GiB<worker_system_disk_gib>YesBaseline example value is 300. Ignored when <clone_mode> is linkedClone; the system disk then stays at the template's size.300-

    Стандартные диски данных

    Каждая роль узла требует набора выделенных дисков данных. Перечисленные ниже диски являются минимально необходимыми. Вы можете добавить дополнительные диски в список persistentDisks, если они требуются вашему workload.

    Поля persistent disk

    FieldRequiredDefaultDescription
    nameYesUnique disk name within the slot.
    sizeGiBYesDisk size in GiB.
    mountPathNo(empty)Mount path inside the guest OS. If empty, the disk is attached as a raw device with a symlink at /dev/disk/by-capv/<name> but is not formatted or mounted. This is useful when an external process manages the disk at runtime.
    fsFormatNoext4 (when mountPath is set)Filesystem format. Ignored when mountPath is empty.
    wipeFilesystemNofalseWhen true, disk content is wiped on the first boot of a new VM. Reboots and manual service restarts are not affected. Use for etcd disks to prevent stale data from blocking kubeadm join during rolling updates.
    datastoreNo(pool default)Override the datastore for this disk.

    Control plane nodes (3 disks per node)

    Disk NameMount PathwipeFilesystemPurposeRecommended Minimum SizePlaceholder
    var-cpaas/var/cpaasfalseStores logs, audit data, and other platform data100 GiB<cp_var_cpaas_size_gib>
    var-lib-containerd/var/lib/containerdfalseStores containerd runtime data (images, layers, snapshots)100 GiB<cp_var_lib_containerd_size_gib>
    var-lib-etcd/var/lib/etcdtrueStores etcd data. Must set wipeFilesystem: true to allow kubeadm join during rolling updates.100 GiB<cp_var_lib_etcd_size_gib>

    Worker nodes (2 disks per node)

    Disk NameMount PathwipeFilesystemPurposeRecommended Minimum SizePlaceholder
    var-cpaas/var/cpaasfalseStores logs, audit data, and other platform data100 GiB<worker_var_cpaas_size_gib>
    var-lib-containerd/var/lib/containerdfalseStores containerd runtime data (images, layers, snapshots)100 GiB<worker_var_lib_containerd_size_gib>

    Параметры размера

    ParameterPlaceholderRequiredValidation or NotesExampleActual Value
    CP /var/cpaas size GiB<cp_var_cpaas_size_gib>YesRecommended minimum 100 GiB.100-
    CP /var/lib/containerd size GiB<cp_var_lib_containerd_size_gib>YesRecommended minimum 100 GiB.100-
    CP /var/lib/etcd size GiB<cp_var_lib_etcd_size_gib>YesRecommended minimum 100 GiB.100-
    Worker /var/cpaas size GiB<worker_var_cpaas_size_gib>YesRecommended minimum 100 GiB.100-
    Worker /var/lib/containerd size GiB<worker_var_lib_containerd_size_gib>YesRecommended minimum 100 GiB.100-

    Параметры vSphere CPI

    ParameterPlaceholderRequiredValidation or NotesExampleActual Value
    CPI datacenter list<cpi_datacenters>YesInclude every target datacenter when multiple datacenters are enabled.dc-a,dc-b-
    CPI image tag<cpi_image_tag>YesTag for the vSphere CPI component. The full reference is <image_registry>/ait/cloud-provider-vsphere:<cpi_image_tag>.v1.33.1-alauda.1-
    CPI insecure flag<cpi_insecure_flag>YesThe baseline example uses 1.1-

    Параметры опциональных расширений

    Несколько датацентров и несколько failure domains

    ParameterPlaceholderRequiredValidation or NotesExampleActual Value
    Datacenter 1 failure domain name<fd_name_1>NoRequired only when you enable failure domains.fd-a-
    Datacenter 1 deployment zone name<dz_name_1>NoRequired only when you enable failure domains.dz-a-
    Compute cluster name<compute_cluster_1>NoRequired only when you enable failure domains.compute-a-
    Default datastore<default_datastore_1>NoRequired only when you enable failure domains.datastore-a-
    vCenter resource pool path<resource_pool_path_1>NoRequired only when you enable failure domains. Must exist in vCenter inventory./dc-a/host/compute-a/Resources-
    Datacenter 2 name<dc_name_2>NoUsed only for multiple datacenters or failure domains.dc-b-
    Datacenter 2 failure domain name<fd_name_2>NoUsed only for multiple datacenters or failure domains.fd-b-
    Datacenter 2 deployment zone name<dz_name_2>NoUsed only for multiple datacenters or failure domains.dz-b-
    Datacenter 2 compute cluster<compute_cluster_2>NoUsed only for multiple datacenters or failure domains.compute-b-
    Datacenter 2 default datastore<default_datastore_2>NoUsed only for multiple datacenters or failure domains.datastore-b-
    Datacenter 2 vCenter resource pool path<resource_pool_path_2>NoUsed only for multiple datacenters or failure domains./dc-b/host/compute-b/Resources-
    Worker deployment zone<worker_failure_domain>NoUse a VSphereDeploymentZone name, not a VSphereFailureDomain name.dz-a-
    Datacenter 3 name<dc_name_3>NoUsed only for additional datacenter or failure-domain scenarios.dc-c-
    Datacenter 3 failure domain name<fd_name_3>NoUsed only for additional datacenter or failure-domain scenarios.fd-c-
    Datacenter 3 deployment zone name<dz_name_3>NoUsed only for additional datacenter or failure-domain scenarios.dz-c-
    Datacenter 3 compute cluster<compute_cluster_3>NoUsed only for additional datacenter or failure-domain scenarios.compute-c-
    Datacenter 3 default datastore<default_datastore_3>NoUsed only for additional datacenter or failure-domain scenarios.datastore-c-
    Datacenter 3 vCenter resource pool path<resource_pool_path_3>NoUsed only for additional datacenter or failure-domain scenarios./dc-c/host/compute-c/Resources-

    Параметры второго NIC

    ParameterPlaceholderRequiredValidation or NotesExampleActual Value
    Secondary network name<nic2_network_name>NoUsed only when nodes require a second NIC.pg-management-
    Secondary guest NIC name<nic2_device_name>NoSet it only when you need to force the guest NIC name.eth1-
    Secondary gateway<nic2_gateway>NoUsed only when nodes require a second NIC.10.20.10.1-
    Secondary prefix length<nic2_prefix>NoUsed with each secondary NIC IP address.24-
    Secondary DNS server 1<nic2_dns_1>NoUsed only when nodes require a second NIC.10.20.0.10-
    Control plane node 1 secondary IP<master_01_nic2_ip>NoUsed only when nodes require a second NIC.10.20.10.11-
    Control plane node 2 secondary IP<master_02_nic2_ip>NoUsed only when nodes require a second NIC.10.20.10.12-
    Control plane node 3 secondary IP<master_03_nic2_ip>NoUsed only when nodes require a second NIC.10.20.10.13-
    Worker node 1 secondary IP<worker_01_nic2_ip>NoUsed only when nodes require a second NIC.10.20.10.21-
    Worker node 2 secondary IP<worker_02_nic2_ip>NoUsed when workers are expanded and require a second NIC.10.20.10.22-

    Итоговая проверка готовности

    Перед началом развертывания подтвердите все следующие пункты:

    1. Кластер global доступен.
    2. Убедитесь, что установлены два cluster plugin: Alauda Container Platform Kubeadm Provider и Alauda Container Platform VMware vSphere Infrastructure Provider.
    3. ClusterResourceSet=true включен.
    4. Сервер vCenter, имя пользователя, пароль и thumbprint собраны.
    5. Control plane VIP, load balancer и порт 6443 готовы.
    6. Pod CIDR, Service CIDR и kube-ovn-join-cidr не пересекаются с существующими сетями.
    7. VM template доступен в каждом требуемом датацентре.
    8. Необходимые datastore и пути resource pool в vCenter подтверждены.
    9. Значения machine config pool для минимальной single-datacenter topology заполнены.
    10. Подтверждены размеры базовых системных дисков и дисков данных.
    11. Каждый требуемый параметр имеет фактическое значение.

    Следующие шаги

    После завершения этого контрольного списка перейдите к Создание кластера в кластере global.