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 {
517517 // +optional
518518 LoadBalancerIP * string `json:"loadBalancerIP,omitempty"`
519519
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+
520526 // Annotations contain any Service-specific annotations.
521527 //
522528 // +optional
Original file line number Diff line number Diff line change @@ -427,6 +427,10 @@ nginx:
427427 # -- The static IP address for the load balancer. Requires nginx.service.type set to LoadBalancer.
428428 # loadBalancerIP: ""
429429
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+
430434 # -- The IP ranges (CIDR) that are allowed to access the load balancer. Requires nginx.service.type set to LoadBalancer.
431435 # loadBalancerSourceRanges: []
432436
Original file line number Diff line number Diff line change @@ -3482,6 +3482,11 @@ spec:
34823482 - Cluster
34833483 - Local
34843484 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
34853490 loadBalancerIP :
34863491 description : LoadBalancerIP is a static IP address for the
34873492 load balancer. Requires service type to be LoadBalancer.
Original file line number Diff line number Diff line change @@ -4067,6 +4067,11 @@ spec:
40674067 - Cluster
40684068 - Local
40694069 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
40704075 loadBalancerIP :
40714076 description : LoadBalancerIP is a static IP address for the
40724077 load balancer. Requires service type to be LoadBalancer.
Original file line number Diff line number Diff line change @@ -460,6 +460,9 @@ func buildNginxService(
460460 if serviceCfg .LoadBalancerIP != nil {
461461 svc .Spec .LoadBalancerIP = * serviceCfg .LoadBalancerIP
462462 }
463+ if serviceCfg .LoadBalancerClass != nil {
464+ svc .Spec .LoadBalancerClass = serviceCfg .LoadBalancerClass
465+ }
463466 if serviceCfg .LoadBalancerSourceRanges != nil {
464467 svc .Spec .LoadBalancerSourceRanges = serviceCfg .LoadBalancerSourceRanges
465468 }
Original file line number Diff line number Diff line change @@ -253,6 +253,7 @@ func TestBuildNginxResourceObjects_NginxProxyConfig(t *testing.T) {
253253 ServiceType : helpers .GetPointer (ngfAPIv1alpha2 .ServiceTypeNodePort ),
254254 ExternalTrafficPolicy : helpers .GetPointer (ngfAPIv1alpha2 .ExternalTrafficPolicyCluster ),
255255 LoadBalancerIP : helpers .GetPointer ("1.2.3.4" ),
256+ LoadBalancerClass : helpers .GetPointer ("myLoadBalancerClass" ),
256257 LoadBalancerSourceRanges : []string {"5.6.7.8" },
257258 },
258259 Deployment : & ngfAPIv1alpha2.DeploymentSpec {
@@ -299,6 +300,7 @@ func TestBuildNginxResourceObjects_NginxProxyConfig(t *testing.T) {
299300 g .Expect (svc .Spec .Type ).To (Equal (corev1 .ServiceTypeNodePort ))
300301 g .Expect (svc .Spec .ExternalTrafficPolicy ).To (Equal (corev1 .ServiceExternalTrafficPolicyTypeCluster ))
301302 g .Expect (svc .Spec .LoadBalancerIP ).To (Equal ("1.2.3.4" ))
303+ g .Expect (* svc .Spec .LoadBalancerClass ).To (Equal ("myLoadBalancerClass" ))
302304 g .Expect (svc .Spec .LoadBalancerSourceRanges ).To (Equal ([]string {"5.6.7.8" }))
303305
304306 depObj := objects [5 ]
You can’t perform that action at this time.
0 commit comments