You have two options: either create a pure HCloud cluster or a hybrid cluster with Hetzner dedicated (bare metal) servers. For a full list of flavors, please check out the release page. In the quickstart guide, we will go with the cluster creation on a pure Hetzner Cloud server.
To create a workload cluster, we need to do some preparation:
There are several tasks that have to be completed before a workload cluster can be created.
Cluster API requires an existing Kubernetes cluster accessible via kubectl. During the installation process, the Kubernetes cluster will be transformed into a management cluster by installing the Cluster API provider components, so it is recommended to keep it separated from any application workload.
It is a common practice to create a temporary, local bootstrap cluster, which is then used to provision a target management cluster on the selected infrastructure provider.
For production use, a “real” Kubernetes cluster should be used with appropriate backup and DR policies and procedures in place. The Kubernetes cluster must be at least a supported version.
kind can be used for creating a local Kubernetes cluster for development environments or for the creation of a temporary bootstrap cluster used to provision a target management cluster on the selected infrastructure provider.
To install Clusterctl, refer to the instructions available in the official ClusterAPI documentation here.
Now that we’ve got clusterctl installed and all the prerequisites are in place, we can transform the Kubernetes cluster into a management cluster by using the clusterctl init
command. More information about clusterctl can be found here.
For the latest version:
For a specific version, use the --infrastructure hetzner:vX.X.X
flag with the above command.
For a list of all variables needed for generating a cluster manifest (from the cluster-template.yaml), use the following command:
Running the above command will give you an output in the following manner:
In order for the provider integration hetzner to communicate with the Hetzner API (HCloud API), we need to create a secret with the access data. The secret must be in the same namespace as the other CRs.
export HCLOUD_TOKEN="<YOUR-TOKEN>"
Use the below command to create the required secret with the access data:
Patch the created secret so that it can be automatically moved to the target cluster later. The following command helps you do that:
The secret name and the tokens can also be customized in the cluster template.