Builds snapshot on Hetzner Cloud that can be used as a base image to run a Talos based Kubernetes cluster.
- packer
- GNU make (optional)
Set the environment variable HCLOUD_TOKEN
to the API token for authenticating to the Hetzner API.
Run
make validate && make build
to validate the configuration and run the build. The resulting snapshot will be named talos-x.y.z YYYYMMDD
.
You can use this snapshot as base image for launching a server to build a Talos cluster.
Since version 0.13.0 talos support Hetzner and we can use the native image.
We launch the smallest possible Hetzner server (CX11). The server is booted directly into resuce mode, so it does not matter which base image we specify.
Once in resuce mode all that needs to be done is to download the latest openstack image from https://github.com/talos-systems/talos/releases, unpack the archive and write the included file to the raw disk.
This overwrites the base image we specified when starting the server. We then delete partitions 5 (STATE) and 6 (EPHEMERAL) as this will enable us to encrypt these when building our actual servers.
All this happens in tasks/talos.sh
.
The resulting server is then snapshotted by packer.