mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-01 01:28:11 -03:30
Merge pull request #2201 from riverzhang/ipvs
Support ipvs mode for kube-proxy
This commit is contained in:
@@ -14,6 +14,7 @@ kubelet_bind_address: "{{ ip | default('0.0.0.0') }}"
|
||||
# resolv.conf to base dns config
|
||||
kube_resolv_conf: "/etc/resolv.conf"
|
||||
|
||||
# Can be ipvs, iptables
|
||||
kube_proxy_mode: iptables
|
||||
|
||||
# If using the pure iptables proxy, SNAT everything. Note that it breaks any
|
||||
|
||||
@@ -104,6 +104,20 @@
|
||||
- net.bridge.bridge-nf-call-arptables
|
||||
- net.bridge.bridge-nf-call-ip6tables
|
||||
|
||||
- name: Modprode Kernel Module for IPVS
|
||||
modprobe:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
when: kube_proxy_mode == 'ipvs'
|
||||
with_items:
|
||||
- ip_vs
|
||||
- ip_vs_rr
|
||||
- ip_vs_wrr
|
||||
- ip_vs_sh
|
||||
- nf_conntrack_ipv4
|
||||
tags:
|
||||
- kube-proxy
|
||||
|
||||
- name: Write proxy manifest
|
||||
template:
|
||||
src: manifests/kube-proxy.manifest.j2
|
||||
|
||||
@@ -33,6 +33,13 @@ spec:
|
||||
- --proxy-mode={{ kube_proxy_mode }}
|
||||
{% if kube_proxy_masquerade_all and kube_proxy_mode == "iptables" %}
|
||||
- --masquerade-all
|
||||
{% elif kube_proxy_mode == 'ipvs' %}
|
||||
- --masquerade-all
|
||||
- --feature-gates=SupportIPVSProxyMode=true
|
||||
- --proxy-mode=ipvs
|
||||
- --ipvs-min-sync-period=5s
|
||||
- --ipvs-sync-period=5s
|
||||
- --ipvs-scheduler=rr
|
||||
{% endif %}
|
||||
securityContext:
|
||||
privileged: true
|
||||
|
||||
Reference in New Issue
Block a user