I have 3 nodes in the cluster, one is the master node and two are the worker nodes. I use CNI flannel for the Kubernetes cluster. I run an Nginx ingress in my cluster for the load balancer and the hostname is host.com
this is my pods in the cluster
namespace deploy-4yhghhf4d-345ck 1/1 Running 0 2d14h 10.45.0.55 agent-02 <none> <none>
namespace deploy-4yhghhf4d-a4fcf 1/1 Running 0 2d14h 10.45.1.25 master <none> <none>
namespace deploy-4yhghhf4d-87678 1/1 Running 0 2d14h 10.45.2.30 agent-03 <none> <none>
I tried to access from browser and from the command line. to access the deploy-fdtt88f4d-345ck and deploy-4yhghhf4d-a4fcf is a success via host.com. I can curl on the command line or via browser host.com.
Of course, the pods have an IP address. I want to try to access or ping those IP addresses through the command line.
from master side
master ping itself: ping 10.45.1.25 (success)
master ping agent-02: ping 10.45.0.55 (failed)
master ping agent-03: ping 10.45.2.30 (failed)
from agent side
agent-03 ping agent-02: ping 10.45.0.55 (success)
agent-02 ping agent-03: ping 10.45.2.30 (success)
agent-02 ping master: ping 10.45.1.25 (failed)
the point is whenever we ping or curl to or from master will always fail. no response. but agent to agent was successed.
I flush my iptables on the master side. but it is still not working.
iptables -L
# Warning: iptables-legacy tables present, use iptables-legacy to see them
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain KUBE-EXTERNAL-SERVICES (0 references)
target prot opt source destination
Chain KUBE-FIREWALL (0 references)
target prot opt source destination
Chain KUBE-FORWARD (0 references)
target prot opt source destination
Chain KUBE-KUBELET-CANARY (0 references)
target prot opt source destination
Chain KUBE-NODEPORTS (0 references)
target prot opt source destination
Chain KUBE-NWPLCY-DEFAULT (0 references)
target prot opt source destination
Chain KUBE-PROXY-CANARY (0 references)
target prot opt source destination
Chain KUBE-ROUTER-FORWARD (0 references)
target prot opt source destination
Chain KUBE-ROUTER-INPUT (0 references)
target prot opt source destination
Chain KUBE-ROUTER-OUTPUT (0 references)
target prot opt source destination
Chain KUBE-SERVICES (0 references)
target prot opt source destination
#ip route
10.45.0.0/24 via 10.45.0.0 dev flannel.1 onlink
10.45.1.0/24 via 10.45.1.0 dev flannel.1 onlink
10.45.2.0/24 via 10.45.2.0 dev flannel.1 onlink
#cat /run/flannel/subnet.env
FLANNEL_NETWORK=10.45.0.0/16
FLANNEL_SUBNET=10.45.0.1/24
FLANNEL_MTU=1450
FLANNEL_IPMASQ=true
kubectl get nodes -o yaml |grep flannel.alpha
flannel.alpha.coreos.com/backend-data: '{"VNI":1,"VtepMAC":"16:cb:5c:78:57:cb"}'
flannel.alpha.coreos.com/backend-type: vxlan
flannel.alpha.coreos.com/kube-subnet-manager: "true"
flannel.alpha.coreos.com/public-ip: 192.168.14.3
flannel.alpha.coreos.com/backend-data: '{"VNI":1,"VtepMAC":"7e:1e:e8:f6:8f:77"}'
flannel.alpha.coreos.com/backend-type: vxlan
flannel.alpha.coreos.com/kube-subnet-manager: "true"
flannel.alpha.coreos.com/public-ip: 192.168.14.4
flannel.alpha.coreos.com/backend-data: '{"VNI":1,"VtepMAC":"06:cd:6a:ba:6b:54"}'
flannel.alpha.coreos.com/backend-type: vxlan
flannel.alpha.coreos.com/kube-subnet-manager: "true"
flannel.alpha.coreos.com/public-ip: 10.0.3.15
flannel.alpha.coreos.com/backend-data: '{"VNI":1,"VtepMAC":"96:71:0e:48:52:4d"}'
flannel.alpha.coreos.com/backend-type: vxlan
flannel.alpha.coreos.com/kube-subnet-manager: "true"
flannel.alpha.coreos.com/public-ip: 192.168.14.2