From 3953da98b061f71946621e72cbf850e8a0c08bc6 Mon Sep 17 00:00:00 2001 From: Weibin Lin Date: Tue, 22 May 2018 00:38:51 +0800 Subject: [PATCH] Update debug-service.md --- add ipvs part on kube-proxy (#8652) --- .../debug-service.md | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/content/en/docs/tasks/debug-application-cluster/debug-service.md b/content/en/docs/tasks/debug-application-cluster/debug-service.md index 2142b2fd77..67c72c908d 100644 --- a/content/en/docs/tasks/debug-application-cluster/debug-service.md +++ b/content/en/docs/tasks/debug-application-cluster/debug-service.md @@ -459,8 +459,8 @@ One of the main responsibilities of `kube-proxy` is to write the `iptables` rules which implement `Services`. Let's check that those rules are getting written. -The kube-proxy can run in either "userspace" mode or "iptables" mode. -Hopefully you are using the newer, faster, more stable "iptables" mode. You +The kube-proxy can run in "userspace" mode, "iptables" mode or "ipvs" mode. +Hopefully you are using the "iptables" mode or "ipvs" mode. You should see one of the following cases. #### Userspace @@ -500,6 +500,22 @@ There should be 1 rule in `KUBE-SERVICES`, 1 or 2 rules per endpoint in per endpoint, and a few rules in each `KUBE-SEP-(hash)` chain. The exact rules will vary based on your exact config (including node-ports and load-balancers). +#### IPVS + +```shell +u@node$ ipvsadm -ln +Prot LocalAddress:Port Scheduler Flags + -> RemoteAddress:Port Forward Weight ActiveConn InActConn +... +TCP 10.0.1.175:80 rr + -> 10.244.0.5:9376 Masq 1 0 0 + -> 10.244.0.6:9376 Masq 1 0 0 + -> 10.244.0.7:9376 Masq 1 0 0 +... +``` + +IPVS proxy will create a virtual server for each service address(e.g. Cluster IP, External IP, NodePort IP, Load Balancer IP etc.) and some corresponding real servers for endpoints of the service, if any. In this example, service hostnames(`10.0.1.175:80`) has 3 endpoints(`10.244.0.5:9376`, `10.244.0.6:9376`, `10.244.0.7:9376`) and you'll get results similar to above. + ### Is kube-proxy proxying? Assuming you do see the above rules, try again to access your `Service` by IP: