Closed cai11745 closed 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
/etc/kubernetes/kubelet.conf其实并不是必须修改,他指向当前主机即可,该设置不影响高可用,本台master倒掉,服务依然可以正常提供。
只有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