Kubernetes 1.18.6:Google Cloud 自定义虚拟机节点上的 Pod 间通信不起作用

Kubernetes 1.18.6:Google Cloud 自定义虚拟机节点上的 Pod 间通信不起作用

[问题陈述]

来自{busybox-minion1} 正在运行worker1 {命名为:minion1}{busybox-minion2} 在worker2 {命名为:minion2}不工作

这是使用以下命令使用 centos 7 映像在 Google Cloud 上创建的三节点集群。所有节点和 pod 均已启动并正在运行。

【Kubeadm init 命令】:

kubeadm init --apiserver-advertise-address=10.128.0.5 --pod-network-cidr=192.168.0.0/16 

[覆盖网络]:

kubectl create -f https://docs.projectcalico.org/v3.11/manifests/calico.yaml

[前提条件]

  • 禁用防火墙:是
  • 禁用交换:是
  • 禁用 SELinux:是

[IP 表设置]

sudo sysctl net.bridge.bridge-nf-call-iptables=1    
sudo sysctl net.ipv4.ip_forward=1    
sudo sysctl --system    
sudo echo "1" > /proc/sys/net/ipv4/ip_forward

[工作设置详情]

[user@k8master ~]$ **kubectl version --short**  
Client Version: v1.18.6
Server Version: v1.18.6
[user@k8master ~]$ 
[user@k8master ~]$ kubectl get nodes -o wide
        
NAME    STATUS  ROLES   AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE    KERNEL-VERSION  CONTAINER-RUNTIME
k8master    Ready   master  5h5m    v1.18.6 10.128.0.5  <none>  CentOS  Linux   7   (Core)  3.10.0-1127.13.1.el7.x86_64 docker://1.13.1
minion1 Ready   <none>  4h54m   v1.18.6 10.128.0.6  <none>  CentOS  Linux   7   (Core)  3.10.0-1127.13.1.el7.x86_64 docker://1.13.1
minion2 Ready   <none>  4h54m   v1.18.6 10.128.0.7  <none>  CentOS  Linux   7   (Core)  3.10.0-1127.13.1.el7.x86_64 docker://1.13.1

[user@k8master ~]$ 
[user@k8master ~]$ 
[user@k8master ~]$ kubectl get pods --all-namespaces -o wide
    
NAMESPACE     NAME                                       READY   STATUS    RESTARTS   AGE     IP                NODE       NOMINATED NODE   READINESS GATES

default       busybox-minion1                            1/1     Running   2          4h41m   192.168.34.1      **minion1**    <none>           <none>
default       busybox-minion2                            1/1     Running   2          4h40m   192.168.179.194   **minion2**    <none>           <none>
kube-system   calico-kube-controllers-578894d4cd-zjbvj   1/1     Running   1          4h25m   192.168.179.195   minion2    <none>           <none>
kube-system   calico-node-fv4w9                          1/1     Running   1          4h25m   10.128.0.6        minion1    <none>           <none>
kube-system   calico-node-l92x6                          1/1     Running   1          4h25m   10.128.0.5        k8master   <none>           <none>
kube-system   calico-node-s62gl                          1/1     Running   1          4h25m   10.128.0.7        minion2    <none>           <none>
kube-system   coredns-66bff467f8-xwhl8                   1/1     Running   1          5h5m    192.168.125.193   k8master   <none>           <none>
kube-system   coredns-66bff467f8-zgvg2                   1/1     Running   1          5h5m    192.168.125.194   k8master   <none>           <none>
kube-system   etcd-k8master                              1/1     Running   1          5h5m    10.128.0.5        k8master   <none>           <none>
kube-system   kube-apiserver-k8master                    1/1     Running   1          5h5m    10.128.0.5        k8master   <none>           <none>
kube-system   kube-controller-manager-k8master           1/1     Running   1          5h5m    10.128.0.5        k8master   <none>           <none>
kube-system   kube-proxy-49862                           1/1     Running   1          4h55m   10.128.0.6        minion1    <none>           <none>
kube-system   kube-proxy-7c99z                           1/1     Running   1          4h54m   10.128.0.7        minion2    <none>           <none>
kube-system   kube-proxy-dxq9d                           1/1     Running   1          5h5m    10.128.0.5        k8master   <none>           <none>
kube-system   kube-scheduler-k8master                    1/1     Running   1          5h5m    10.128.0.5        k8master   <none>           <none>

[user@k8master ~]$ 
[user@k8master ~]$ kubectl exec -it busybox-minion1 -- ping 192.168.179.194**
    
PING 192.168.179.194 (192.168.179.194): 56 data bytes
    
^C
    
--- 192.168.179.194 ping statistics ---
    
5 packets transmitted, 0 packets received, 100% packet loss
    
command terminated with exit code 1
    
[user@k8master ~]$

[图片供参考]

相关内容