When a service gets created, kube-proxy daemonset will inject a few of iptables chains and rules to agent node.
Let’s look at the iptables rules for the sample nginx Service with 2 Pods:
# iptables -L -t nat|grep nginx...
KUBE-EXT-OVTWZ4GROBJZO4C5  tcp  --  anywhere             anywhere             /* default/nginx:80-80 */ tcp dpt:32754
...# iptables -L KUBE-NODEPORTS -t natiptables-save > rules.txt-A KUBE-SERVICES -d 10.110.199.45/32 -p tcp -m comment --comment "default/nginx:80-80 cluster IP" -m tcp --dport 80 -j KUBE-SVC-OVTWZ4GROBJZO4C5# cat rules.txt|grep KUBE-SVC-OVTWZ4GROBJZO4C5-A KUBE-SVC-OVTWZ4GROBJZO4C5 ! -s 10.42.0.0/24 -d 10.110.199.45/32 -p tcp -m comment --comment "default/nginx:80-80 cluster IP" -m tcp --dport 80 -j KUBE-MARK-MASQ
-A KUBE-SVC-OVTWZ4GROBJZO4C5 -m comment --comment "default/nginx:80-80 -> 10.42.0.199:80" -m statistic --mode random --probability 0.50000000000 -j KUBE-SEP-ZGUCVTBPJNCW75NN
-A KUBE-SVC-OVTWZ4GROBJZO4C5 -m comment --comment "default/nginx:80-80 -> 10.42.0.200:80" -j KUBE-SEP-UIOQG3KKGTPDCR56# cat rules.txt|grep KUBE-SEP-ZGUCVTBPJNCW75NN
...
-A KUBE-SEP-ZGUCVTBPJNCW75NN -p tcp -m comment --comment "default/nginx:80-80" -m tcp -j DNAT --to-destination 10.42.0.199:80
...# cat rules.txt|grep KUBE-SEP-UIOQG3KKGTPDCR56
...
-A KUBE-SEP-UIOQG3KKGTPDCR56 -p tcp -m comment --comment "default/nginx:80-80" -m tcp -j DNAT --to-destination 10.42.0.200:80
...