Skip to content
Kubernetes cloud-controller-manager for Hetzner Cloud
Branch: master
Clone or download

Kubernetes Cloud Controller Manager for Hetzner Cloud

Build Status

The Hetzner Cloud cloud controller manager integrates your Kubernets cluster with the Hetzner Cloud API. Read more about kubernetes cloud controller managers in the kubernetes documentation.


  • instances interface Adds the server type to the label, sets the external ipv4 and ipv6 addresses and deletes nodes from Kubernetes that were deleted from the Hetzner Cloud.
  • zones interface Makes Kubernetes aware of the failure domain of the server by setting the and labels on the node.


apiVersion: v1
kind: Node
  annotations: '{"VtepMAC":"06:b3:ee:88:92:36"}' vxlan "true" "0" "true"
  creationTimestamp: 2018-01-24T15:59:45Z
  labels: amd64 cx11 # <-- server type linux fsn1 # <-- location fsn1-dc8 # <-- datacenter master ""
  name: master
  resourceVersion: "183932"
  selfLink: /api/v1/nodes/master
  uid: 98acdedc-011f-11e8-9ed3-9600000780bf
  externalID: master
  providerID: hcloud://123456 # <-- Server ID
  - address: master
    type: Hostname
  - address: # <-- public ipv4
    type: ExternalIP


This deployment example uses kubeadm to bootstrap an Kubernetes cluster, with flannel as overlay network agent. Feel free to adapt the steps to your preferred method of installing Kubernetes.

These deployment instructions are designed to guide with the installation of the hcloud-cloud-controller-manager and are by no means an in depth tutorial of setting up Kubernetes clusters. Previous knowledge about the involved components is required.

Please refer to the kubeadm cluster creation guide, which these instructions are meant to argument and the kubeadm documentation.

  1. The cloud controller manager adds its labels when a node is added to the cluster. This means we have to add the --cloud-provider=external flag to the kubelet before initializing the cluster master with kubeadm init. To do accomplish this we add this systemd drop-in unit: /etc/systemd/system/kubelet.service.d/20-hcloud.conf
  1. Now the cluster master can be initialized:
sudo kubeadm init --pod-network-cidr=
  1. Configure kubectl to connect to the kube-apiserver:
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
  1. Deploy the flannel CNI plugin:
kubectl apply -f
  1. Patch the flannel deployment to tolerate the uninitialized taint:
kubectl -n kube-system patch ds kube-flannel-ds --type json -p '[{"op":"add","path":"/spec/template/spec/tolerations/-","value":{"key":"","value":"true","effect":"NoSchedule"}}]'
  1. Create a secret containing your Hetzner Cloud API token.
kubectl -n kube-system create secret generic hcloud --from-literal=token=<hcloud API token>
  1. Deploy the hcloud-cloud-controller-manager:
kubectl apply -f


Apache License, Version 2.0

You can’t perform that action at this time.