Skip to content

Commit 8e172b4

Browse files
timeberttske-prow[bot]
authored andcommitted
Support setting loadBalancerClass in Seed and ExposureClass (gardener#13305)
1 parent 38e29cb commit 8e172b4

File tree

29 files changed

+1255
-927
lines changed

29 files changed

+1255
-927
lines changed

docs/api-reference/core.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11421,6 +11421,19 @@ SeedSettingLoadBalancerServicesZonalIngress
1142111421
Defaults to true.</p>
1142211422
</td>
1142311423
</tr>
11424+
<tr>
11425+
<td>
11426+
<code>class</code></br>
11427+
<em>
11428+
string
11429+
</em>
11430+
</td>
11431+
<td>
11432+
<em>(Optional)</em>
11433+
<p>Class configures the Service.spec.loadBalancerClass field for the load balancer services on the seed.
11434+
Note that changing the loadBalancerClass of existing LoadBalancer services is denied by Kubernetes.</p>
11435+
</td>
11436+
</tr>
1142411437
</tbody>
1142511438
</table>
1142611439
<h3 id="core.gardener.cloud/v1beta1.SeedSettingLoadBalancerServicesZonalIngress">SeedSettingLoadBalancerServicesZonalIngress

docs/operations/seed_settings.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@ In most cases, the cloud-controller-manager (responsible for managing these load
7272

7373
By setting the `.spec.settings.loadBalancerServices.annotations` field the Gardener administrator can specify a list of annotations, which will be injected into the `Service`s of type `LoadBalancer`.
7474

75+
### Load Balancer Class
76+
77+
By default, Gardener creates `Services` without the `spec.loadBalancerClass` field set, meaning that the default load balancer implementation of the underlying cloud infrastructure is used (implemented by the `Service` controller of cloud-controller-manager).
78+
If a non-default load balancer implementation should be used for load balancer services in the seed cluster, the `spec.settings.loadBalancerServices.loadBalancerClass` field can be configured accordingly to set the `spec.loadBalancerClass` on the created `Service` objects.
79+
Note that changing the `loadBalancerClass` of existing load balancer services is denied by Kubernetes, i.e., this setting can only be applied automatically to newly created load balancer services.
80+
If an existing load balancer service should use a different load balancer class, the migration needs to be performed manually by the operator.
81+
7582
### External Traffic Policy
7683

7784
Setting the [external traffic policy](https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip) to `Local` can be beneficial as it

docs/usage/networking/exposureclasses.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ exposureClassHandlers:
128128
loadbalancer/network: internet
129129
- name: internal-config
130130
loadBalancerService:
131+
class: internal-loadbalancer
131132
annotations:
132133
loadbalancer/network: internal
133134
sni:
@@ -146,6 +147,11 @@ The load balancer service needs to be configured in a way that it is reachable f
146147
Therefore, the configuration of load balancer service need to be specified, which can be done via the `.loadBalancerService` section.
147148
The common way to influence load balancer service behaviour is via annotations where the respective cloud-controller-manager will react on and configure the infrastructure load balancer accordingly.
148149

150+
To select a non-default load balancer implementation, the `class` field can be set to configure the `spec.loadBalancerClass` on the created `Service` objects.
151+
If the `class` field is unset, `spec.loadBalancerClass` is not configured and the default load balancer implementation of the underlying cloud infrastructure is used (implemented by the `Service` controller of cloud-controller-manager).
152+
Note that changing the `loadBalancerClass` of existing load balancer services is denied by Kubernetes, i.e., this setting can only be applied automatically to newly created load balancer services.
153+
If an existing load balancer service should use a different load balancer class, the migration needs to be performed manually by the operator.
154+
149155
The control planes on a `Seed` will be exposed via a central load balancer and with Envoy via TLS SNI passthrough proxy.
150156
In this case, the gardenlet will install a dedicated ingress gateway (Envoy + load balancer + respective configuration) for each handler on the `Seed`.
151157
The configuration of the ingress gateways can be controlled via the `.sni` section in the same way like for the default ingress gateways.

example/50-seed.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ spec:
9393
# loadBalancerServices:
9494
# annotations:
9595
# foo: bar
96+
# class: non-default-load-balancer-class
9697
# externalTrafficPolicy: Local
9798
# proxyProtocol:
9899
# allowed: true

pkg/apis/core/types_seed.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,9 @@ type SeedSettingLoadBalancerServices struct {
267267
// ZonalIngress controls whether ingress gateways are deployed per availability zone.
268268
// Defaults to true.
269269
ZonalIngress *SeedSettingLoadBalancerServicesZonalIngress
270+
// Class configures the Service.spec.loadBalancerClass field for the load balancer services on the seed.
271+
// Note that changing the loadBalancerClass of existing LoadBalancer services is denied by Kubernetes.
272+
Class *string
270273
}
271274

272275
// SeedSettingLoadBalancerServicesZones controls settings, which are specific to the single-zone load balancers in a

0 commit comments

Comments
 (0)