Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Service loadBalancerSourceRanges in AntreaProxy #6181

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Oct 8, 2024

  1. Support Service loadBalancerSourceRanges in AntreaProxy

    For antrea-io#5493
    
    This commit introduces support for loadBalancerSourceRanges for LoadBalancer
    Services.
    
    Here is an example of a LoadBalancer Service configuration allowing access
    from specific CIDRs:
    
    ```yaml
    apiVersion: v1
    kind: Service
    metadata:
      name: sample-loadbalancer-source-ranges
    spec:
      selector:
        app: web
      ports:
        - protocol: TCP
          port: 80
          targetPort: 80
      type: LoadBalancer
      loadBalancerSourceRanges:
        - "192.168.77.0/24"
        - "192.168.78.0/24"
    status:
      loadBalancer:
        ingress:
          - ip: 192.168.77.150
    ```
    
    [New] Here are the corresponding flows:
    
    ```text
    1. table=ServiceMark, priority=200,tcp,nw_src=192.168.77.0/24,nw_dst=192.168.77.150,tp_dst=80 actions=set_field:0x20000000/0x60000000->reg4",
    2. table=ServiceMark, priority=200,tcp,nw_src=192.168.78.0/24,nw_dst=192.168.77.150,tp_dst=80 actions=set_field:0x20000000/0x60000000->reg4",
    3. table=ServiceMark, priority=190,tcp,nw_dst=192.168.77.150,tp_dst=80 actions=set_field:0x40000000/0x60000000->reg4",
    4. table=ServiceLB, priority=200,tcp,reg4=0x0x20010000/0x0x60070000,nw_dst=192.168.77.150,tp_dst=80 actions=set_field:0x200/0x200->reg0,set_field:0x20000/0x70000->reg4,set_field:0xe->reg7,group:14
    5. table=ServiceLB, priority=190,reg4=0x40000000/0x60000000 actions=drop
    ```
    
    - Flow 1 is to match packets from allowed CIDR `192.168.77.0/24`, marking them with
      `LoadBalancerSourceRangesAllowRegMark`.
    - Flow 2 is similar to flow 1 but for CIDR `192.168.78.0/24`.
    - Flow 3 is to match packets not from allowed CIDRs, marking with
      `LoadBalancerSourceRangesDropRegMark`.
    - Flow 4 is to match allowed packets with `LoadBalancerSourceRangesAllowRegMark` and
      perform load balancing.
    - Flow 5 is to match not allowed packets with `LoadBalancerSourceRangesDropRegMark` and
      drop.
    
    Signed-off-by: Hongliang Liu <hongliang.liu@broadcom.com>
    hongliangl committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    695df4b View commit details
    Browse the repository at this point in the history