• 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
..
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...