Skip to content

Commit

Permalink
Update Egress API to support multiple Egress IPs and pools (#4603)
Browse files Browse the repository at this point in the history
Nodes in a cluster could reside in multiple subnets, but the egress IP
needs to be routable in the underlay network and usually resides in the
same subnet of the Node hosting it. Therefore, there may be a situation
where no available nodes are eligible to host an egress IP address if
all Nodes in a subnet are down, interrupting egress traffic of the
workloads that use the IP.

As the first step of supporting the above scenario, the patch extends
the Egress IP to support multiple Egress IPs and pools so that one
Egress IP can be configured for each subnet, making Egress failover
across the whole cluster possible.

Besides, it also adds a field, `status.egressIP`, to represent the
effective Egress IP. When there is no eligible Node for any of the
Egress IPs, the field will be empty.

Signed-off-by: Quan Tian <qtian@vmware.com>
  • Loading branch information
tnqn authored May 4, 2023
1 parent e40aacb commit e635aef
Show file tree
Hide file tree
Showing 13 changed files with 309 additions and 75 deletions.
34 changes: 27 additions & 7 deletions build/charts/antrea/crds/egress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,17 @@ spec:
type: object
required:
- appliedTo
anyOf:
- required:
- egressIP
- required:
- externalIPPool
oneOf:
- anyOf:
- required:
- egressIP
- required:
- externalIPPool
- anyOf:
- required:
- egressIPs
- required:
- externalIPPools
properties:
appliedTo:
type: object
Expand Down Expand Up @@ -82,16 +88,30 @@ spec:
oneOf:
- format: ipv4
- format: ipv6
egressIPs:
type: array
items:
type: string
oneOf:
- maxLength: 0
- format: ipv4
- format: ipv6
externalIPPool:
type: string
externalIPPools:
type: array
items:
type: string
status:
type: object
properties:
egressNode:
type: string
egressIP:
type: string
additionalPrinterColumns:
- description: Specifies the SNAT IP address for the selected workloads.
jsonPath: .spec.egressIP
- description: The effective SNAT IP address for the selected workloads.
jsonPath: .status.egressIP
name: EgressIP
type: string
- jsonPath: .metadata.creationTimestamp
Expand Down
34 changes: 27 additions & 7 deletions build/yamls/antrea-aks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1083,11 +1083,17 @@ spec:
type: object
required:
- appliedTo
anyOf:
- required:
- egressIP
- required:
- externalIPPool
oneOf:
- anyOf:
- required:
- egressIP
- required:
- externalIPPool
- anyOf:
- required:
- egressIPs
- required:
- externalIPPools
properties:
appliedTo:
type: object
Expand Down Expand Up @@ -1145,16 +1151,30 @@ spec:
oneOf:
- format: ipv4
- format: ipv6
egressIPs:
type: array
items:
type: string
oneOf:
- maxLength: 0
- format: ipv4
- format: ipv6
externalIPPool:
type: string
externalIPPools:
type: array
items:
type: string
status:
type: object
properties:
egressNode:
type: string
egressIP:
type: string
additionalPrinterColumns:
- description: Specifies the SNAT IP address for the selected workloads.
jsonPath: .spec.egressIP
- description: The effective SNAT IP address for the selected workloads.
jsonPath: .status.egressIP
name: EgressIP
type: string
- jsonPath: .metadata.creationTimestamp
Expand Down
34 changes: 27 additions & 7 deletions build/yamls/antrea-crds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1074,11 +1074,17 @@ spec:
type: object
required:
- appliedTo
anyOf:
- required:
- egressIP
- required:
- externalIPPool
oneOf:
- anyOf:
- required:
- egressIP
- required:
- externalIPPool
- anyOf:
- required:
- egressIPs
- required:
- externalIPPools
properties:
appliedTo:
type: object
Expand Down Expand Up @@ -1136,16 +1142,30 @@ spec:
oneOf:
- format: ipv4
- format: ipv6
egressIPs:
type: array
items:
type: string
oneOf:
- maxLength: 0
- format: ipv4
- format: ipv6
externalIPPool:
type: string
externalIPPools:
type: array
items:
type: string
status:
type: object
properties:
egressNode:
type: string
egressIP:
type: string
additionalPrinterColumns:
- description: Specifies the SNAT IP address for the selected workloads.
jsonPath: .spec.egressIP
- description: The effective SNAT IP address for the selected workloads.
jsonPath: .status.egressIP
name: EgressIP
type: string
- jsonPath: .metadata.creationTimestamp
Expand Down
34 changes: 27 additions & 7 deletions build/yamls/antrea-eks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1083,11 +1083,17 @@ spec:
type: object
required:
- appliedTo
anyOf:
- required:
- egressIP
- required:
- externalIPPool
oneOf:
- anyOf:
- required:
- egressIP
- required:
- externalIPPool
- anyOf:
- required:
- egressIPs
- required:
- externalIPPools
properties:
appliedTo:
type: object
Expand Down Expand Up @@ -1145,16 +1151,30 @@ spec:
oneOf:
- format: ipv4
- format: ipv6
egressIPs:
type: array
items:
type: string
oneOf:
- maxLength: 0
- format: ipv4
- format: ipv6
externalIPPool:
type: string
externalIPPools:
type: array
items:
type: string
status:
type: object
properties:
egressNode:
type: string
egressIP:
type: string
additionalPrinterColumns:
- description: Specifies the SNAT IP address for the selected workloads.
jsonPath: .spec.egressIP
- description: The effective SNAT IP address for the selected workloads.
jsonPath: .status.egressIP
name: EgressIP
type: string
- jsonPath: .metadata.creationTimestamp
Expand Down
34 changes: 27 additions & 7 deletions build/yamls/antrea-gke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1083,11 +1083,17 @@ spec:
type: object
required:
- appliedTo
anyOf:
- required:
- egressIP
- required:
- externalIPPool
oneOf:
- anyOf:
- required:
- egressIP
- required:
- externalIPPool
- anyOf:
- required:
- egressIPs
- required:
- externalIPPools
properties:
appliedTo:
type: object
Expand Down Expand Up @@ -1145,16 +1151,30 @@ spec:
oneOf:
- format: ipv4
- format: ipv6
egressIPs:
type: array
items:
type: string
oneOf:
- maxLength: 0
- format: ipv4
- format: ipv6
externalIPPool:
type: string
externalIPPools:
type: array
items:
type: string
status:
type: object
properties:
egressNode:
type: string
egressIP:
type: string
additionalPrinterColumns:
- description: Specifies the SNAT IP address for the selected workloads.
jsonPath: .spec.egressIP
- description: The effective SNAT IP address for the selected workloads.
jsonPath: .status.egressIP
name: EgressIP
type: string
- jsonPath: .metadata.creationTimestamp
Expand Down
34 changes: 27 additions & 7 deletions build/yamls/antrea-ipsec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1083,11 +1083,17 @@ spec:
type: object
required:
- appliedTo
anyOf:
- required:
- egressIP
- required:
- externalIPPool
oneOf:
- anyOf:
- required:
- egressIP
- required:
- externalIPPool
- anyOf:
- required:
- egressIPs
- required:
- externalIPPools
properties:
appliedTo:
type: object
Expand Down Expand Up @@ -1145,16 +1151,30 @@ spec:
oneOf:
- format: ipv4
- format: ipv6
egressIPs:
type: array
items:
type: string
oneOf:
- maxLength: 0
- format: ipv4
- format: ipv6
externalIPPool:
type: string
externalIPPools:
type: array
items:
type: string
status:
type: object
properties:
egressNode:
type: string
egressIP:
type: string
additionalPrinterColumns:
- description: Specifies the SNAT IP address for the selected workloads.
jsonPath: .spec.egressIP
- description: The effective SNAT IP address for the selected workloads.
jsonPath: .status.egressIP
name: EgressIP
type: string
- jsonPath: .metadata.creationTimestamp
Expand Down
34 changes: 27 additions & 7 deletions build/yamls/antrea.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1083,11 +1083,17 @@ spec:
type: object
required:
- appliedTo
anyOf:
- required:
- egressIP
- required:
- externalIPPool
oneOf:
- anyOf:
- required:
- egressIP
- required:
- externalIPPool
- anyOf:
- required:
- egressIPs
- required:
- externalIPPools
properties:
appliedTo:
type: object
Expand Down Expand Up @@ -1145,16 +1151,30 @@ spec:
oneOf:
- format: ipv4
- format: ipv6
egressIPs:
type: array
items:
type: string
oneOf:
- maxLength: 0
- format: ipv4
- format: ipv6
externalIPPool:
type: string
externalIPPools:
type: array
items:
type: string
status:
type: object
properties:
egressNode:
type: string
egressIP:
type: string
additionalPrinterColumns:
- description: Specifies the SNAT IP address for the selected workloads.
jsonPath: .spec.egressIP
- description: The effective SNAT IP address for the selected workloads.
jsonPath: .status.egressIP
name: EgressIP
type: string
- jsonPath: .metadata.creationTimestamp
Expand Down
Loading

0 comments on commit e635aef

Please sign in to comment.