Set a role for a new worker node in Kubernetes

When you need to set a role for a new node in a Kubernetes cluster, do the following:

Check if the node is correctly added:

kubectl get nodes

Label the new node:

kubectl label node k8w04 node-role.kubernetes.io/worker=worker

Check the nodes again with:

kubectl get nodes