Skip to content

Instantly share code, notes, and snippets.

@madalinignisca
Created November 4, 2022 15:12
Show Gist options
  • Save madalinignisca/038dee519d57b5a33ded8f159a9f9d75 to your computer and use it in GitHub Desktop.
Save madalinignisca/038dee519d57b5a33ded8f159a9f9d75 to your computer and use it in GitHub Desktop.
Hetzner CCM with most Kubernetes distributions
  1. setup a network 10.0.0.0/8 with defaults (like hetzner panel does).
  2. setup a few servers (I start with 1 control-plane and 2 nodes), attaching them to the network (I did setup a snapshot image with common OS setup before, so next steps I usually skip)
  3. setup containerd (I do the manual setup, and all all container network plugins and rest of deps)
  4. setup kubeadm, kubelet, kubectl on latest or a maintained version as per kubernetes.io docs (I do again the manual setup)
  5. Edit on all servers /etc/hosts and add all nodes -- make sure to match the name in hetzner!!! (not necessary if you are going to do a dns server accessible in your private network)
  6. I'm adding a load balancer ip identical with first control-plane to be able to run the init, so later I can add the real load balancer and point to the new ip. Add it to hosts in all nodes.
  7. Example of init the cluster: kubeadm init --control-plane-endpoint=cplb.dev.saasified.dev --upload-certs --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=10.0.0.2 -v=5
  8. Add next the working nodes.
  9. Setup ccm with networks
  10. Apply cilium from this repo's e2e tests.

This worked for me. There is one thing confusing. The doc file for networks sais to match nativeRoutingCIDR to the cluster's subnet, but the e2e version is set to 10.0.0.0/8.

The result was routes as expected, Nodes got each correct ip pods pools allocated, things seem to work OK.

To follow up how to do this with K3S.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment