cookeem / kubeadm-ha

通过kubeadm安装kubernetes高可用集群,使用docker/containerd容器运行时,适用v1.24.x以上版本
MIT License
679 stars 275 forks source link

node加入集群后/etc/kubernetes/kubelet.conf需要修改api地址为HA-IP #14

Closed cai11745 closed 6 years ago

cai11745 commented 6 years ago

只有kube-proxy指向的是HA-IP root@ubuntu:/etc/kubernetes# netstat -alnp |grep 6443 tcp 0 0 0.0.0.0:6443 0.0.0.0:* LISTEN 1337/haproxy
tcp 0 0 192.168.1.148:33958 192.168.4.130:6443 ESTABLISHED 22089/kube-proxy tcp 0 0 192.168.1.148:43178 192.168.1.146:6443 ESTABLISHED 21876/kubelet

146为本地IP,4.130为我的HA-IP /etc/kubernetes/kubelet.conf 修改api地址后

root@ubuntu:/etc/kubernetes# vim /etc/kubernetes/kubelet.conf root@ubuntu:/etc/kubernetes# systemctl restart docker && systemctl restart kubelet root@ubuntu:/etc/kubernetes# netstat -alnp |grep 6443 tcp 0 0 0.0.0.0:6443 0.0.0.0:* LISTEN 1337/haproxy
tcp 0 0 192.168.1.148:34212 192.168.4.130:6443 ESTABLISHED 22795/kubelet
tcp 0 0 192.168.1.148:34232 192.168.4.130:6443 ESTABLISHED 23008/kube-proxy

cookeem commented 6 years ago

/etc/kubernetes/kubelet.conf其实并不是必须修改,他指向当前主机即可,该设置不影响高可用,本台master倒掉,服务依然可以正常提供。