Skip to content

Commit d0d4f8c

Browse files
committed
Merge pull request oracle#148 in OKE/oci-cloud-controller-manager from task/OKE-14472 to internal
* commit '70a07d7273ef81d60464bd8bb18922e39b65a091': removed TCP health check for SSL enabled traffic
2 parents dc26560 + 70a07d7 commit d0d4f8c

File tree

3 files changed

+9
-15
lines changed

3 files changed

+9
-15
lines changed

pkg/cloudprovider/providers/oci/load_balancer.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,9 @@ const (
136136
// Fallback value if annotation on service is not set
137137
lbDefaultShape = "100Mbps"
138138

139-
lbNodesHealthCheckPath = "/healthz"
140-
lbNodesHealthCheckPort = k8sports.ProxyHealthzPort
141-
lbNodesHealthCheckProtoHTTP = "HTTP"
142-
lbNodesHealthCheckProtoTCP = "TCP"
139+
lbNodesHealthCheckPath = "/healthz"
140+
lbNodesHealthCheckPort = k8sports.ProxyHealthzPort
141+
lbNodesHealthCheckProto = "HTTP"
143142

144143
// default connection idle timeout per protocol
145144
// https://docs.cloud.oracle.com/en-us/iaas/Content/Balance/Reference/connectionreuse.htm#ConnectionConfiguration

pkg/cloudprovider/providers/oci/load_balancer_spec.go

+5-10
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ func getPorts(svc *v1.Service) (map[string]portSpec, error) {
252252
ports := make(map[string]portSpec)
253253
for _, servicePort := range svc.Spec.Ports {
254254
name := getBackendSetName(string(servicePort.Protocol), int(servicePort.Port))
255-
healthChecker, err := getHealthChecker(nil, int(servicePort.Port), svc)
255+
healthChecker, err := getHealthChecker(svc)
256256
if err != nil {
257257
return nil, err
258258
}
@@ -295,7 +295,7 @@ func getBackendSets(logger *zap.SugaredLogger, svc *v1.Service, nodes []*v1.Node
295295
if sslCfg != nil && len(sslCfg.BackendSetSSLSecretName) != 0 {
296296
secretName = sslCfg.BackendSetSSLSecretName
297297
}
298-
healthChecker, err := getHealthChecker(sslCfg, port, svc)
298+
healthChecker, err := getHealthChecker(svc)
299299
if err != nil {
300300
return nil, err
301301
}
@@ -309,12 +309,7 @@ func getBackendSets(logger *zap.SugaredLogger, svc *v1.Service, nodes []*v1.Node
309309
return backendSets, nil
310310
}
311311

312-
func getHealthChecker(cfg *SSLConfig, port int, svc *v1.Service) (*loadbalancer.HealthCheckerDetails, error) {
313-
// If the health-check has SSL enabled use TCP rather than HTTP.
314-
protocol := lbNodesHealthCheckProtoHTTP
315-
if cfg != nil && cfg.Ports.Has(port) {
316-
protocol = lbNodesHealthCheckProtoTCP
317-
}
312+
func getHealthChecker(svc *v1.Service) (*loadbalancer.HealthCheckerDetails, error) {
318313
// Setting default values as per defined in the doc (https://docs.cloud.oracle.com/en-us/iaas/Content/Balance/Tasks/editinghealthcheck.htm#console)
319314
var retries = 3
320315
if r, ok := svc.Annotations[ServiceAnnotationLoadBalancerHealthCheckRetries]; ok {
@@ -345,7 +340,7 @@ func getHealthChecker(cfg *SSLConfig, port int, svc *v1.Service) (*loadbalancer.
345340
checkPath, checkPort := apiservice.GetServiceHealthCheckPathPort(svc)
346341
if checkPath != "" {
347342
return &loadbalancer.HealthCheckerDetails{
348-
Protocol: &protocol,
343+
Protocol: common.String(lbNodesHealthCheckProto),
349344
UrlPath: &checkPath,
350345
Port: common.Int(int(checkPort)),
351346
Retries: &retries,
@@ -355,7 +350,7 @@ func getHealthChecker(cfg *SSLConfig, port int, svc *v1.Service) (*loadbalancer.
355350
}
356351

357352
return &loadbalancer.HealthCheckerDetails{
358-
Protocol: &protocol,
353+
Protocol: common.String(lbNodesHealthCheckProto),
359354
UrlPath: common.String(lbNodesHealthCheckPath),
360355
Port: common.Int(lbNodesHealthCheckPort),
361356
Retries: &retries,

pkg/cloudprovider/providers/oci/load_balancer_spec_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1197,7 +1197,7 @@ func TestNewLBSpecSuccess(t *testing.T) {
11971197
"TCP-443": {
11981198
Backends: []loadbalancer.BackendDetails{},
11991199
HealthChecker: &loadbalancer.HealthCheckerDetails{
1200-
Protocol: common.String("TCP"),
1200+
Protocol: common.String("HTTP"),
12011201
Port: common.Int(10256),
12021202
UrlPath: common.String("/healthz"),
12031203
Retries: common.Int(3),

0 commit comments

Comments
 (0)