简体   繁体   中英

does calico also run in ipvs mode when kube proxy is runing in ipvs mode

I understood kube-proxy can run in iptables or ipvs mode. Also, calico sets up iptables rules.

But does calico iptables rules are only installed when kube proxy is running in iptables mode OR these iptables rules are installed irrespective to kube-proxy mode?

According to the documentation :

Calico ipvs support is activated automatically if Calico detects that kube-proxy is running in that mode.

The short answer is yes - Calico supports IPVS kube-proxy mode:

Calico ipvs support is activated automatically if Calico detects that kube-proxy is running in that mode.

Additionally:

Calico will detect if you change kube-proxy 's proxy mode after Calico has been deployed. Any Kubernetes ipvs -specific configuration needs to be configured before changing the kube-proxy proxy mode to ipvs

However, as you have noticed yourself kube-proxy can run in iptables or ipvs mode. See the comparison between iptables and ipvs mode :

IPVS is a Linux kernel feature that is specifically designed for load balancing. In IPVS mode, kube-proxy programs the IPVS load balancer instead of using iptables. In addition, as a dedicated load balancer, IPVS boasts multiple different scheduling algorithms such as round-robin, shortest-expected-delay, least connections, and various hashing approaches. In contrast, kube-proxy in iptables uses a randomized equal cost selection algorithm.

The ipvs mode will provide performance compared to the iptables mode. However, there are some limitations:

  • Calico requires extra iptables packet marker bits to track packets as they pass through IPVS.
  • Calico must be configured with a port range assigned to Kubernetes NodePorts. If services are using NodePorts outside of the expected Calico range, Calico will treat traffic to those ports as host traffic, not traffic to them.

Here you can find a guide, how to use IPVS kube-proxy. If you choose to use this mode, Calico will automatically switch to this mode.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM