From 8ce0c77fd0f64db9d730f33e620317a85d377fb8 Mon Sep 17 00:00:00 2001 From: Lion-Wei Date: Sat, 23 Sep 2017 12:03:20 +0800 Subject: [PATCH] add service ipvs overview --- docs/concepts/services-networking/service.md | 30 +++++ images/docs/services-ipvs-overview.svg | 121 +++++++++++++++++++ 2 files changed, 151 insertions(+) create mode 100644 images/docs/services-ipvs-overview.svg diff --git a/docs/concepts/services-networking/service.md b/docs/concepts/services-networking/service.md index 1d348bd60c..2d3624d9dd 100644 --- a/docs/concepts/services-networking/service.md +++ b/docs/concepts/services-networking/service.md @@ -203,6 +203,36 @@ having working [readiness probes](/docs/tasks/configure-pod-container/configure- ![Services overview diagram for iptables proxy](/images/docs/services-iptables-overview.svg) +### Proxy-mode: ipvs[alpha] + +**Warning:** This is an alpha feature and not recommended for production clusters yet. + +In this mode, kube-proxy watches Kubernetes `services` and `endpoints`, +call `netlink` interface create ipvs rules accordingly and sync ipvs rules with Kubernetes +`services` and `endpoints` periodically, to make sure ipvs status is +consistent with the expectation. When access the `service`, traffic will +be redirect to one of the backend `pod`. + +Similar to iptables, Ipvs is based on netfilter hook function, but use hash +table as the underlying data structure and work in the kernal state. +That means ipvs redirects traffic can be much faster, and have much +better performance when sync proxy rules. Furthermore, ipvs provides more +options for load balancing algorithm, such as: + +- rr: round-robin +- lc: least connection +- dh: destination hashing +- sh: source hashing +- sed: shortest expected delay +- nq: never queue + +**Note:** ipvs mode assumed IPVS kernel modules are installed on the node +before running kube-proxy. When kube-proxy starts, if proxy mode is ipvs, +kube-proxy would validate if IPVS modules are installed on the node, if +it's not installed kube-proxy will fall back to iptables proxy mode. + +![Services overview diagram for ipvs proxy](/images/docs/services-ipvs-overview.svg) + ## Multi-Port Services Many `Services` need to expose more than one port. For this case, Kubernetes diff --git a/images/docs/services-ipvs-overview.svg b/images/docs/services-ipvs-overview.svg new file mode 100644 index 0000000000..3c2fbbf59c --- /dev/null +++ b/images/docs/services-ipvs-overview.svg @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Backend Pod 1 + + + + + + Backend Pod 2 + + + + + + Backend Pod 3 + + + + + + + + + + + + Client + + + + + + kube-proxy + + + + + + + apiserver + + + + + + ServiceIP + (Virtual Server) + + Node + (Real Server) + +