• Kubernetes Submit Queue's avatar
    Merge pull request #62718 from Lion-Wei/ipvs-host · 191d3c56
    Kubernetes Submit Queue authored
    Automatic merge from submit-queue. 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>.
    
    Fix problem that ipvs can't work with hostPort
    
    **What this PR does / why we need it**:
    Make ipvs proxy mode can work with pods that have hostPort.
    
    **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
    Fixes #61938
    #60688 and #60305 are related too.
    
    **Special notes for your reviewer**:
    IPVS proxier will create dummy device named `kube-ipvs0`, which will maintain all ipvs virtual service address. That means all ipvs maintained clusterIP/externalIP/ingress will be treat as local address.
    
    Then if we have a pod with hostPort, cni will attach this rule to `PREROUTING` chain:
    ```
    KUBE-HOSTPORTS  all  --  0.0.0.0/0            0.0.0.0/0            /* kube hostport portals */ ADDRTYPE match dst-type LOCAL
    ```
    so if a service have same port with pod's hostport, then this service can't be access.
    
    In this pr, we added `ACCESS` rule for traffic that aim to ipvs virtual service, to prevent those traffic from be blocked by other rules.
    
    **Release note**:
    ```release-note
    NONE
    ```
    191d3c56
Name
Last commit
Last update
..
testing Loading commit data...
BUILD Loading commit data...
OWNERS Loading commit data...
README.md Loading commit data...
ipset.go Loading commit data...
ipset_test.go Loading commit data...
netlink.go Loading commit data...
netlink_linux.go Loading commit data...
netlink_unsupported.go Loading commit data...
proxier.go Loading commit data...
proxier_test.go Loading commit data...