Talos Linux - Hetzner Bare Metal Installation
Can really recommend this blog post series: Bare-metal Kubernetes, Part I: Talos on Hetzner
In my blog post I cover:
- updated Talos Script Install
- how to use Hetzner Cloud Load Balancer with vSwitch
The installer script got a bugfix because the old download links are not more working. Talos provies now raw.zst download links instead of tar.gz.
TALOS_VERSION="1.11.2"
TARGET_DISK="/dev/nvme0n1"
wget -O /tmp/talos.raw.zst https://github.com/siderolabs/talos/releases/download/v$TALOS_VERSION/metal-amd64.raw.zst
zstd -d /tmp/talos.raw.zst -o /tmp/disk.raw
# Write the raw disk image directly to the hard drive.
dd if=/tmp/disk.raw of=$TARGET_DISK && sync
rebootvSwitch and Hetzner Cloud Load Balancer
network Configuration
machine:
kubelet:
network:
hostname: 'talos-example-1'
interfaces:
- deviceSelector:
busPath: '0*'
dhcp: true
vlans:
- addresses:
- 10.200.1.11/24
routes:
- network: '10.200.0.0/16'
gateway: '10.200.1.1'
mtu: 1400 # set by Hetzner
vlanId: 4142 # set by Hetzner vSwitchOpenTofu: Hetzner Cloud Load Balancer
And the OpenTofu Code for creation of the Cloud Load Balancer:
resource "hcloud_load_balancer" "example" {
name = "kubernetes"
load_balancer_type = "lb11"
location = "nbg1"
delete_protection = true
}
resource "hcloud_load_balancer_network" "example" {
load_balancer_id = hcloud_load_balancer.example.id
network_id = data.hcloud_network.main.id
}
resource "hcloud_load_balancer_target" "talos_example_1" {
type = "ip"
load_balancer_id = hcloud_load_balancer.example.id
ip = "10.200.1.11"
}
resource "hcloud_load_balancer_target" "talos_example_2" {
type = "ip"
load_balancer_id = hcloud_load_balancer.example.id
ip = "10.200.1.12"
}
resource "hcloud_load_balancer_target" "talos_example_3" {
type = "ip"
load_balancer_id = hcloud_load_balancer.example.id
ip = "10.200.1.13"
}
resource "hcloud_load_balancer_service" "apiserver" {
load_balancer_id = hcloud_load_balancer.example.id
protocol = "tcp"
listen_port = "6443"
destination_port = "6443"
}
resource "hcloud_load_balancer_service" "http" {
load_balancer_id = hcloud_load_balancer.example.id
protocol = "tcp"
listen_port = "80"
destination_port = "30080"
}
resource "hcloud_load_balancer_service" "https" {
load_balancer_id = hcloud_load_balancer.example.id
protocol = "tcp"
listen_port = "443"
destination_port = "30443"
}