• Kubernetes Submit Queue's avatar
    Merge pull request #65388 from DataDog/lbernail/fix-ipvs-from-host · 966c77c8
    Kubernetes Submit Queue authored
    Automatic merge from submit-queue (batch tested with PRs 65388, 64995). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.
    
    Always create kubeClusterIPSet in ipvs proxier
    
    **What this PR does / why we need it**:
    This PR creates the kubeClusterIPSet ipset even if kube-proxy is started without masqueradeAll and clusterCIDR.
    This is necessary to masquerade traffic sent to a clusterIP from the host network namespace. The code to do so is actually already present here: https://github.com/kubernetes/kubernetes/blob/master/pkg/proxy/ipvs/proxier.go#L1220-L1244
    
    However the second else (neither masqueradeAll nor clusterCIDR are set) cannot be used because, before this PR, the initial test `if !proxier.ipsetList[kubeClusterIPSet].isEmpty()` can never return true when masqueradeAll and clusterCIDR are not set because kubeClusterIPSet is empty.
    
    **Which issue(s) this PR fixes** 
    Fixes #65158
    
    ```release-note
    Allow access to ClusterIP from the host network namespace when kube-proxy is started in IPVS mode without either masqueradeAll or clusterCIDR flags
    ```
    
    **Additional comment**
    Issue #65158 is closed because ClusterIP access from the host has already fixed in master, except for the case described here (no masquerade flag). More detail in the issue.
    966c77c8
Name
Last commit
Last update
..
apis/kubeproxyconfig Loading commit data...
config Loading commit data...
healthcheck Loading commit data...
iptables Loading commit data...
ipvs Loading commit data...
metrics Loading commit data...
userspace Loading commit data...
util Loading commit data...
winkernel Loading commit data...
winuserspace Loading commit data...
BUILD Loading commit data...
OWNERS Loading commit data...
doc.go Loading commit data...
endpoints.go Loading commit data...
endpoints_test.go Loading commit data...
service.go Loading commit data...
service_test.go Loading commit data...
types.go Loading commit data...