@@ -51,6 +51,19 @@ custom manner. For more information on the existing `IngressIPs` feature:
51
51
52
52
### Goals
53
53
54
+ Some more context is helpful before specifying the goals of this enhancement.
55
+ When a Service has an external IP address, the OpenShift network plugin in use
56
+ must already prepare networking on Nodes to be able to receive traffic with
57
+ that IP address as a destination. The network plugin does not know or care
58
+ about how that traffic reaches the Node because the mechanism differs depending
59
+ on which platform the cluster is running on. Once that traffic reaches a Node,
60
+ the existing Service proxy functionality handles forwarding that traffic to a
61
+ Service backend, including some degree of load balancing.
62
+
63
+ With this context in mind, the goal of this enhancement is less about load
64
+ balancing itself, and more about providing mechanisms of routing traffic to
65
+ Nodes for external IP addresses used for Service Load Balancers.
66
+
54
67
A SLB solution must provide these high level features:
55
68
56
69
* Management of one or more pools of IP addresses to be allocated for SLBs
@@ -63,8 +76,11 @@ A SLB solution must provide these high level features:
63
76
(likely BGP), but should also be usable in smaller, simpler environments
64
77
using L2 protocols. Tradeoffs include:
65
78
* Layer 2 (gratuitous ARP for IPv4, NDP for IPv6) - good for wide range of
66
- environment compatibility, but limiting for larger clusters
79
+ environment compatibility, but limiting for larger clusters. All traffic
80
+ for a single Service Load Balancer IP address must go through one node.
67
81
* Layer 3 (BGP) - good for integration with networks for larger clusters
82
+ and opens up the possibility for a greater degree of load balancing using
83
+ ECMP to send traffic to multiple Nodes for a single Service Load Balancer
68
84
* Suitable for large scale clusters (target up to 2000 nodes).
69
85
* Must be compatible with at least the following cluster network types:
70
86
[ OpenShift-SDN] ( https://github.com/openshift/sdn ) and
@@ -103,6 +119,39 @@ also consider a MetalLB enhancement that makes it understand different L2
103
119
domains and manage different IP address pools for each domain where SLBs may
104
120
reside.
105
121
122
+ ### How Load Balancing Works with MetalLB
123
+
124
+ As mentioned in the Goals section, MetalLB does not have to implement load
125
+ balancing itself. It only implements ensuring load balancer IP addresses are
126
+ reachable on appropriate Nodes. The way a cluster uses MetalLB does have an
127
+ impact on how load balancing works, though.
128
+
129
+ When the Layer 2 mode is in use, all traffic for a single external IP address
130
+ must go through a single Node in the cluster. MetalLB is responsible for
131
+ choosing which Node this should be. From that Node, the Service proxy will
132
+ distribute load across the Endpoints for that Service. This provides a degree
133
+ of load balancing, as long as the Service traffic does not exceed what can go
134
+ through a single Node.
135
+
136
+ The BGP mode of MetalLB offers some improved capabilities. It is possible for
137
+ the router(s) for the cluster to send traffic for a single external IP address
138
+ to multiple Nodes. This removes the single Node bottleneck. The number of
139
+ Nodes which can be used as targets for the traffic depends on the configuration
140
+ of a given Service. There is a field on Services called
141
+ [ ` externalTrafficPolicy ` that can be ` cluster ` or
142
+ ` local ` ] ( https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip ) .
143
+
144
+ * ` local ` -- In this mode, the pod expects to receive traffic with the original
145
+ source IP address still intact. To achieve this, the traffic must go directly
146
+ to a Node where one of the Endpoints for that Service is running. Only those
147
+ Nodes advertise the Service IP in this case.
148
+
149
+ * ` cluster ` -- In this mode, traffic may arrive on any Node and will be
150
+ redirected to another Node if necessary to reach a Service Endpoint. The
151
+ source IP address will be changed to the Node's IP to ensure traffic returns
152
+ via the same path it arrived on. The Service IP is advertised for all Nodes
153
+ for these Services.
154
+
106
155
### User Stories
107
156
108
157
#### Match Cloud Load Balancer Functionality Where Possible
0 commit comments