Skip to content

Commit 431ee41

Browse files
committed
Update Talos installation docs for Hetzner and Servers.com
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
1 parent 4aeb35b commit 431ee41

File tree

4 files changed

+74
-191
lines changed

4 files changed

+74
-191
lines changed

content/en/docs/install/providers/hetzner.md

Lines changed: 25 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -83,160 +83,54 @@ Talos is a Linux distribution made for running Kubernetes in the most secure and
8383
To learn why Cozystack adopted Talos as the foundation of the cluster,
8484
read [Talos Linux in Cozystack]({{% ref "/docs/guides/talos" %}}).
8585

86-
### 1.1 Write Talos Image on Primary Disk
86+
### 1.1 Install boot-to-talos in Rescue Mode
8787

88-
First stage is to prepare the primary disk and write the Talos Linux image on it.
89-
Run these steps with each of the dedicated servers.
88+
Talos will be booted from the Hetzner rescue system using the [`boot-to-talos`](https://github.com/cozystack/boot-to-talos) utility.
89+
Later, when you apply Talm configuration, Talos will be installed to disk.
90+
Run these steps on each dedicated server.
9091

91-
1. Switch your server into rescue mode and login to the server using SSH.
92+
1. Switch your server into rescue mode and log in to the server using SSH.
9293

93-
1. Check the available disks:
94+
1. Identify the disk that will be used for Talos later (for example, `/dev/nvme0n1`).
9495

95-
```console
96-
# lsblk
97-
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
98-
nvme0n1 259:4 0 476.9G 0 disk
99-
nvme1n1 259:0 0 476.9G 0 disk
100-
```
96+
1. Download and install `boot-to-talos`:
10197

102-
In this example, we have two NVMe disks: `nvme0n1` and `nvme1n1`.
103-
We will use `nvme0n1` as a primary disk for the Talos Linux installation and `nvme1n1` as a secondary disk for user data.
104-
105-
Further on in this guide, all Bash snippets will use variables for disk names.
106-
Set them up in your console to conveniently copy and run the commands:
107-
10898
```bash
109-
DISK1=nvme0n1
110-
DISK2=nvme1n1
99+
curl -sSL https://github.com/cozystack/boot-to-talos/raw/refs/heads/main/hack/install.sh | sh -s
111100
```
112101

113-
1. Wipe both disks selected for Cozystack installation.
102+
After this, the `boot-to-talos` binary should be available in your `PATH`:
114103

115-
{{% alert color="warning" %}}
116-
:warning: The following commands will erase your data.
117-
Make sure that all valuable information is backed up elsewhere.
118-
{{% /alert %}}
119-
120104
```bash
121-
sfdisk /dev/$DISK1 --delete
122-
sfdisk /dev/$DISK2 --delete
123-
wipefs -a /dev/$DISK1
124-
wipefs -a /dev/$DISK2
105+
boot-to-talos -h
125106
```
126107

127-
1. Download Talos Linux asset from the Cozystack's [releases page](https://github.com/cozystack/cozystack/releases), and write it on the primary disk:
108+
### 1.2. Install Talos Linux with boot-to-talos
128109

129-
```bash
130-
cd /tmp
131-
wget https://github.com/cozystack/cozystack/releases/latest/download/nocloud-amd64.raw.xz
132-
xz -d -c /tmp/nocloud-amd64.raw.xz | dd of="/dev/$DISK1" bs=4M oflag=sync
133-
```
134-
135-
Note that Cozystack has its own Talos distribution and there are several options.
136-
For dedicated servers, you need the `nocloud-amd64.raw.xz`.
137-
138-
1. Resize the partition table and prepare an additional partition for the cloud-init data:
110+
1. Start the installer:
139111

140112
```bash
141-
# resize gpt partition
142-
sgdisk -e "/dev/$DISK1"
143-
144-
# Create 20MB partition at the end of the disk
145-
end=$(sgdisk -E "/dev/$DISK1")
146-
sgdisk -n7:$(( $end - 40960 )):$end -t7:ef00 "/dev/$DISK1"
147-
148-
# Create FAT filesystem for cloud-init and mount it
149-
PARTITION=$(sfdisk -d "/dev/$DISK1" | awk 'END{print $1}' | awk -F/ '{print $NF}')
150-
mkfs.vfat -n CIDATA "/dev/$PARTITION"
151-
mount "/dev/$PARTITION" /mnt
113+
boot-to-talos
152114
```
153115

154-
### 1.2. Configure Cloud-Init
116+
When prompted:
155117

156-
Proceed by configuring cloud-init for each dedicated server.
118+
- Select mode `1. boot`.
119+
- Confirm or change the Talos installer image.
120+
The default value points to the Cozystack Talos image (the default Cozystack image is suitable),
121+
- Provide network settings (interface name, IP address, netmask, gateway) matching the configuration you prepared earlier
122+
(vSwitch subnet or public IPs).
123+
- Optionally configure a serial console if you use it for remote access.
157124

158-
1. Start by setting environment variables:
159-
160-
```bash
161-
INTERFACE_NAME=$(udevadm info -q property /sys/class/net/eth0 | grep "ID_NET_NAME_PATH=" | cut -d'=' -f2)
162-
IP_CIDR=$(ip addr show eth0 | grep "inet\b" | awk '{print $2}')
163-
GATEWAY=$(ip route | grep default | awk '{print $3}')
164-
165-
echo "INTERFACE_NAME=$INTERFACE_NAME"
166-
echo "IP_CIDR=$IP_CIDR"
167-
echo "GATEWAY=$GATEWAY"
168-
```
169-
170-
1. Write the cloud-init configuration files.
171-
172-
Edit network-config and specify your network settings using [network-config-format-v2](https://cloudinit.readthedocs.io/en/latest/reference/network-config-format-v2.html).
173-
This step depends on whether your installation is using a vSwitch-enabled subnet or public IPs.
174-
175-
- Cloud-init configuration using [Hetzner vSwitch](https://docs.hetzner.com/robot/dedicated-server/network/vswitch/).
176-
177-
Note how this example is using subnet, VLAN ID, and subnet IPs of each node.
178-
179-
```bash
180-
echo 'hostname: talos' > /mnt/meta-data
181-
echo '#cloud-config' > /mnt/user-data
182-
cat > /mnt/network-config <<EOT
183-
version: 2
184-
ethernets:
185-
$INTERFACE_NAME:
186-
dhcp4: false
187-
addresses:
188-
- "${IP_CIDR}"
189-
gateway4: "${GATEWAY}"
190-
nameservers:
191-
addresses: [8.8.8.8]
192-
vlans:
193-
vlan4000:
194-
id: 4000
195-
link: $INTERFACE_NAME
196-
mtu: 1400
197-
dhcp4: false
198-
addresses:
199-
# node's own IP in the vSwitch subnet, change it for each node
200-
- 10.0.1.101/24
201-
routes:
202-
# Hetzner cloud network
203-
- to: 10.0.0.0/16
204-
via: 10.0.1.1
205-
EOT
206-
```
207-
208-
- Cloud-init configuration using [public IPs]({{% ref "/docs/operations/faq#public-network-kubernetes-deployment" %}}):
209-
210-
```bash
211-
echo 'hostname: talos' > /mnt/meta-data
212-
echo '#cloud-config' > /mnt/user-data
213-
cat > /mnt/network-config <<EOT
214-
version: 2
215-
ethernets:
216-
$INTERFACE_NAME:
217-
dhcp4: false
218-
addresses:
219-
- "${IP_CIDR}"
220-
gateway4: "${GATEWAY}"
221-
nameservers:
222-
addresses: [8.8.8.8]
223-
EOT
224-
```
225-
226-
You can find more comprehensive examples in the codebase of [siderolabs/talos](
227-
https://github.com/siderolabs/talos/blob/10f958cf41ec072209f8cb8724e6f89db24ca1b6/internal/app/machined/pkg/runtime/v1alpha1/platform/nocloud/testdata/metadata-v2.yaml)
125+
The utility will download the Talos installer image, extract the kernel and initramfs, and boot the node into Talos Linux
126+
(using the kexec mechanism) without modifying the disks.
228127

229128
### 1.3. Boot into Talos Linux
230129

231-
On each server, unmount the cloud-init partition, sync changes, and reboot the server:
232-
233-
```bash
234-
umount /mnt
235-
sync
236-
reboot
237-
```
130+
After `boot-to-talos` finishes, the server reboots automatically into Talos Linux in maintenance mode.
238131

239-
At this point, each node (server) has Talos Linux installed and booted in the maintenance mode.
132+
Repeat the same procedure for all dedicated servers in the cluster.
133+
Once all nodes are booted into Talos, proceed to the next section and configure them using Talm.
240134

241135
## 2. Install Kubernetes Cluster
242136

content/en/docs/install/providers/servers-com/_index.md

Lines changed: 49 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,6 @@ aliases:
1313

1414
### 1. Network
1515

16-
1. **Remove Aggregate Interface**
17-
18-
1. Go to **Dedicated Server > Server Details**, and click the second column (highlighted in blue) to remove the aggregate interface.
19-
20-
1. Ensure the status appears as shown in the screenshot.
21-
22-
![Remove Aggregate Interface](img/remove_aggregate_interface.png)
23-
2416
1. **Set Up L2 Network**
2517

2618
1. Navigate to **Networks > L2 Segment** and click **Add Segment**.
@@ -53,19 +45,26 @@ aliases:
5345

5446
## Setup OS
5547

56-
### 1. Rescue Mode / Access
48+
### 1. Operating System and Access
5749

58-
1. Go to **Dedicated Servers > Server Details**, and click **Reboot to Rescue**. Select your SSH key.
50+
{{% alert color="warning" %}}
51+
:warning: In rescue mode only the public network is available; the private L2 network is not reachable.
52+
For Talos installation use a regular OS (for example Ubuntu) instead of rescue mode.
53+
{{% /alert %}}
5954

60-
![Rescue](img/rescue.png)
55+
1. In the Servers.com control panel, install Ubuntu on the server (for example via **Dedicated Servers > Server Details > OS install**) and make sure your SSH key is selected.
6156

62-
1. Connect via SSH. Log in via SSH using the external IP of the server (**Details** > **Public IP** ).
57+
1. After the installation is complete, connect via SSH using the external IP of the server (**Details** > **Public IP**).
6358

6459
![Public IP](img/public_ip.png)
6560

66-
### 2. Setup
61+
### 2. Install Talos with boot-to-talos
62+
63+
Talos will be booted from the installed Ubuntu using the [`boot-to-talos`](https://github.com/cozystack/boot-to-talos) utility.
64+
Later, when you apply Talm configuration, Talos will be installed to disk.
65+
Run these steps on each server.
6766

68-
1. Check the information on block devices:
67+
1. Check the information on block devices to find the disk that will be used for Talos later (for example, `/dev/sda`).
6968

7069
```console
7170
# lsblk
@@ -74,66 +73,42 @@ aliases:
7473
sdb 259:0 0 476.9G 0 disk
7574
```
7675

77-
1. Wipe disks.
78-
79-
{{% alert color="warning" %}}
80-
:warning: The following commands will erase your data!
81-
{{% /alert %}}
76+
1. Download and install `boot-to-talos`:
8277

8378
```bash
84-
wipefs -a /dev/sda
85-
wipefs -a /dev/sdb
79+
curl -sSL https://github.com/cozystack/boot-to-talos/raw/refs/heads/main/hack/install.sh | sudo sh -s
8680
```
8781

88-
1. Install `kexec-tools`:
82+
After installation, verify that the binary is available:
8983

9084
```bash
91-
dnf install kexec-tools -y
85+
boot-to-talos -h
9286
```
9387

94-
1. Download kernel and initramfs:
88+
1. Run the installer:
9589

9690
```bash
97-
wget -O /tmp/vmlinuz https://github.com/cozystack/cozystack/releases/latest/download/kernel-amd64
98-
wget -O /tmp/initramfs.xz https://github.com/cozystack/cozystack/releases/latest/download/initramfs-metal-amd64.xz
91+
sudo boot-to-talos
9992
```
10093

101-
1. Set environment variables:
94+
When prompted:
10295

103-
```bash
104-
INTERFACE=$(ip -o link show | grep 'master bond0' | grep -m1 'state UP' | awk -F': ' '{print $2}')
105-
INTERFACE_NAME=$(udevadm info -q property "/sys/class/net/$INTERFACE" | grep "ID_NET_NAME_ONBOARD=" | cut -d'=' -f2)
106-
IP_CIDR=$(ip addr show bond0 | grep "inet\b" | awk '{print $2}')
107-
IP=$(echo $IP_CIDR | cut -d/ -f1)
108-
NETMASK=$(ipcalc -m $IP_CIDR | cut -d= -f2-)
109-
GATEWAY=$(ip route | grep default | awk '{print $3}')
110-
```
96+
- Select mode `1. boot`.
97+
- Confirm or change the Talos installer image (the default Cozystack image is suitable).
98+
- Provide network settings matching the public interface (`bond0`) and default gateway.
11199

112-
1. Set `CMDLINE`, and echo it to verify:
100+
The utility will download the Talos installer image and boot the node into Talos Linux (using the kexec mechanism) without modifying the disks.
113101

114-
```bash
115-
CMDLINE="init_on_alloc=1 slab_nomerge pti=on console=tty0 console=ttyS0 printk.devkmsg=on talos.platform=metal ip=${IP}::${GATEWAY}:${NETMASK}::${INTERFACE_NAME}:::::"
116-
echo $CMDLINE
117-
```
118-
119-
### 3. Boot into Talos
120-
121-
1. Load the kernel and initramfs:
102+
For fully automated installations you can use non-interactive mode:
122103

123104
```bash
124-
kexec -l /tmp/vmlinuz --initrd=/tmp/initramfs.xz --command-line="$CMDLINE"
105+
sudo boot-to-talos -yes
125106
```
126107

127-
1. Boot into the new kernel:
128-
129-
```bash
130-
kexec -e
131-
```
132-
133-
After executing the command, the system will reboot into the new kernel.
134-
Your SSH session will stop responding, and the server will reboot.
108+
### 3. Boot into Talos
135109

136-
Wait for around 5 minutes for the system to boot.
110+
After `boot-to-talos` finishes, the server reboots automatically into Talos Linux in maintenance mode.
111+
Repeat the same procedure for all servers, then proceed to configure them with Talm.
137112

138113
## Talos Configuration
139114

@@ -195,17 +170,33 @@ Use [Talm](https://github.com/cozystack/talm) to apply config and install Talos
195170
machine:
196171
network:
197172
interfaces:
198-
- interface: eno2
173+
- interface: bond0
199174
addresses:
200175
- 1.2.3.4/29
201176
routes:
202177
- network: 0.0.0.0/0
203178
gateway: 1.2.3.1
204-
- interface: eno1
179+
bond:
180+
interfaces:
181+
- enp1s0f1
182+
- enp3s0f1
183+
mode: 802.3ad
184+
xmitHashPolicy: layer3+4
185+
lacpRate: slow
186+
miimon: 100
187+
- interface: bond1
205188
addresses:
206-
- 192.168.100.11/24
189+
- 192.168.102.11/23
190+
bond:
191+
interfaces:
192+
- enp1s0f0
193+
- enp3s0f0
194+
mode: 802.3ad
195+
xmitHashPolicy: layer3+4
196+
lacpRate: slow
197+
miimon: 100
207198
vip:
208-
ip: 192.168.100.10
199+
ip: 192.168.102.10
209200
```
210201

211202
**Execution steps:**
@@ -219,8 +210,6 @@ Use [Talm](https://github.com/cozystack/talm) to apply config and install Talos
219210
```
220211

221212
If the output is empty, it means that Talos still runs in RAM and hasn't been installed on the disk yet.
222-
1. Click **Exit rescue mode** for each node in the Servers.com panel. The nodes will reboot again.
223-
224213
1. Execute bootstrap command for the first node in the cluster, example:
225214
```bash
226215
talm bootstrap -f nodes/node1.yml
Binary file not shown.
-24.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)