Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move ipvs module loading logic in local-cluster-up.sh #59936

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 8 additions & 5 deletions hack/local-up-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,14 @@ fi

# set feature gates if using ipvs mode
if [ "${KUBE_PROXY_MODE}" == "ipvs" ]; then
FEATURE_GATES="$FEATURE_GATES,SupportIPVSProxyMode=true"
# If required kernel modules are not available, fall back to iptables.
sudo modprobe -a ip_vs ip_vs_rr ip_vs_wrr ip_vs_sh nf_conntrack_ipv4
if [[ $? -eq 0 ]]; then
FEATURE_GATES="${FEATURE_GATES},SupportIPVSProxyMode=true"
else
echo "Required kernel modules for ipvs not found. Falling back to iptables mode."
KUBE_PROXY_MODE=iptables
fi
fi

# set feature gates if enable Pod priority and preemption
Expand Down Expand Up @@ -813,10 +820,6 @@ hostnameOverride: ${HOSTNAME_OVERRIDE}
featureGates: ${FEATURE_GATES}
mode: ${KUBE_PROXY_MODE}
EOF
if [ "${KUBE_PROXY_MODE}" == "ipvs" ]; then
# Load kernel modules required by IPVS proxier
sudo modprobe -a ip_vs ip_vs_rr ip_vs_wrr ip_vs_sh nf_conntrack_ipv4
fi

sudo "${GO_OUT}/hyperkube" proxy \
--config=/tmp/kube-proxy.yaml \
Expand Down