Skip to content

Kubernetes

The cluster runs Talos Linux on Hetzner Cloud, provisioned through OpenTofu using the hcloud-k8s/kubernetes/hcloud module. Everything below the application layer — VMs, network, storage, certificates — is defined in flux-clusters/stefanzhelev/terraform/hcloud/.

Node poolServer typeCountRole
controlCX333Control plane (etcd, API server)
stateful-haCX433HA workloads (Vault, CNPG, ClickHouse)
stateful-singleCX431Single-instance stateful apps
stateless-singleCX531Stateless workloads

Workloads are placed on pools by node selectors so HA databases stay on the three-node pool while one-off services share the cheaper single-node pools.

SettingValue
Network CIDR10.10.0.0/16
CNICilium
EncryptionWireGuard (node-to-node)
Gateway APIEnabled
kube-proxyReplaced by Cilium
Storage classEncryptedDefaultReclaim policy
hcloud-volumes-encryptedYesYesRetain
hcloud-volumesNoNoRetain

Talos state and ephemeral partitions are encrypted at the OS layer in addition to the CSI-level volume encryption.

  • Talos state and ephemeral partition encryption enabled
  • Hetzner firewall rules auto-configured against the operator’s current IP
  • OIDC authentication for the Kubernetes API delegated to Authentik
  • TLS certificates issued by cert-manager with the Let’s Encrypt production issuer
  • etcd backups written to S3-compatible storage

Infrastructure lives in flux-clusters/stefanzhelev/terraform/hcloud/. Terraform state is stored remotely in Cloudflare R2:

backend "s3" {
bucket = "stefanzhelev-tf-state"
key = "clusters/stefanzhelev-hcloud.tfstate"
endpoints = { s3 = "https://<account-id>.r2.cloudflarestorage.com" }
region = "auto"
}
Terminal window
cd flux-clusters/stefanzhelev/terraform/hcloud
tofu init
tofu plan
Terminal window
tofu apply
Terminal window
tofu destroy

Talos is managed entirely through its API — there is no SSH access. The talosctl CLI handles every node operation.

Terminal window
# Set talosconfig from the Terraform output
export TALOSCONFIG=$(pwd)/talosconfig
# Verify connectivity
talosctl health
Terminal window
talosctl get members
talosctl dashboard
talosctl logs kubelet
talosctl logs etcd
talosctl services
Terminal window
# Get kubeconfig
talosctl kubeconfig ./kubeconfig
# Upgrade Talos on a node
talosctl upgrade --nodes <node-ip> \
--image ghcr.io/siderolabs/installer:<version>
# Upgrade Kubernetes
talosctl upgrade-k8s --to <k8s-version>
# Reset a node
talosctl reset --nodes <node-ip> --graceful
Terminal window
talosctl etcd status
talosctl etcd members
talosctl usage /var
talosctl get machineconfig -o yaml
talosctl reboot --nodes <node-ip>