Assignment of egress IPs to a namespace, nodes, and pods
To assign one or more egress IPs to a namespace or specific pods in a namespace, you must meet specific conditions.
-
At least one node in your cluster must have the
k8s.ovn.org/egress-assignable: ""label. -
An
EgressIPobject exists that defines one or more egress IP addresses to use as the source IP address for traffic leaving the cluster from pods in a namespace.
|
|
If you create To ensure that egress IP addresses are widely distributed across nodes in the cluster, always apply the label to the nodes you intend to host the egress IP addresses before creating any |
When creating an EgressIP object, the following conditions apply to nodes that are labeled with the k8s.ovn.org/egress-assignable: "" label:
-
An egress IP address is never assigned to more than one node at a time.
-
An egress IP address is equally balanced between available nodes that can host the egress IP address.
-
If the
spec.EgressIPsarray in anEgressIPobject specifies more than one IP address, the following conditions apply:-
No node will ever host more than one of the specified IP addresses.
-
Traffic is balanced roughly equally between the specified IP addresses for a given namespace.
-
-
If a node becomes unavailable, any egress IP addresses assigned to it are automatically reassigned, subject to the previously described conditions.
|
|
If the number of nodes labeled with |
When a pod matches the selector for multiple EgressIP objects, there is no guarantee which of the egress IP addresses that are specified in the EgressIP objects is assigned as the egress IP address for the pod.
Additionally, if an EgressIP object specifies multiple egress IP addresses, there is no guarantee which of the egress IP addresses might be used. For example, if a pod matches a selector for an EgressIP object with two egress IP addresses, 10.10.20.1 and 10.10.20.2, either might be used for each TCP connection or UDP conversation.