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.
Prereqs/Assumptions
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 thevmx-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 thetalosctl 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:
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 use the host gateway backend.If you apply the patch you can save this to a separate file (e.g. cni-patch.yaml) and apply it via
talosctl
.
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 thevmware.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:Manual Approach
Import the OVA into vCenter
Atalos.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 the Bootstrap Node
Weβll clone the OVA to create the bootstrap node (our first control plane node).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)
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:Retrieve the kubeconfig
At this point we can retrieve the admin kubeconfig
by running: