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 imagecloudstack-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 zoneGet Service Offering ID
Get a list of service offerings (instance types) and select the desired offeringGet 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.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 thecontrolplane.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 theloadbalancerrule
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 theloadbalancerrule
, making the K8S API endpoint available via the Load Balancer
Bootstrap Etcd
Once the Talos VM has booted, it time to bootstrap etcd. Configuretalosctl
with IP addresses of the control plane node’s IP address.
Set the endpoints
and nodes
:
etcd
:
Retrieve the kubeconfig
At this point we can retrieve the admin kubeconfig
by running: