Skip to main content

Creating a cluster via the CLI

In this guide, we will create an HA Kubernetes cluster in OpenStack with 1 worker node. We will assume an existing some familiarity with OpenStack. If you need more information on OpenStack specifics, please see the official OpenStack documentation.

Environment setup

You should have an existing openrc file. This file will provide environment variables necessary to talk to your OpenStack cloud. See here for instructions on fetching this file.

Create the image

First, download the OpenStack image from Image Factory. These images are called openstack-$ARCH.tar.gz. Untar this file with tar -xvf openstack-$ARCH.tar.gz. The resulting file will be called disk.raw.

Upload the image

Once you have the image, you can upload to OpenStack with:

Network infrastructure

Load balancer and network ports

Once the image is prepared, you will need to work through setting up the network. Issue the following to create a load balancer, the necessary network ports for each control plane node, and associations between the two. Creating loadbalancer:
Creating ports:
Note: Take notice of the private and public IPs associated with each of these ports, as they will be used in the next step. Additionally, take node of the port ID, as it will be used in server creation.
Associate port’s private IPs to loadbalancer:

Security groups

This example uses the default security group in OpenStack. Ports have been opened to ensure that connectivity from both inside and outside the group is possible. You will want to allow, at a minimum, ports 6443 (Kubernetes API server) and 50000 (Talos API) from external sources. It is also recommended to allow communication over all ports from within the subnet.

Cluster configuration

With our networking bits setup, we’ll fetch the IP for our load balancer and create our configuration files.
Additionally, you can specify machine configuration patches which will be applied during the config generation.

Compute creation

We are now ready to create our OpenStack nodes. Create control plane:
Create worker:
Note: This step can be repeated to add more workers.

Bootstrap etcd

You should now be able to interact with your cluster with talosctl. We will use one of the floating IPs we allocated earlier. It does not matter which one. Set the endpoints and nodes:
Bootstrap etcd:

Retrieve the kubeconfig

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