Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kubelet is not running when labeling node-role.kubernetes.io/<role> #3471

Closed
talnovik opened this issue Jan 5, 2024 · 8 comments
Closed
Assignees
Labels
kind/support Categorizes issue or PR as a support question.

Comments

@talnovik
Copy link

talnovik commented Jan 5, 2024

What happened:

Creating a cluster failed on curl to healthz path failed
Caused by adding the label node-role.kubernetes.io/worker to the node labels on the kind cluster config file

What you expected to happen:

I expected that the node will receive the label

How to reproduce it (as minimally and precisely as possible):

Creating a cluster the the label mentioned above the in the cluster config file

Environment:

  • kind version: (use kind version):0.17.0
  • Runtime info: (use docker info or podman info): runc
  • OS (e.g. from /etc/os-release):centos 7
  • Kubernetes version: (use kubectl version):1.25.3
@talnovik talnovik added the kind/bug Categorizes issue or PR as related to a bug. label Jan 5, 2024
@BenTheElder
Copy link
Member

kubernetes.io / k8.sio namespace is restricted to API approved labels, this is not kind specific

@BenTheElder BenTheElder added kind/support Categorizes issue or PR as a support question. and removed kind/bug Categorizes issue or PR as related to a bug. labels Jan 8, 2024
@BenTheElder BenTheElder self-assigned this Jan 8, 2024
@BenTheElder
Copy link
Member

https://kubernetes.io/docs/reference/labels-annotations-taints/

Kubernetes reserves all labels and annotations in the kubernetes.io and k8s.io namespaces.

Kubelet will refuse to start if an invalid kubernetes.io or k8s.io label is used. Your custom labels can also conflict with kubeadm.

I recommend using a label in your own namespace, not manipulating Kubernetes's namespaces

@BenTheElder
Copy link
Member

xref kubernetes/kubeadm#2509

@vlasov-y
Copy link

vlasov-y commented Oct 8, 2024

@BenTheElder
Copy link
Member

I can't recommend using this, the official policy is that the k8s.io and kubernetes.io namespaces are reserved for the Kubernetes project. For other third party usage, I STRONGLY encourage picking your own namespace and applying your custom labels under that.

@BenTheElder
Copy link
Member

BenTheElder commented Oct 8, 2024

https://kubernetes.io/docs/reference/labels-annotations-taints/

Kubernetes reserves all labels and annotations in the kubernetes.io and k8s.io namespaces.

(this is why kubelet blocks you from applying custom values under these namespaces)

@vlasov-y
Copy link

vlasov-y commented Oct 9, 2024

https://kubernetes.io/docs/reference/labels-annotations-taints/

Kubernetes reserves all labels and annotations in the kubernetes.io and k8s.io namespaces.

(this is why kubelet blocks you from applying custom values under these namespaces)

That is as clear as day, but let's say I have a cluster autoscaler and EKS. I am the one who control both and I want to have a fancy roles assigned to nodes without any crutches - I cannot do that, because node-role.kubernetes.io is reserved. Project I have mentioned solves this particular case.
If k9s or similar could consider node-role.cluster.local as node role labels and show roles from that keys in roles column from nodes view, that would be cool.

@BenTheElder
Copy link
Member

There's no guarantee that kubernetes doesn't directly do more with reserved namespaces in the future and conflict with your nonstandard usage. I would strongly encourage using your own namespace and selecting tools that will show those values or patching the tools you use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/support Categorizes issue or PR as a support question.
Projects
None yet
Development

No branches or pull requests

3 participants