@@ -963,11 +963,32 @@ func servicePortToFrontend(service *v1.Service, loadbalancer *scwlb.LB, port v1.
963963 return nil , fmt .Errorf ("error getting certificate IDs for loadbalancer %s: %v" , loadbalancer .ID , err )
964964 }
965965
966+ connectionRateLimit , err := getConnectionRateLimit (service )
967+ if err != nil {
968+ return nil , fmt .Errorf ("error getting %s annotation for loadbalancer %s: %v" ,
969+ serviceAnnotationLoadBalancerConnectionRateLimit , loadbalancer .ID , err )
970+ }
971+
972+ enableAccessLogs , err := getEnableAccessLogs (service )
973+ if err != nil {
974+ return nil , fmt .Errorf ("error getting %s annotation for loadbalancer %s: %v" ,
975+ serviceAnnotationLoadBalancerEnableAccessLogs , loadbalancer .ID , err )
976+ }
977+
978+ enableHTTP3 , err := getEnableHTTP3 (service )
979+ if err != nil {
980+ return nil , fmt .Errorf ("error getting %s annotation for loadbalancer %s: %v" ,
981+ serviceAnnotationLoadBalancerEnableHTTP3 , loadbalancer .ID , err )
982+ }
983+
966984 return & scwlb.Frontend {
967- Name : fmt .Sprintf ("%s_tcp_%d" , string (service .UID ), port .Port ),
968- InboundPort : port .Port ,
969- TimeoutClient : & timeoutClient ,
970- CertificateIDs : certificateIDs ,
985+ Name : fmt .Sprintf ("%s_tcp_%d" , string (service .UID ), port .Port ),
986+ InboundPort : port .Port ,
987+ TimeoutClient : & timeoutClient ,
988+ ConnectionRateLimit : connectionRateLimit ,
989+ CertificateIDs : certificateIDs ,
990+ EnableAccessLogs : enableAccessLogs ,
991+ EnableHTTP3 : enableHTTP3 ,
971992 }, nil
972993}
973994
@@ -1547,14 +1568,16 @@ func (l *loadbalancers) updateBackend(service *v1.Service, loadbalancer *scwlb.L
15471568// createFrontend creates a frontend on the load balancer
15481569func (l * loadbalancers ) createFrontend (service * v1.Service , loadbalancer * scwlb.LB , frontend * scwlb.Frontend , backend * scwlb.Backend ) (* scwlb.Frontend , error ) {
15491570 f , err := l .api .CreateFrontend (& scwlb.ZonedAPICreateFrontendRequest {
1550- Zone : loadbalancer .Zone ,
1551- LBID : loadbalancer .ID ,
1552- Name : frontend .Name ,
1553- InboundPort : frontend .InboundPort ,
1554- BackendID : backend .ID ,
1555- TimeoutClient : frontend .TimeoutClient ,
1556- CertificateIDs : & frontend .CertificateIDs ,
1557- EnableHTTP3 : frontend .EnableHTTP3 ,
1571+ Zone : loadbalancer .Zone ,
1572+ LBID : loadbalancer .ID ,
1573+ Name : frontend .Name ,
1574+ InboundPort : frontend .InboundPort ,
1575+ BackendID : backend .ID ,
1576+ TimeoutClient : frontend .TimeoutClient ,
1577+ CertificateIDs : & frontend .CertificateIDs ,
1578+ ConnectionRateLimit : frontend .ConnectionRateLimit ,
1579+ EnableAccessLogs : frontend .EnableAccessLogs ,
1580+ EnableHTTP3 : frontend .EnableHTTP3 ,
15581581 })
15591582
15601583 return f , err
@@ -1563,14 +1586,16 @@ func (l *loadbalancers) createFrontend(service *v1.Service, loadbalancer *scwlb.
15631586// updateFrontend updates a frontend on the load balancer
15641587func (l * loadbalancers ) updateFrontend (service * v1.Service , loadbalancer * scwlb.LB , frontend * scwlb.Frontend , backend * scwlb.Backend ) (* scwlb.Frontend , error ) {
15651588 f , err := l .api .UpdateFrontend (& scwlb.ZonedAPIUpdateFrontendRequest {
1566- Zone : loadbalancer .Zone ,
1567- FrontendID : frontend .ID ,
1568- Name : frontend .Name ,
1569- InboundPort : frontend .InboundPort ,
1570- BackendID : backend .ID ,
1571- TimeoutClient : frontend .TimeoutClient ,
1572- CertificateIDs : & frontend .CertificateIDs ,
1573- EnableHTTP3 : frontend .EnableHTTP3 ,
1589+ Zone : loadbalancer .Zone ,
1590+ FrontendID : frontend .ID ,
1591+ Name : frontend .Name ,
1592+ InboundPort : frontend .InboundPort ,
1593+ BackendID : backend .ID ,
1594+ TimeoutClient : frontend .TimeoutClient ,
1595+ CertificateIDs : & frontend .CertificateIDs ,
1596+ ConnectionRateLimit : frontend .ConnectionRateLimit ,
1597+ EnableAccessLogs : & frontend .EnableAccessLogs ,
1598+ EnableHTTP3 : frontend .EnableHTTP3 ,
15741599 })
15751600
15761601 return f , err
0 commit comments