In order to provision Kubernetes clusters in vSphere with the RKE CLI, you must enable the vSphere cloud provider.

The vSphere cloud provider must also be enabled in order to provision clusters with Rancher, which uses RKE as a library when provisioning RKE clusters.

The vSphere Cloud Provider interacts with VMware infrastructure (vCenter or standalone ESXi server) to provision and manage storage for persistent volumes in a Kubernetes cluster.

This section describes how to enable the vSphere cloud provider. You will need to use the cloud_provider directive in the cluster YAML file.

Prerequisites

  • Credentials: You’ll need to have credentials of a vCenter/ESXi user account with privileges allowing the cloud provider to interact with the vSphere infrastructure to provision storage.¬†Refer to this document to create and assign a role with the required permissions in vCenter.
  • VMware Tools must be running in the Guest OS for all nodes in the cluster.
  • Disk UUIDs: All nodes must be configured with disk UUIDs. This is required so that attached VMDKs present a consistent UUID to the VM, allowing the disk to be mounted properly. See the section on enabling disk UUIDs.

Enabling the vSphere Provider with the RKE CLI

To enable the vSphere Cloud Provider in the cluster, you must add the top-level cloud_provider directive to the cluster configuration file, set the name property to vsphere and add the vsphereCloudProvider directive containing the configuration matching your infrastructure. See the configuration reference for the gory details.