hetznercloud / hcloud-cloud-controller-manager

Kubernetes cloud-controller-manager for Hetzner Cloud
Apache License 2.0
695 stars 109 forks source link

Automatically label robot nodes #650

Open mkuf opened 3 months ago

mkuf commented 3 months ago

TL;DR

Robot nodes should automatically be labelled with

instance.hetzner.cloud/is-root-server: true

Expected behavior

The csi driver is using the label to prevent the node component to start on robot nodes, see
https://github.com/hetznercloud/csi-driver/blob/071d0e36c2abffcd92cf3d92dfe75babd33879a2/chart/values.yaml#L532-L540 for reference.

This label is not set automatically by the ccm and requires additional user intervention when adding robot nodes to the cluster.

The ccm should add this label automatically as it already knows which nodes are from the robot type and which are from the hcloud type.

apricote commented 2 months ago

This is actually supported in Kubernetes v1.30+: https://github.com/kubernetes/kubernetes/pull/123223

So we can implement this once we upgrade to that version.

apricote commented 1 month ago

We upgraded our dependency to Kubernetes v1.30. This can now be easily added in 2 lines: https://github.com/hetznercloud/hcloud-cloud-controller-manager/blob/68db2131b41a864e0240b4ac5c78bc574443d724/hcloud/instances.go#L296

Happy to take any contributions :)