Context: 2 Nodes with 3 Pods
Node-1:Pod-A,Pod-B Node-2:Pod-C
use NodePort to expose the service in my local virtual boxes(centos).
If I visit application by k8s service-clusterIP, I can see the round-robin is working among the 3 pods
If I visit application By Node-1, I didn't see the round-robin is working. only Pod-A is hit.
the round-robin is not working if access by Node IP? (the node have more than 1 pod)
10.144.39.* (company network)
192.168.* k8s network
Env: Mac laptop k8s cluster is hosted in the VM(3 instances:Master,Node-1,Node-2)
k8s clusters
Master
Node-1:Pod-A,Pod-B
Node-2:Pod-C
IP info: Master 10.144.39.107
Node-1: 10.144.39.108 192.168.84.128
Node-2: 10.144.39.109 192.168.247.0
Testcases:
1.send request from Mac env
step:
wget -qO- http://10.144.39.108:1651 (node-2 with 2 pods)
Result:
Round-Robin:only hit the Pod-A
2.send reqeuset from the master/node-1/node-2 VM (Master server)
step:
wget -qO- http://10.144.39.108:1651 (node-2 with 2 pods)
Result:
Round-Robin: only hit the Pod-A,Pod-B
3.send request from the cluster inside:
steps:
1.kubectl exec busybox -it /bin/sh
2.wget -qO- http://10.144.39.108:31651
3.exit
Round-Robin: hit the Pod-A,Pod-B,Pod-C