Skip to content

Flavor Naming Scheme: Use of colon character as delimiter #190

Closed

Description

@wwentland

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

  1. garloff commented on Jan 25, 2023

    @garloff
    Member

    Options (theoretical, without ordering):

    1. Ignore OpenShift
    2. See whether OpenShift can handle this differently (e.g. translate flavor names)
    3. See whether k8s can be changed to be more tolerant
    4. See whether flavor spec needs adjustment
    5. Reevaluate whether we need flavor spec
  2. garloff commented on Jan 25, 2023

    @garloff
    Member

    Are any other IaaS resource types from IaaS potentially used 1:1 in k8s and need thus to conform to k8s annotation rules?

    • Storage classes?
  3. assigned and unassigned on Jan 25, 2023
  4. added
    IaaS
    Container
    bug
    standards
    on Jan 25, 2023
  5. garloff commented on Jan 27, 2023

    @garloff
    Member

    @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 ...

    • Do we understand why it's doing this? Tolerations? Taints?
    • Can we tweak the way OpenShift is used to not push flavor names into k8s annotations? Or quote/translate them?
    • How likely are other tools doing something similar?
  6. batistein commented on Jan 27, 2023

    @batistein
    Contributor

    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.

  7. janiskemper commented on Jan 27, 2023

    @janiskemper
    Member

    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).

  8. fkr commented on Jan 27, 2023

    @fkr
    Member

    So I would agree and state that the current flavor scheme is not RFC 1123 compliant, which is a requirement for use in Kubernetes.

    Thanks @batistein - that is a very helpful bit of info!

  9. garloff commented on Jan 27, 2023

    @garloff
    Member

    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!

  10. garloff commented on Feb 15, 2023

    @garloff
    Member

    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.

  11. garloff commented on Feb 27, 2023

    @garloff
    Member

    This has been addressed in the flavor-naming-scheme v2 (scs-0110-v2), merged with PR #226.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ContainerIaaSbugstandards

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions