The clusterctl generate cluster command returns a YAML template for creating a workload cluster. It generates a YAML file named my-cluster.yaml with a predefined list of Cluster API objects (Cluster , Machines , MachineDeployments , etc.) to be deployed in the current namespace.
With the --target-namespace flag, you can specify a different target namespace.
Run the clusterctl generate cluster --help command for more information.
Please note that ready-to-use Kubernetes configurations, production-ready node images, kubeadm configuration, cluster add-ons like CNI, and similar services need to be separately prepared or acquired to ensure a comprehensive and secure Kubernetes deployment. This is where Syself Autopilot comes into play, taking on these challenges to offer you a seamless, worry-free Kubernetes experience. Feel free to contact us via e-mail: [email protected].
The following command applies the configuration of the workload cluster:
The cluster will now start provisioning. You can check status with:
You can also view the cluster and its resources at a glance by running:
To verify the first control plane is up, use the following command:
The control plane won’t be ready until we install a CNI in the next step.
After the first control plane node is up and running, we can retrieve the kubeconfig of the workload cluster with:
Cilium is used as a CNI solution in this guide. The following command deploys it to your cluster:
The file templates/cilium/values.yaml is a repo-provided Helm values file in this repository. Before running the command, make sure this file exists at that path in your working environment (for example, by using it from a local checkout of this repo or copying it from templates/cilium/values.yaml into your working directory setup).
You can, of course, also install an alternative CNI, e.g., calico.
The CCM (Cloud Controller Manager) runs in the workload cluster and integrates Kubernetes with the Hetzner APIs. In practice, it is responsible for tasks such as setting the ProviderID on nodes and managing load balancers.
You need to install a CCM in this flow so the workload cluster can properly interact with Hetzner infrastructure.
The following make command will install the Syself CCM in your workload cluster:
make install-ccm-in-wl-cluster
For upstream HCloud CCM instructions and bare-metal ProviderID format details, see Baremetal Docs
If you want to continue with the next step and move the Cluster API components to your workload cluster (so it becomes the new management cluster), do not run the cleanup command.
If you want to stop here, delete the workload cluster and remove all of the components by using:
IMPORTANT: In order to ensure a proper clean-up of your infrastructure, you must always delete the cluster object. Deleting the entire cluster template with the
kubectl delete -f my-cluster.yamlcommand might lead to pending resources that have to be cleaned up manually.
Delete management cluster with the following command: