如何确定master nodes究竟在哪几台服务器上

k8s配合容器化技术,高度抽象了底层硬件,因此有时候我们想了解master node的具体位置,还有点困难。

第一步,先找到master nodes的名字

[root@172-20-26-79 ~]# kubectl get nodes | grep master
ks-control-1         Ready    control-plane,master   5d23h   v1.21.11
ks-control-2         Ready    control-plane,master   5d23h   v1.21.11
ks-control-3         Ready    control-plane,master   5d23h   v1.21.11

第二步,使用describe来获取内部ip的地址,从而判断是否在一台主机上(综合server的组网情况)

[root@172-20-26-79 ~]# kubectl describe nodes ks-control-3 | grep InternalIP
  InternalIP:  172.20.26.28
[root@172-20-26-79 ~]# kubectl describe nodes ks-control-2 | grep InternalIP
  InternalIP:  172.20.26.89
[root@172-20-26-79 ~]# kubectl describe nodes ks-control-1 | grep InternalIP
  InternalIP:  172.20.26.86

Leave a Reply

Your email address will not be published. Required fields are marked *