Skip to content

Conversation

@yanhua121
Copy link
Contributor

https://jira.nutanix.com/browse/NCN-110986

fix: sanitize region/zone values to meet the K8s label value requirement

@thunderboltsid
Copy link
Contributor

thunderboltsid commented Nov 20, 2025

Thanks for the PR. This is indeed a funky issue. However, I'd like us to discuss this change more. The moment we sanitize the name to another name we're basically feeding in inaccurate names which means those labels are no longer a reliable identifier for an actual resource.

@dkoshkin
Copy link

Thanks for the PR. This is indeed a funky issue. However, I'd like us o discuss this change more. The moment we sanitize the name to another name we're basically feeding in inaccurate names which means those labels are no longer a reliable identifier for an actual resource.

💯

@yanhua121
Copy link
Contributor Author

yanhua121 commented Nov 20, 2025

Thanks for the PR. This is indeed a funky issue. However, I'd like us o discuss this change more. The moment we sanitize the name to another name we're basically feeding in inaccurate names which means those labels are no longer a reliable identifier for an actual resource.

@thunderboltsid
As I said in the slack thread: the workaround in CCM is when setting the (http://k8s.io/cloud-provider.InstanceMetadata's) Region and Zone (either by default using PC/PE names or user configured to use Categories), replace the invalid chars (such as space " ") with the label value allowed '-', '_', or '.' , and logs warning message in CCM.
The pro of this workaround is it does not block the CCM to run and does not requires other K8s product such as OpenShift to add preflight check. Anyway, the Region and Zone values are only used to set the Node object's label values for "topology.kubernetes.io/region" and "topology.kubernetes.io/zone".

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants