kubernetes-sigs/cluster-api

MachineSet and ControlPlanes with longer names no longer reconcile

开放

#7,710 创建于 2022年12月8日

 (12 条评论) (0 个反应) (0 位负责人)Go (1,532 个派生)auto 404
help wantedkind/bugpriority/important-longtermtriage/accepted

仓库指标

星标
 (4,267 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

On main, v1.3.0 and v1.2.7 MachineSets and ControlPlanes with longer names can no longer be reconciled. This is due to using the MachineSet name as the value in a label which has different validation rules than a Kubernetes object name. The most important difference being a maximum length of 63 characters for label values.

The issue was introduced as part of the adoption fix for Machines which was backported to the v1.2 release branch - https://github.com/kubernetes-sigs/cluster-api/pull/7591

This can be resolved by hashing overly-long names when applying the label. This will result in a worse UX for users that have MachineSets with long names as the label will no longer be human-readable.

As part of fixing this we can regularlize and improve the way objects in CAPI are named in order to prevent this issue from recurring and limit the situations where the hashing needs to be done.

The following would improve the situation:

  1. Update labelling strategy to reduce the length of MS and CP labels when overly-long. (described above) #7711
  2. Explicitly enforce max length of 63 characters for Cluster name. This is currently enforced implicitly as the Cluster name is used as a label value in multiple objects. #7712
  3. Explicitly enforce max length of 63 characters for MachineDeployment name length in MD webhook. This is currently enforced implicitly as the MD name is used as a label value in multiple objects. #7712
  4. Use SimpleNameGenerator for generating names for MachineSets. This will implicitly enforce a maximum MS name length of 63 characters for MSes created by the MD controller.

/kind bug

贡献者指南