-
Notifications
You must be signed in to change notification settings - Fork 376
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
Egress HA assigns different egress ips to same egress interface on same egress node #6836
Comments
There is already a concept of maxEgressIPs per node, so if the egressIPs per node is less that threshold we can still assign more IPs to the egress interface on that node without having any traffic disruptions. And selecting a node for egress is a random process and it can select any node if that node has not reach the threshold for max number of EgressIPs, and I think that this behaviour is correct also because we cannot restrict a node to have only one EgressIP. cc: @antoninbas @tnqn |
@rajnkamr EgressIP allocation is "random" (or more accurately, hash-based using a consistent hash map) among all eligible Nodes:
Looks like you just got "unlucky" and that both IP addresses got allocated to the same Node. But if you only have 2 Nodes and 2 Egress IPs, then the probability of this allocation is 0.5 The expectation is that with a large number of EgressIPs, they will be evenly distributed over all Nodes. Maybe you can try with 10+ Egress resources instead? |
List of 7 egresses are created, the pods are scheduled on bgp-worker and bgp-worker2
Egress ip is getting assigned randomly, could it be preferred to assign the egress ip on same node where pod is running( default case) ?
|
This was considered. However, it might appear "optimized" for a specific Pod at a particular moment, it does not provide obvious benefits from the perspective of the entire cluster or over an extended period. Pod distribution is random and can change over time. The best distribution at one moment may be the worst at another moment and we can't just migrate the IPs to get the best distribution, which could break all established connections. |
Describe the bug
Egress HA assigns different egress ips to same egress interface on same egress node. It should be avoided unless nodeselector is provided as same egress node.
NAME EGRESSIP AGE NODE
egress-prod-web 172.18.0.11 19h bgp-worker2
egress-staging-web 172.18.0.12 19h bgp-worker2
Egress Interface
14: antrea-egress0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN group default link/ether e2:12:06:f2:dc:2f brd ff:ff:ff:ff:ff:ff inet 172.18.0.11/32 scope global antrea-egress0 valid_lft forever preferred_lft forever
inet 172.18.0.12/32 scope global antrea-egress0 valid_lft forever preferred_lft forever
To Reproduce
Apply below config
1.externalippool.yaml
2.egress1.yaml
3.egress2.yaml
Expected
Unless nodeselector is a single egress node, the expectation should be to assign egress ip to different interfaces on different nodes to avoid external traffic disruption for all egress workloads !
Actual behavior
Versions:
Additional context
The text was updated successfully, but these errors were encountered: