<p>I tried to set role for Kubernetes worker node this way:</p>
<pre><code>kubernetes@kubernetes1:~$ kubectl label node kubernetes2 node-role.kubernetes.io/worker=worker2
node/kubernetes1 labeled
kubernetes@kubernetes1:~$

kubernetes@kubernetes1:~$ kubectl get nodes
NAME          STATUS     ROLES                  AGE   VERSION
kubernetes1   Ready      control-plane,worker   12d   v1.25.1
kubernetes2   NotReady   worker                 12d   v1.25.1
kubernetes3   Ready      worker                 12d   v1.25.1
kubernetes4   Ready      worker                 12d   v1.25.1
</code></pre>
<p>But for all work nodes I get role <code>worker</code> Any idea how I can set custom label?</p>

Peter Penzov
<p><strong>You're assigning a label to a node, not changing the actual role of the node</strong>. You can assign the role (controlplane/worker/etcd) to a node when you're creating your cluster for the 1st time.</p>
<p>If you want to get list of labels assigned to all the nodes, run</p>
<pre><code>kubectl get nodes --show-labels
</code></pre>
