Repository navigation
Description
Summary
The current flavor naming standard uses colon characters (i.e. :) as delimiters. This is an unfortunate choice, as it is incompatible with requirements stipulated by downstream applications such as Kubernetes.
Details
Kubernetes uses labels and annotations for a variety of use cases. Most importantly in the context of this discussion will be their use for taints and tolerations and the standard well-known labels, annotations and taints.
The requirements for valid label values are:
- must be 63 characters or less (can be empty),
- unless empty, must begin and end with an alphanumeric character ([a-z0-9A-Z]),
- could contain dashes (-), underscores (_), dots (.), and alphanumerics between.
That is, it must adhere to the regular expression (([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?').
The usage of colon characters is not allowed and their usage in flavor names causes issues when, for example, the kubelet wants to set the well-known node.kubernetes.io/instance-type label:
Jan 01 08:09:10 foo-bar-box hyperkube[12345]: I0103 08:09:10.23456 14821 kubelet_node_status.go:426] "Adding node label from cloud provider" labelKey="node.kubernetes.io/instance-type" labelValue="SCS-4V:16:50"
[...]
Jan 01 08:09:10 foo-bar-box hyperkube[12345]: E0103 08:09:10.23456 14821 kubelet_node_status.go:94] "Unable to register node with API server" err="Node \"foo-bar-node\" is invalid: metadata.labels: Invalid value: \"SCS-4V:16:50\": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')" node="foo-bar-node"
Given the significance of Kubernetes in the SCS project, it would be advisable to reconsider the naming scheme and adopt one that is compatible with the data model defined there.
Thank you!
Activity
garloff commentedon Jan 25, 2023
Options (theoretical, without ordering):
garloff commentedon Jan 25, 2023
Are any other IaaS resource types from IaaS potentially used 1:1 in k8s and need thus to conform to k8s annotation rules?
garloff commentedon Jan 27, 2023
@wwentland - I have not seen OpenStack flavor names ending up in k8s annotations.
@janiskemper, @batistein - have you?
It seems that this is not all that common.
However, OpenShift may have good reasons ...
batistein commentedon Jan 27, 2023
This is definitely a problem when the ccm tries to use the flavor name for the label. In pluscloud-based clusters, the ccm use:
node.kubernetes.io/instance-type: 06894112-a4b4-466b-a2ba-38faf311ae5c.So the problem does not occur there. But of course, the type of the label is not helpful when you want to do scheduling.
In all other Kubernetes clusters I know, the type of the node is mapped 1:1!
So I would agree and state that the current flavor scheme is not RFC 1123 compliant, which is a requirement for use in Kubernetes.
janiskemper commentedon Jan 27, 2023
In the English documentation they say that the node controller of the CCM annotates and labels the node object with cloud-specific information (https://kubernetes.io/docs/concepts/architecture/cloud-controller/#node-controller). In the German version, they even explicitly mention the type of the cloud instance (https://kubernetes.io/de/docs/concepts/architecture/cloud-controller/#node-controller).
fkr commentedon Jan 27, 2023
Thanks @batistein - that is a very helpful bit of info!
garloff commentedon Jan 27, 2023
Hmm, it thus seems we should seriously consider changing our spec, accepting (and mitigating as far as possible) the pain this causes to our already existing flavor spec adopters. Input on #192 is very welcome!
garloff commentedon Feb 15, 2023
Did some more reading.
k8s is actually with annotations containing colons. But not labels. Labels follow stricter rules as written in the report.
https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set
So adjusting would seem unavoidable.
garloff commentedon Feb 27, 2023
This has been addressed in the flavor-naming-scheme v2 (scs-0110-v2), merged with PR #226.