Creating a Cluster via the CLI
In this guide, we will create an HA Kubernetes cluster in GCP with 1 worker node. We will assume an existing Cloud Storage bucket, and some familiarity with Google Cloud. If you need more information on Google Cloud specifics, please see the official Google documentation. jq and talosctl also needs to be installedManual Setup
Environment Setup
We’ll make use of the following environment variables throughout the setup. Edit the variables below with your correct information.Create the Image
First, download the Google Cloud image from Image Factory. These images are calledgcp-$ARCH.tar.gz
.
Upload the Image
Once you have downloaded the image, you can upload it to your storage bucket with:Register the image
Now that the image is present in our bucket, we’ll register it.Network Infrastructure
Load Balancers and Firewalls
Once the image is prepared, we’ll want to work through setting up the network. Issue the following to create a firewall, load balancer, and their required components.130.211.0.0/22
and 35.191.0.0/16
are the GCP Load Balancer IP ranges
Cluster Configuration
With our networking bits setup, we’ll fetch the IP for our load balancer and create our configuration files.Compute Creation
We are now ready to create our GCP nodes.Bootstrap Etcd
You should now be able to interact with your cluster withtalosctl
.
We will need to discover the public IP for our first control plane node first.
endpoints
and nodes
:
etcd
:
Retrieve the kubeconfig
At this point we can retrieve the admin kubeconfig
by running:
Cleanup
Using GCP Deployment manager
Using GCP deployment manager automatically creates a Google Storage bucket and uploads the Talos image to it. Once the deployment is complete the generatedtalosconfig
and kubeconfig
files are uploaded to the bucket.
By default this setup creates a three node control plane and a single worker in us-west1-b
First we need to create a folder to store our deployment manifests and perform all subsequent operations from that folder.
Getting the deployment manifests
We need to download two deployment manifests for the deployment from the Talos github repository.Updating the config
Now we need to update the localconfig.yaml
file with any required changes such as changing the default zone, Talos version, machine sizes, nodes count etc.
An example config.yaml
file is shown below:
Enabling external cloud provider
Note: TheexternalCloudProvider
property is set to false
by default.
The manifest used for deploying the ccm (cloud controller manager) is currently using the GCP ccm provided by openshift since there are no public images for the ccm yet.
Since the routes controller is disabled while deploying the CCM, the CNI pods needs to be restarted after the CCM deployment is complete to remove the node.kubernetes.io/network-unavailable
taint.
See Nodes network-unavailable taint not removed after installing ccm for more information
Use a custom built image for the ccm deployment if required.
Creating the deployment
Now we are ready to create the deployment. Confirm withy
for any prompts.
Run the following command to create the deployment:
Retrieving the outputs
First we need to get the deployment outputs.Downloading talos and kube config
In addition to thetalosconfig
and kubeconfig
files, the storage bucket contains the controlplane.yaml
and worker.yaml
files used to join additional nodes to the cluster.
Deploying the cloud controller manager
node.kubernetes.io/network-unavailable
taint.