File tree Expand file tree Collapse file tree 7 files changed +30
-0
lines changed
charts/nginx-gateway-fabric
internal/mode/static/provisioner Expand file tree Collapse file tree 7 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -517,6 +517,12 @@ type ServiceSpec struct {
517
517
// +optional
518
518
LoadBalancerIP * string `json:"loadBalancerIP,omitempty"`
519
519
520
+ // LoadBalancerClass is the class of the load balancer implementation this Service belongs to.
521
+ // Requires service type to be LoadBalancer.
522
+ //
523
+ // +optional
524
+ LoadBalancerClass * string `json:"loadBalancerClass,omitempty"`
525
+
520
526
// Annotations contain any Service-specific annotations.
521
527
//
522
528
// +optional
Original file line number Diff line number Diff line change @@ -427,6 +427,10 @@ nginx:
427
427
# -- The static IP address for the load balancer. Requires nginx.service.type set to LoadBalancer.
428
428
# loadBalancerIP: ""
429
429
430
+ # -- LoadBalancerClass is the class of the load balancer implementation this Service belongs to.
431
+ # Requires nginx.service.type set to LoadBalancer.
432
+ # loadBalancerClass: ""
433
+
430
434
# -- The IP ranges (CIDR) that are allowed to access the load balancer. Requires nginx.service.type set to LoadBalancer.
431
435
# loadBalancerSourceRanges: []
432
436
Original file line number Diff line number Diff line change @@ -3482,6 +3482,11 @@ spec:
3482
3482
- Cluster
3483
3483
- Local
3484
3484
type : string
3485
+ loadBalancerClass :
3486
+ description : |-
3487
+ LoadBalancerClass is the class of the load balancer implementation this Service belongs to.
3488
+ Requires service type to be LoadBalancer.
3489
+ type : string
3485
3490
loadBalancerIP :
3486
3491
description : LoadBalancerIP is a static IP address for the
3487
3492
load balancer. Requires service type to be LoadBalancer.
Original file line number Diff line number Diff line change @@ -4067,6 +4067,11 @@ spec:
4067
4067
- Cluster
4068
4068
- Local
4069
4069
type : string
4070
+ loadBalancerClass :
4071
+ description : |-
4072
+ LoadBalancerClass is the class of the load balancer implementation this Service belongs to.
4073
+ Requires service type to be LoadBalancer.
4074
+ type : string
4070
4075
loadBalancerIP :
4071
4076
description : LoadBalancerIP is a static IP address for the
4072
4077
load balancer. Requires service type to be LoadBalancer.
Original file line number Diff line number Diff line change @@ -460,6 +460,9 @@ func buildNginxService(
460
460
if serviceCfg .LoadBalancerIP != nil {
461
461
svc .Spec .LoadBalancerIP = * serviceCfg .LoadBalancerIP
462
462
}
463
+ if serviceCfg .LoadBalancerClass != nil {
464
+ svc .Spec .LoadBalancerClass = serviceCfg .LoadBalancerClass
465
+ }
463
466
if serviceCfg .LoadBalancerSourceRanges != nil {
464
467
svc .Spec .LoadBalancerSourceRanges = serviceCfg .LoadBalancerSourceRanges
465
468
}
Original file line number Diff line number Diff line change @@ -253,6 +253,7 @@ func TestBuildNginxResourceObjects_NginxProxyConfig(t *testing.T) {
253
253
ServiceType : helpers .GetPointer (ngfAPIv1alpha2 .ServiceTypeNodePort ),
254
254
ExternalTrafficPolicy : helpers .GetPointer (ngfAPIv1alpha2 .ExternalTrafficPolicyCluster ),
255
255
LoadBalancerIP : helpers .GetPointer ("1.2.3.4" ),
256
+ LoadBalancerClass : helpers .GetPointer ("myLoadBalancerClass" ),
256
257
LoadBalancerSourceRanges : []string {"5.6.7.8" },
257
258
},
258
259
Deployment : & ngfAPIv1alpha2.DeploymentSpec {
@@ -299,6 +300,7 @@ func TestBuildNginxResourceObjects_NginxProxyConfig(t *testing.T) {
299
300
g .Expect (svc .Spec .Type ).To (Equal (corev1 .ServiceTypeNodePort ))
300
301
g .Expect (svc .Spec .ExternalTrafficPolicy ).To (Equal (corev1 .ServiceExternalTrafficPolicyTypeCluster ))
301
302
g .Expect (svc .Spec .LoadBalancerIP ).To (Equal ("1.2.3.4" ))
303
+ g .Expect (* svc .Spec .LoadBalancerClass ).To (Equal ("myLoadBalancerClass" ))
302
304
g .Expect (svc .Spec .LoadBalancerSourceRanges ).To (Equal ([]string {"5.6.7.8" }))
303
305
304
306
depObj := objects [5 ]
You can’t perform that action at this time.
0 commit comments