k8s报错信息-Pod节点内无法访问ClusterIp

https://blog.51cto.com/13641616/2442005

1.现象:

2.查看日志:

3.添加IPV4模块:
cat > /etc/sysconfig/modules/ipvs.modules <<EOF

!/bin/bash

modprobe -- ip_vs
modprobe -- ip_vs_rr
modprobe -- ip_vs_wrr
modprobe -- ip_vs_sh
modprobe -- nf_conntrack_ipv4
EOF

chmod 755 /etc/sysconfig/modules/ipvs.modules && bash /etc/sysconfig/modules/ipvs.modules && lsmod | grep -e ip_vs -e nf_conntrack_ipv4

4.修改kupe-proxy的模式:
kubectl edit cm kube-proxy -n kube-system

5.重启kupe-proxy:
kubectl get pod -n kube-system | grep kube-proxy |awk '{system("kubectl delete pod "$1" -n kube-system")}'

6.查看日志:
kubectl logs -n kube-system kube-proxy-cbm8p

7.测试:

posted @ 2020-01-20 15:48  薄荷少年郎微微凉  阅读(3923)  评论(0编辑  收藏  举报