Skip to main content

Creating a cluster via the govc CLI

In this guide we will create an HA Kubernetes cluster with 2 worker nodes. We will use the govc cli which can be downloaded here.

Prerequisites

This guide will use the virtual IP (“VIP”) functionality that is built into Talos in order to provide a stable, known IP for the Kubernetes control plane. This simply means the user should pick an IP on their “VM Network” to designate for this purpose and keep it handy for future steps. The Talos OVA image uses the vmx-15 hardware version, this requires a minimum of ESXi 6.7U2. To check your version of ESXi refer to the following Broadcom KB article. More information regarding virtual machine hardware versions can be found in the following Broadcom KB article.

Create the machine configuration files

Generating base configurations

Using the VIP chosen in the prereq steps, we will now generate the base configuration files for the Talos machines. This can be done with the talosctl gen config ... command. Take note that we will also use a JSON6902 patch when creating the configs so that the control plane nodes get some special information about the VIP we chose earlier, as well as a daemonset to install vmware tools on talos nodes. First, download cp.patch.yaml to your local machine and edit the VIP to match your chosen IP. You can do this by issuing: It’s contents should look like the following:
With the patch in hand, generate machine configs with:
At this point, you can modify the generated configs to your liking if needed. Optionally, you can specify additional patches by adding to the cp.patch.yaml file downloaded earlier, or create your own patch files.

Validate the configuration files

Note: Using VMXNET network interfaces in VMware will cause the default Flannel CNI backend (vxlan) to not work between nodes. To avoid this problem it is recommended to use Intel e1000 network interfaces or apply the patch below to disable incompatible features.
Add the following configuration to disable incompatible hardware acceleration features.

Set environment variables

govc makes use of the following environment variables
Note: If your vCenter installation makes use of self signed certificates, you’ll want to export GOVC_INSECURE=true.
There are some additional variables that you may need to set:

Choose install approach

As part of this guide, we have a more automated install script that handles some of the complexity of importing OVAs and creating VMs. If you wish to use this script, we will detail that next. If you wish to carry out the manual approach, simply skip ahead to the “Manual Approach” section.

Scripted install

Download the vmware.sh script to your local machine. You can do this by issuing: This script has default variables for things like Talos version and cluster name that may be interesting to tweak before deploying. The script downloads VMWare OVA with talos-vmtoolsd from Image Factory extension pre-installed.

Import OVA

To create a content library and import the Talos OVA corresponding to the mentioned Talos version, simply issue:

Create cluster

With the OVA uploaded to the content library, you can create a 5 node (by default) cluster with 3 control plane and 2 worker nodes:
This step will create a VM from the OVA, edit the settings based on the env variables used for VM size/specs, then power on the VMs. You may now skip past the “Manual Approach” section down to “Bootstrap Cluster”.

Manual approach

Import the OVA into vCenter

A talos.ova asset is available from Image Factory. We will refer to the version of the release as $TALOS_VERSION below. It can be easily exported with export TALOS_VERSION="v0.3.0-alpha.10" or similar. The download link already includes the talos-vmtoolsd extension.
Create a content library (if needed) with:
Import the OVA to the library with:

Create the bootstrap node

We’ll clone the OVA to create the bootstrap node (our first control plane node).
Talos makes use of the guestinfo facility of VMware to provide the machine/cluster configuration. This can be set using the govc vm.change command. To facilitate persistent storage using the vSphere cloud provider integration with Kubernetes, disk.enableUUID=1 is used.

Update hardware resources for the bootstrap node

  • -c is used to configure the number of cpus
  • -m is used to configure the amount of memory (in MB)
The following can be used to adjust the EPHEMERAL disk size.

Create the remaining control plane nodes

Update settings for the worker nodes

Bootstrap cluster

In the vSphere UI, open a console to one of the control plane nodes. You should see some output stating that etcd should be bootstrapped. This text should look like:
Take note of the IP mentioned here and issue:
Keep this IP handy for the following steps as well.

Retrieve the kubeconfig

At this point we can retrieve the admin kubeconfig by running:

Configure talos-vmtoolsd

The talos-vmtoolsd application was deployed as a daemonset as part of the cluster creation; however, we must now provide a talos credentials file for it to use. Create a new talosconfig with:
Create a secret from the talosconfig:
Clean up the generated file from local system:
Once configured, you should now see these daemonset pods go into “Running” state and in vCenter, you will now see IPs and info from the Talos nodes present in the UI.