I succeeded in setup a control-plane,master node in my vm. Then I copied the vm, trying to join the copied vm to the existed kubernete cluster.
Problem is that the original vm(node)'s name is new-master-1, and the copied node has the same name. Even after I vi /etc/hostname and change the copied vm's name to new-master-2, after running kubectl get nodes in the copied vm, the output name is still new-master-1:
root@new-master-2:/home/hzg# kubectl get nodes
NAME STATUS ROLES AGE VERSION
new-master-1 Ready control-plane,master 32h v1.20.2
I think I can only join the copied vm as another master node to the cluster after I see that the name change to new-master-2, right? How to change the node's name?