Create the Image
The best way to create an image for UpCloud, is to build one using Hashicorp packer, with theupcloud-amd64.raw.xz
image available from the Image Factory.
Using the general ISO is also possible, but the UpCloud image has some UpCloud
specific features implemented, such as the fetching of metadata and user data to configure the nodes.
To create the cluster, you need a few things locally installed:
NOTE: Make sure your account allows API connections. To do so, log into UpCloud control panel and go to People -> Account -> Permissions -> Allow API connections checkbox. It is recommended to create a separate subaccount for your API access and only set the API permission.To use the UpCloud CLI, you need to create a config in
$HOME/.config/upctl.yaml
.bashrc
or .zshrc
Creating a Cluster via the CLI
Create an Endpoint
To communicate with the Talos cluster you will need a single endpoint that is used to access the cluster. This can either be a loadbalancer that will sit in front of all your control plane nodes, a DNS name with one or more A or AAAA records pointing to the control plane nodes, or directly the IP of a control plane node. Which option is best for you will depend on your needs. Endpoint selection has been further documented here. After you decide on which endpoint to use, note down the domain name or IP, as we will need it in the next step.Create the Machine Configuration Files
Generating Base Configurations
Using the DNS name of the endpoint created earlier, generate the base configuration files for the Talos machines:Validate the Configuration Files
Create the Servers
Create the Control Plane Nodes
Run the following to create three total control plane nodes:Note: modify the zone and OS depending on your preferences. The OS should match the template name generated with packer in the previous step.Note the IP address of the first control plane node, as we will need it later.
Create the Worker Nodes
Run the following to create a worker node:Bootstrap Etcd
To configuretalosctl
we will need the first control plane node’s IP, as noted earlier.
We only add one node IP, as that is the entry into our cluster against which our commands will be run.
All requests to other nodes are proxied through the endpoint, and therefore not
all nodes need to be manually added to the config.
You don’t want to run your commands against all nodes, as this can destroy your
cluster if you are not careful (further documentation).
Set the endpoints
and nodes
:
etcd
:
Retrieve the kubeconfig
At this point we can retrieve the admin kubeconfig
by running: