@@ -44,6 +44,10 @@ const (
44
44
// The default value is "5s". The duration are go's time.Duration (ex: "1s", "2m", "4h", ...)
45
45
serviceAnnotationLoadBalancerHealthCheckDelay = "service.beta.kubernetes.io/scw-loadbalancer-health-check-delay"
46
46
47
+ // serviceAnnotationLoadBalancerHealthCheckSendProxy is the annotation to control if proxy protocol should be activated for the health check.
48
+ // The default value is "false"
49
+ serviceAnnotationLoadBalancerHealthCheckSendProxy = "service.beta.kubernetes.io/scw-loadbalancer-health-check-send-proxy"
50
+
47
51
// serviceAnnotationLoadBalancerHealthTransientCheckDelay is the time between two consecutive health checks on transient state (going UP or DOWN)
48
52
// The default value is "0.5s". The duration are go's time.Duration (ex: "1s", "2m", "4h", ...)
49
53
serviceAnnotationLoadBalancerHealthTransientCheckDelay = "service.beta.kubernetes.io/scw-loadbalancer-health-transient-check-delay"
@@ -483,6 +487,20 @@ func getHealthCheckMaxRetries(service *v1.Service) (int32, error) {
483
487
return int32 (healthCheckMaxRetriesInt ), nil
484
488
}
485
489
490
+ func getHealthCheckSendProxy (service * v1.Service ) (bool , error ) {
491
+ sendProxy , ok := service .Annotations [serviceAnnotationLoadBalancerHealthCheckSendProxy ]
492
+ if ! ok {
493
+ return false , nil
494
+ }
495
+ sendProxyBool , err := strconv .ParseBool (sendProxy )
496
+ if err != nil {
497
+ klog .Errorf ("invalid value for annotation %s" , serviceAnnotationLoadBalancerHealthCheckSendProxy )
498
+ return false , errLoadBalancerInvalidAnnotation
499
+ }
500
+
501
+ return sendProxyBool , nil
502
+ }
503
+
486
504
func getHealthCheckTransientCheckDelay (service * v1.Service ) (* scw.Duration , error ) {
487
505
transientCheckDelay , ok := service .Annotations [serviceAnnotationLoadBalancerHealthTransientCheckDelay ]
488
506
if ! ok {
0 commit comments