mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Rework cluster/ kube-proxy setup for --proxy-mode
This commit is contained in:
		
							
								
								
									
										17
									
								
								cluster/gce/gci/configure-helper.sh
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										17
									
								
								cluster/gce/gci/configure-helper.sh
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							@@ -1753,7 +1753,12 @@ function prepare-kube-proxy-manifest-variables {
 | 
			
		||||
  if [[ -n "${FEATURE_GATES:-}" ]]; then
 | 
			
		||||
    params+=" --feature-gates=${FEATURE_GATES}"
 | 
			
		||||
  fi
 | 
			
		||||
  if [[ "${KUBE_PROXY_MODE:-}" == "ipvs" ]];then
 | 
			
		||||
 | 
			
		||||
  case "${KUBE_PROXY_MODE:-iptables}" in
 | 
			
		||||
    iptables)
 | 
			
		||||
      params+=" --proxy-mode=iptables --iptables-sync-period=1m --iptables-min-sync-period=10s"
 | 
			
		||||
      ;;
 | 
			
		||||
    ipvs)
 | 
			
		||||
      # use 'nf_conntrack' instead of 'nf_conntrack_ipv4' for linux kernel >= 4.19
 | 
			
		||||
      # https://github.com/kubernetes/kubernetes/pull/70398
 | 
			
		||||
      local -r kernel_version=$(uname -r | cut -d\. -f1,2)
 | 
			
		||||
@@ -1762,15 +1767,15 @@ function prepare-kube-proxy-manifest-variables {
 | 
			
		||||
        conntrack_module="nf_conntrack_ipv4"
 | 
			
		||||
      fi
 | 
			
		||||
 | 
			
		||||
    if sudo modprobe -a ip_vs ip_vs_rr ip_vs_wrr ip_vs_sh ${conntrack_module}; then
 | 
			
		||||
      params+=" --proxy-mode=ipvs"
 | 
			
		||||
    else
 | 
			
		||||
      if ! sudo modprobe -a ip_vs ip_vs_rr ip_vs_wrr ip_vs_sh ${conntrack_module}; then
 | 
			
		||||
        # If IPVS modules are not present, make sure the node does not come up as
 | 
			
		||||
        # healthy.
 | 
			
		||||
        exit 1
 | 
			
		||||
      fi
 | 
			
		||||
  fi
 | 
			
		||||
  params+=" --iptables-sync-period=1m --iptables-min-sync-period=10s --ipvs-sync-period=1m --ipvs-min-sync-period=10s"
 | 
			
		||||
      params+=" --proxy-mode=ipvs --ipvs-sync-period=1m --ipvs-min-sync-period=10s"
 | 
			
		||||
      ;;
 | 
			
		||||
  esac
 | 
			
		||||
 | 
			
		||||
  if [[ -n "${KUBEPROXY_TEST_ARGS:-}" ]]; then
 | 
			
		||||
    params+=" ${KUBEPROXY_TEST_ARGS}"
 | 
			
		||||
  fi
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user