This guide teaches you how to setup HCCM with support for Private Networks. Please familiarize yourself with the explanation document about Private Networks.
Before setting up the hcloud-cloud-controller-manager you need to configure your cluster appropriately. When creating your cluster you need to provide the kubelet option --cloud-provider=external. How this is done depends on your Kubernetes distribution.
By default, the HCCM's route controller is enabled. For this reason, you need to choose an appropriate CNI plugin, which supports native routing capabilities of the underlying infrastructure. As an example, Cilium can be set to use the routing-mode: native.
-
Select the appropriate IP ranges for your cluster. You can reference the explanation document.
-
Create the Private Network from the Hetzner Cloud Console or via the
hcloud-cli:
hcloud network create --name my-network --ip-range=10.0.0.0/8-
Add your nodes to the network.
-
Provision your Kubernetes cluster with the Kubelet option
--cloud-provider=external. -
Create a read+write API token in the Hetzner Cloud Console as described in this document.
-
Create a secret containing your Hetzner Cloud API token and your Private Network ID or name:
kubectl -n kube-system create secret generic hcloud \
--from-literal=token=<hcloud API token> \
--from-literal=network=<hcloud network-id-or-name>- Add the Helm repository:
helm repo add hcloud https://charts.hetzner.cloud
helm repo update hcloud- Install the chart:
helm install hccm hcloud/hcloud-cloud-controller-manager -n kube-system \
--set networking.enabled=true \
--set networking.clusterCIDR=<cluster-cidr>- Install your CNI plugin.