mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +00:00
local up cluster in ipvs mode by add env 'KUBEPROXY_MODE=ipvs'
This commit is contained in:
parent
70960a5ed7
commit
a6af827898
@ -57,6 +57,7 @@ EVICTION_PRESSURE_TRANSITION_PERIOD=${EVICTION_PRESSURE_TRANSITION_PERIOD:-"1m"}
|
|||||||
# and we don't know the IP of the DNS pod to pass in as --cluster-dns.
|
# and we don't know the IP of the DNS pod to pass in as --cluster-dns.
|
||||||
# To set this up by hand, set this flag and change DNS_SERVER_IP.
|
# To set this up by hand, set this flag and change DNS_SERVER_IP.
|
||||||
# Note also that you need API_HOST (defined above) for correct DNS.
|
# Note also that you need API_HOST (defined above) for correct DNS.
|
||||||
|
KUBEPROXY_MODE=${KUBEPROXY_MODE:-""}
|
||||||
ENABLE_CLUSTER_DNS=${KUBE_ENABLE_CLUSTER_DNS:-true}
|
ENABLE_CLUSTER_DNS=${KUBE_ENABLE_CLUSTER_DNS:-true}
|
||||||
DNS_SERVER_IP=${KUBE_DNS_SERVER_IP:-10.0.0.10}
|
DNS_SERVER_IP=${KUBE_DNS_SERVER_IP:-10.0.0.10}
|
||||||
DNS_DOMAIN=${KUBE_DNS_NAME:-"cluster.local"}
|
DNS_DOMAIN=${KUBE_DNS_NAME:-"cluster.local"}
|
||||||
@ -114,6 +115,11 @@ if [ "${CLOUD_PROVIDER}" == "openstack" ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#set feature gates if using ipvs mode
|
||||||
|
if [ "${KUBEPROXY_MODE}" == "ipvs" ]; then
|
||||||
|
FEATURE_GATES="$FEATURE_GATES,SupportIPVSProxyMode=true"
|
||||||
|
fi
|
||||||
|
|
||||||
# warn if users are running with swap allowed
|
# warn if users are running with swap allowed
|
||||||
if [ "${FAIL_SWAP_ON}" == "false" ]; then
|
if [ "${FAIL_SWAP_ON}" == "false" ]; then
|
||||||
echo "WARNING : The kubelet is configured to not fail if swap is enabled; production deployments should disable swap."
|
echo "WARNING : The kubelet is configured to not fail if swap is enabled; production deployments should disable swap."
|
||||||
@ -738,6 +744,16 @@ clientConnection:
|
|||||||
hostnameOverride: ${HOSTNAME_OVERRIDE}
|
hostnameOverride: ${HOSTNAME_OVERRIDE}
|
||||||
featureGates: ${FEATURE_GATES}
|
featureGates: ${FEATURE_GATES}
|
||||||
EOF
|
EOF
|
||||||
|
if [ "${KUBEPROXY_MODE}" == "ipvs" ]; then
|
||||||
|
cat <<EOF >> /tmp/kube-proxy.yaml
|
||||||
|
mode: ipvs
|
||||||
|
EOF
|
||||||
|
sudo modprobe ip_vs
|
||||||
|
sudo modprobe ip_vs_rr
|
||||||
|
sudo modprobe ip_vs_wrr
|
||||||
|
sudo modprobe ip_vs_sh
|
||||||
|
sudo modprobe nf_conntrack_ipv4
|
||||||
|
fi
|
||||||
|
|
||||||
sudo "${GO_OUT}/hyperkube" proxy \
|
sudo "${GO_OUT}/hyperkube" proxy \
|
||||||
--config=/tmp/kube-proxy.yaml \
|
--config=/tmp/kube-proxy.yaml \
|
||||||
|
Loading…
Reference in New Issue
Block a user