Placement Groups
Keep Hetzner Cloud VMs on separate physical hosts so one hardware failure never takes down more than one node. A placement group of type spread schedules each node in the group onto a different physical machine.
This matters most for high-availability clusters, where you do not want several control-plane or worker nodes sharing a host that can fail as a unit.
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:
- name: hcloudPlacementGroups
value:
- name: myPlacementGroup1
type: spread
- name: myPlacementGroup2
type: spread
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.
Adding placement groups to machine deployments#
To add placement groups to your machine deployments, you can set them in variables.overrides:
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 control plane nodes#
You can set control plane placement groups in spec.topology.variables:
- name: controlPlanePlacementGroupNameHcloud
value: myPlacementGroup2
Here is an example of a complete Cluster resource with placement groups:
apiVersion: cluster.x-k8s.io/v1beta2
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:
classRef:
name: hetzner-apalla-1-33-v13
version: v1.33.13
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
Migrate ARM servers to x86 in your cluster
Learn how to migrate ARM-based (CAX) nodes to x86 nodes in your Syself Autopilot cluster by updating machine deployment classes and server types.
Labelling and assign roles on nodes
Add labels to a worker pool so every node it creates carries them, and target that pool from pods.