@@ -1232,10 +1232,21 @@ func (lbaas *LbaasV2) buildMonitorCreateOpts(svcConf *serviceConfig, port corev1
1232
1232
opts .Type = "UDP-CONNECT"
1233
1233
}
1234
1234
if svcConf .healthCheckNodePort > 0 {
1235
- opts .Type = "HTTP"
1236
- opts .URLPath = "/healthz"
1237
- opts .HTTPMethod = "GET"
1238
- opts .ExpectedCodes = "200"
1235
+ setHTTPHealthMonitor := true
1236
+ if lbaas .opts .LBProvider == "ovn" {
1237
+ // ovn-octavia-provider doesn't support HTTP monitors at all. We got to avoid creating it with ovn.
1238
+ setHTTPHealthMonitor = false
1239
+ } else if opts .Type == "UDP-CONNECT" {
1240
+ // Older Octavia versions or OVN provider doesn't support HTTP monitors on UDP pools. We got to check if that's the case.
1241
+ setHTTPHealthMonitor = openstackutil .IsOctaviaFeatureSupported (lbaas .lb , openstackutil .OctaviaFeatureHTTPMonitorsOnUDP , lbaas .opts .LBProvider )
1242
+ }
1243
+
1244
+ if setHTTPHealthMonitor {
1245
+ opts .Type = "HTTP"
1246
+ opts .URLPath = "/healthz"
1247
+ opts .HTTPMethod = "GET"
1248
+ opts .ExpectedCodes = "200"
1249
+ }
1239
1250
}
1240
1251
return opts
1241
1252
}
@@ -1361,7 +1372,19 @@ func (lbaas *LbaasV2) buildBatchUpdateMemberOpts(port corev1.ServicePort, nodes
1361
1372
SubnetID : & svcConf .lbMemberSubnetID ,
1362
1373
}
1363
1374
if svcConf .healthCheckNodePort > 0 {
1364
- member .MonitorPort = & svcConf .healthCheckNodePort
1375
+ useHealthCheckNodePort := true
1376
+ if lbaas .opts .LBProvider == "ovn" {
1377
+ // ovn-octavia-provider doesn't support HTTP monitors at all, if we have it we got to rely on NodePort
1378
+ // and UDP-CONNECT health monitor.
1379
+ useHealthCheckNodePort = false
1380
+ } else if port .Protocol == "UDP" {
1381
+ // Older Octavia versions doesn't support HTTP monitors on UDP pools. If we have one like that, we got
1382
+ // to rely on checking the NodePort instead.
1383
+ useHealthCheckNodePort = openstackutil .IsOctaviaFeatureSupported (lbaas .lb , openstackutil .OctaviaFeatureHTTPMonitorsOnUDP , lbaas .opts .LBProvider )
1384
+ }
1385
+ if useHealthCheckNodePort {
1386
+ member .MonitorPort = & svcConf .healthCheckNodePort
1387
+ }
1365
1388
}
1366
1389
members = append (members , member )
1367
1390
newMembers .Insert (fmt .Sprintf ("%s-%s-%d-%d" , node .Name , addr , member .ProtocolPort , svcConf .healthCheckNodePort ))
0 commit comments