Skip to main content

Creating a Talos Linux Cluster on Apache CloudStack via the CMK CLI

In this guide we will create an single node Kubernetes cluster in Apache CloudStack. We assume Apache CloudStack is already running in a basic configuration - and some familiarity with Apache CloudStack. We will be using the CloudStack Cloudmonkey CLI tool. Please see the official Apache CloudStack documentation for information related to Apache CloudStack.

Obtain the Talos image

Download the Talos CloudStack image cloudstack-amd64.raw.gz from the Image Factory.
Note: the minimum version of Talos required to support Apache CloudStack is v1.8.0.
Using an upload method of your choice, upload the image to a Apache CloudStack. You might be able to use the “Register Template from URL” to download the image directly from the Image Factory.
Note: CloudStack does not seem to like compressed images, so you might have to download the image to a local webserver, uncompress it and let CloudStack fetch the image from there instead. Alternatively, you can try to remove .gz from URL to fetch an uncompressed image from the Image Factory.

Get required variables

Next we will get a number of required variables and export them for later use:

Get image template ID

Get Zone ID

Get a list of Zones and select the relevant zone

Get service offering ID

Get a list of service offerings (instance types) and select the desired offering

Get network ID

Get a list of networks and select the relevant network for your cluster.

Get next free public IP address and ID

To create a loadbalancer for the K8S API Endpoint, find the next available public IP address in the zone. (In this test environment, the 10.0.0.0/24 RFC-1918 IP range has been configured as “Public IP addresses”)

Acquire and associate Public IP Address

Acquire and associate the public IP address with the network we selected earlier.

Create LB and FW rule using the public IP address

Create a Loadbalancer for the K8S API Endpoint.
Note: The “create loadbalancerrule” also takes care of creating a corresponding firewallrule.

Create the Talos configuration files

Finally it’s time to generate the Talos configuration files, using the Public IP address assigned to the loadbalancer.
Make any adjustments to the controlplane.yaml and/or worker.yaml as you like.
Note: Remember to validate!

Create Talos VM

Next we will create the actual VM and supply the controlplane.yaml as base64 encoded userdata.

Get Talos VM ID and internal IP address

Get the ID of our newly created VM. (Also available in the full output of the above command.)

Get load balancer ID

Obtain the ID of the loadbalancerrule we created earlier.

Assign Talos VM to load balancer

With the ID of the VM and the load balancer, we can assign the VM to the loadbalancerrule, making the K8S API endpoint available via the Load Balancer

Bootstrap etcd

Once the Talos VM has booted, it time to bootstrap etcd. Configure talosctl with IP addresses of the control plane node’s IP address. Set the endpoints and nodes:
Next, bootstrap etcd:

Retrieve the kubeconfig

At this point we can retrieve the admin kubeconfig by running:
We can also watch the cluster bootstrap via: