These commands to list master nodes and worker nodes no longer work in 1.24 version of kubernetes as node labels have changed.
k get nodes --show-labels
NAME STATUS ROLES AGE VERSION LABELS
kmaster Ready control-plane 6m11s v1.24.0 beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/arch=amd64,kubernetes.io/hostname=kmaster,kubernetes.io/os=linux,node-role.kubernetes.io/control-plane=,node.kubernetes.io/exclude-from-external-load-balancers=
kworker1 Ready <none> 4m41s v1.24.0 beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/arch=amd64,kubernetes.io/hostname=kworker1,kubernetes.io/os=linux
kworker2 Ready <none> 3m16s v1.24.0 beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/arch=amd64,kubernetes.io/hostname=kworker2,kubernetes.io/os=linux
These commands to list master nodes and worker nodes no longer work in 1.24 version of kubernetes as node labels have changed.