metal-api icon indicating copy to clipboard operation
metal-api copied to clipboard

Incompatible Machine Tags and Node Labels between metal-api and metal-ccm

Open vknabel opened this issue 7 months ago • 2 comments

Originally addressed in https://github.com/metal-stack/metal-ccm/pull/114

Currently it is possible to create machines with tags that contradict the rules of Kubernetes labels. At first glance this is fine, but it will ultimately conflict with the current behavior of the metal-ccm.

The metal-ccm tries to update the k8s node resource labels. This patch will not pass the validation and will ultimately fail. Altering the format of the machine tags to restore compatibility with kubernetes labels will just lead into confusion.

Instead there would be two general approaches to this:

  1. The metal-ccm should itself validate the tags before trying to set them as label. This would lead to log messages and missing labels. This will not break anything.
  2. The metal-api(server) should introduce a validation and forbid machine tags that could not be transformed into kubernetes labels. Might break data. A research and eventually a data migration would be required. In practice this should not be the case or would break the metal-ccm anyways.

In off-GitHub discussions we loosely favored the second approach, but are cautious in this regard.

vknabel avatar May 06 '25 12:05 vknabel

Originally addressed in metal-stack/metal-ccm#114

can you please add a link to the kubernetes label requirements

majst01 avatar May 06 '25 12:05 majst01

@Gerrit91 FYI I finally updated the description of this issue.

vknabel avatar May 08 '25 12:05 vknabel