Skip to content

Commit 4cc133a

Browse files
committed
docs: zone label guide
1 parent fa8a8cf commit 4cc133a

2 files changed

Lines changed: 45 additions & 0 deletions

File tree

docs/guides/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ In this folder, you should find guides for you to accomplish specific tasks with
77
- [Load Balancer](load-balancer/README.md)
88
- [Robot](robot/README.md)
99
- [Address Family](address-family.md)
10+
- [Zone Label](zone-label.md)
1011
- [Troubleshooting](troubleshooting.md)

docs/guides/zone-label.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Zone Label
2+
3+
When a node is initialized, the hcloud-cloud-controller-manager sets these topology labels on it:
4+
5+
| Label | Value | Example |
6+
| --------------------------------------------------------------------------- | ------------------------------------ | ----------- |
7+
| `topology.kubernetes.io/region`, `failure-domain.beta.kubernetes.io/region` | Location of the Server | `fsn1` |
8+
| `topology.kubernetes.io/zone`, `failure-domain.beta.kubernetes.io/zone` | Legacy datacenter name of the Server | `fsn1-dc14` |
9+
10+
The zone label can be disabled by setting `HCLOUD_INSTANCES_ZONE_LABEL_ENABLED` to `false`. By default, the value is set to `true`.
11+
12+
**We recommend disabling the zone label for new clusters.** Datacenters are deprecated in the Hetzner Cloud API, and the legacy datacenter names the label uses are only known for a fixed set of older locations. For any newer location, the label falls back to the location name and is therefore identical to the region label. The location is the failure domain you actually want to spread workloads over, and it is already available via `topology.kubernetes.io/region`. We plan to remove the zone label entirely in the next major version.
13+
14+
The label remains enabled by default because disabling it on a running cluster changes node labels, which existing workloads may depend on. See [Existing clusters](#existing-clusters) below.
15+
16+
## Configuration via Helm
17+
18+
```yaml
19+
# values.yaml
20+
---
21+
env:
22+
HCLOUD_INSTANCES_ZONE_LABEL_ENABLED:
23+
value: "false"
24+
```
25+
26+
## Existing clusters
27+
28+
Topology labels are only applied while a node is being initialized. Changing `HCLOUD_INSTANCES_ZONE_LABEL_ENABLED` does not relabel nodes that are already part of the cluster, so after disabling it you end up with a mixed cluster: existing nodes keep their zone label, and nodes joining afterwards do not get one. Anything that selects on the zone label — `nodeSelector`, node affinities, `topologySpreadConstraints`, or the node affinity of already-provisioned `PersistentVolume`s — will treat these two groups differently.
29+
30+
Before disabling the label, check whether anything in your cluster relies on it:
31+
32+
```sh
33+
kubectl get pods,pv --all-namespaces -o yaml | grep -c 'topology.kubernetes.io/zone\|failure-domain.beta.kubernetes.io/zone'
34+
```
35+
36+
To reach a consistent state afterwards, either recreate your nodes, or remove the labels from the existing ones:
37+
38+
```sh
39+
kubectl label nodes --all topology.kubernetes.io/zone- failure-domain.beta.kubernetes.io/zone-
40+
```
41+
42+
## Robot servers
43+
44+
This setting only affects Hetzner Cloud Servers. [Robot](robot/README.md) servers are always labeled with their datacenter (e.g. `fsn1-dc14`).

0 commit comments

Comments
 (0)