Creating a Cluster via the AWS CLI
In this guide we will create an HA Kubernetes cluster with 3 worker nodes. We assume an existing VPC, and some familiarity with AWS. If you need more information on AWS specifics, please see the official AWS documentation.Set the needed info
Change to your desired region:Create the Subnet
Use a CIDR block that is present on the VPC specified above.Official AMI Images
Official AMI image ID can be found in thecloud-images.json
file attached to the Talos release:
Replace amd64
in the line above with the desired architecture.
Note the AMI id that is returned is assigned to an environment variable: it will be used later when booting instances.
If using the official AMIs, you can skip to Creating the Security group
Create your own AMIs
The use of the official Talos AMIs are recommended, but if you wish to build your own AMIs, follow the procedure below.
Create the S3 Bucket
Create the vmimport
Role
In order to create an AMI, ensure that the vmimport
role exists as described in the official AWS documentation.
Note that the role should be associated with the S3 bucket we created above.
Create the Image Snapshot
First, download the AWS image from a Talos release: Copy the RAW disk to S3 and import it as a snapshot:SnapshotId
, as we will need it once the import is done.
To check on the status of the import, run:
SnapshotTaskDetail.Status
indicates completed
, we can register the image.
Register the Image
Create a Security Group
Create a Load Balancer
TargetGroupArn
that is returned.
Create the Machine Configuration Files
Using the DNS name of the loadbalancer created earlier, generate the base configuration files for the Talos machines.
Note that the port
used here is the externally accessible port configured on the load balancer - 443 - not the internal port of 6443:
Note that the generated configs are too long for AWS userdata field if theAt this point, you can modify the generated configs to your liking. Optionally, you can specify--with-examples
and--with-docs
flags are not passed.
--config-patch
with RFC6902 jsonpatch which will be applied during the config generation.
Validate the Configuration Files
Create the EC2 Instances
change the instance type if desired. Note: There is a known issue that prevents Talos from running on T2 instance types. Please use T3 if you need burstable instance types.
Create the Control Plane Nodes
Make a note of the resulting PrivateIpAddress
from the controlplane nodes for later use.
Create the Worker Nodes
Configure the Load Balancer
Now, using the load balancer target groupβs ARN, and the PrivateIpAddress from the controlplane instances that you created :Bootstrap Etcd
Set theendpoints
(the control plane node to which talosctl
commands are sent) and nodes
(the nodes that the command operates on):
etcd
:
Retrieve the kubeconfig
At this point we can retrieve the admin kubeconfig
by running:
kubectl
commands.