Skip to content

vSphere cluster template parameters#

ClusterDeployment parameters#

To create a cluster deployment a number of parameters should be passed to the ClusterDeployment object.

Parameter list#

The following is the list of vSphere specific parameters that are required for successful cluster creation.

Parameter Example Description
.spec.config.vsphere.server vcenter.example.com Address of the vSphere instance
.spec.config.vsphere.thumbprint "00:00:00:..." Certificate thumbprint
.spec.config.vsphere.datacenter DC Datacenter name
.spec.config.vsphere.datastore /DC/datastore/DS Datastore path
.spec.config.vsphere.resourcePool /DC/host/vCluster/Resources/ResPool Resource pool path
.spec.config.vsphere.folder /DC/vm/example Folder path
.spec.config.controlPlane.network /DC/network/vm_net Network path for controlPlane
.spec.config.worker.network /DC/network/vm_net Network path for worker
.spec.config.*.ssh.publicKey "ssh-ed25519 AAAA..." SSH public key in authorized_keys format
.spec.config.*.vmTemplate /DC/vm/templates/ubuntu VM template image path
.spec.config.controlPlaneEndpointIP 172.16.0.10 kube-vip vIP which will be created for control plane endpoint

To get the vSphere certificate thumbprint you can use the following command:

curl -sw %{certs} https://vcenter.example.com | openssl x509 -sha256 -fingerprint -noout | awk -F '=' '{print $2}'

govc, a vSphere CLI, can also help to discover proper values for some of the parameters:

# vsphere.datacenter
govc ls

# vsphere.datastore
govc ls /*/datastore/*

# vsphere.resourcePool
govc ls /*/host/*/Resources/*

# vsphere.folder
govc ls -l /*/vm/**

# controlPlane.network, worker.network
govc ls /*/network/*

# *.vmTemplate
govc vm.info -t '*'

Note

Follow official govc installation instructions from here. The govc usage guide is here.

Minimal govc configuration requires setting: GOVC_URL, GOVC_USERNAME, GOVC_PASSWORD environment variables.

Example of a ClusterDeployment CR#

With all above parameters provided your ClusterDeployment can look like this:

apiVersion: k0rdent.mirantis.com/v1beta1
kind: ClusterDeployment
metadata:
  name: cluster-1
spec:
  template: vsphere-standalone-cp-1-0-0
  credential: vsphere-credential
  config:
    clusterLabels: {}
    vsphere:
      server: vcenter.example.com
      thumbprint: "00:00:00"
      datacenter: "DC"
      datastore: "/DC/datastore/DC"
      resourcePool: "/DC/host/vCluster/Resources/ResPool"
      folder: "/DC/vm/example"
    controlPlaneEndpointIP: "<VSPHERE_SERVER>"
    controlPlane:
      ssh:
        user: ubuntu
        publicKey: |
          ssh-rsa AAA...
      rootVolumeSize: 50
      cpus: 2
      memory: 4096
      vmTemplate: "/DC/vm/template"
      network: "/DC/network/Net"
    worker:
      ssh:
        user: ubuntu
        publicKey: |
          ssh-rsa AAA...
      rootVolumeSize: 50
      cpus: 2
      memory: 4096
      vmTemplate: "/DC/vm/template"
      network: "/DC/network/Net"

Don't forget to replace placeholder values such as VSPHERE_SERVER with actual values for your environment.

SSH#

Currently SSH configuration on vSphere expects that the user is already created before template creation. Because of that you must pass the username along with the SSH public key to configure SSH access.

The SSH public key can be passed to .spec.config.ssh.publicKey (in the case of a hosted control plane) or .spec.config.controlPlane.ssh.publicKey and .spec.config.worker.ssh.publicKey (in the case of a standalone control) of the ClusterDeployment object.

The SSH public key must be passed literally as a string.

You can pass the username to .spec.config.controlPlane.ssh.user, .spec.config.worker.ssh.user or .spec.config.ssh.user, depending on you deployment model.

VM resources#

The following parameters are used to define VM resources:

Parameter Example Description
.rootVolumeSize 50 Root volume size in GB (can't be less than the one defined in the image)
.cpus 2 Number of CPUs
.memory 4096 Memory size in MB

The resource parameters are the same for hosted and standalone CP deployments, but they are positioned differently in the spec, which means that they're going to:

  • .spec.config in case of hosted CP deployment.
  • .spec.config.controlPlane in in case of standalone CP for control plane nodes.
  • .spec.config.worker in in case of standalone CP for worker nodes.

VM Image and network#

To provide image template path and network path the following parameters must be used:

Parameter Example Description
.vmTemplate /DC/vm/template Image template path
.network /DC/network/Net Network path

As with resource parameters the position of these parameters in the ClusterDeployment depends on deployment type and these parameters are used in:

  • .spec.config in case of hosted CP deployment.
  • .spec.config.controlPlane in in case of standalone CP for control plane nodes.
  • .spec.config.worker in in case of standalone CP for worker nodes.