1. Install hetzner-k3s
brew install vitobotta/tap/hetzner_k3s
wget https://github.com/vitobotta/hetzner-k3s/releases/latest/download/hetzner-k3s-linux-amd64
chmod +x hetzner-k3s-linux-amd64
sudo mv hetzner-k3s-linux-amd64 /usr/local/bin/hetzner-k3s
2. Create your configuration
hetzner_token: <your-token>
cluster_name: my-cluster
kubeconfig_path: "./kubeconfig"
k3s_version: v1.32.0+k3s1
networking:
ssh:
port: 22
use_agent: false
public_key_path: "~/.ssh/id_ed25519.pub"
private_key_path: "~/.ssh/id_ed25519"
allowed_networks:
ssh:
- 0.0.0.0/0
api:
- 0.0.0.0/0
masters_pool:
instance_type: cpx22
instance_count: 1
locations:
- fsn1 # See documentation for the list of available locations
worker_node_pools:
- name: static
instance_type: cpx32
instance_count: 2
location: fsn1 # See documentation for the list of available locations
- name: autoscaled
instance_type: cpx32
location: fsn1
autoscaling:
enabled: true
min_instances: 0
max_instances: 2
3. Create your cluster
hetzner-k3s create --config cluster.yaml
Your cluster will be ready in 2-3 minutes. The kubeconfig is saved automatically.
4. Start using your cluster
export KUBECONFIG=./kubeconfig
kubectl get nodes