Hetzner Cloud Placement Groups allow you to control how your Kubernetes nodes are distributed across physical hosts within Hetzner’s infrastructure. By assigning nodes to a placement group of type spread, you ensure that each node is scheduled on a different physical machine, increasing fault tolerance and availability. This feature is especially useful for high-availability Kubernetes clusters, as it minimizes the risk of multiple nodes failing due to hardware issues on a single host. ## Creating placement groups In the Cluster resource, you can create placement groups in the `spec.topology.variables` section. The following example creates two placement groups: ```yaml - name: hcloudPlacementGroups value: - name: myPlacementGroup1 type: spread - name: myPlacementGroup2 type: spread ``` {% callout type="note" %} As of now, Hetzner Cloud only supports the `spread` placement group type. If you want to know more, you can read the [Hetzner documentation](https://docs.hetzner.com/cloud/placement-groups/overview). {% /callout %} ## Adding placement groups to machine deployments To add placement groups to your machine deployments, you can set them in `variables.overrides`: ```yaml machineDeployments: - class: workeramd64hcloud name: md-0 replicas: 5 failureDomain: nbg1 variables: overrides: - name: workerMachineTypeHcloud value: cpx42 - name: workerMachinePlacementGroupNameHcloud value: myPlacementGroup1 ``` The name should match an existing placement group, created in your Cluster resource `topology.variables`: ## Adding placement groups to controlplane nodes You can set control plane placement groups in `spec.topology.variables`: ```yaml - name: controlPlanePlacementGroupNameHcloud value: myPlacementGroup2 ``` Here is an example of a complete Cluster resource with placement groups: ```yaml /// cluster.yaml apiVersion: cluster.x-k8s.io/v1beta1 kind: Cluster metadata: name: mycluster spec: clusterNetwork: services: cidrBlocks: ['10.128.0.0/12'] pods: cidrBlocks: ['192.168.0.0/16'] serviceDomain: 'cluster.local' topology: class: hetzner-apalla-1-34-v6 version: v1.34.6 controlPlane: replicas: 3 variables: - name: hcloudPlacementGroups value: - name: myPlacementGroup1 type: spread - name: myPlacementGroup2 type: spread - name: controlPlanePlacementGroupNameHcloud value: myPlacementGroup2 workers: machineDeployments: - class: workeramd64hcloud name: md-0 replicas: 5 failureDomain: nbg1 variables: overrides: - name: workerMachineTypeHcloud value: cpx42 - name: workerMachinePlacementGroupNameHcloud value: myPlacementGroup1 ```