File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8080
8181IPTABLES=$( [ " ${USE_IPTABLES_LEGACY:- 0} " = " 1" ] && echo iptables-legacy || echo iptables)
8282
83- # ---------------------------------------------------------------------------
84- # Select kube-proxy mode
85- # ---------------------------------------------------------------------------
86- # k3s defaults kube-proxy to iptables mode, which requires the legacy
87- # ip_tables kernel module. Modern distros (Fedora 41+, RHEL 10+) load only
88- # nf_tables by default and may not have the legacy modules available.
89- # k3s v1.35+ (Kubernetes 1.35) supports the native nftables proxy mode at
90- # GA stability. Detect nftables availability and prefer it; fall back to the
91- # default iptables mode on older kernels.
92- KUBE_PROXY_MODE=" "
93- if command -v nft > /dev/null 2>&1 && nft list tables > /dev/null 2>&1 ; then
94- echo " Detected nftables kernel support — using kube-proxy nftables mode"
95- KUBE_PROXY_MODE=" --kube-proxy-arg=proxy-mode=nftables"
96- fi
97-
9883RESOLV_CONF=" /etc/rancher/k3s/resolv.conf"
9984
10085has_default_route () {
@@ -651,4 +636,4 @@ wait_for_default_route
651636# k3s v1.35.2+ no longer accepts --resolv-conf as a top-level server flag;
652637# it must be passed via --kubelet-arg instead.
653638# shellcheck disable=SC2086
654- exec /bin/k3s " $@ " --kubelet-arg=resolv-conf=" $RESOLV_CONF " $EXTRA_KUBELET_ARGS $KUBE_PROXY_MODE
639+ exec /bin/k3s " $@ " --kubelet-arg=resolv-conf=" $RESOLV_CONF " $EXTRA_KUBELET_ARGS
You can’t perform that action at this time.
0 commit comments