@@ -44,6 +44,10 @@ const (
4444 // The default value is "5s". The duration are go's time.Duration (ex: "1s", "2m", "4h", ...)
4545 serviceAnnotationLoadBalancerHealthCheckDelay = "service.beta.kubernetes.io/scw-loadbalancer-health-check-delay"
4646
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+
4751 // serviceAnnotationLoadBalancerHealthTransientCheckDelay is the time between two consecutive health checks on transient state (going UP or DOWN)
4852 // The default value is "0.5s". The duration are go's time.Duration (ex: "1s", "2m", "4h", ...)
4953 serviceAnnotationLoadBalancerHealthTransientCheckDelay = "service.beta.kubernetes.io/scw-loadbalancer-health-transient-check-delay"
@@ -483,6 +487,20 @@ func getHealthCheckMaxRetries(service *v1.Service) (int32, error) {
483487 return int32 (healthCheckMaxRetriesInt ), nil
484488}
485489
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+
486504func getHealthCheckTransientCheckDelay (service * v1.Service ) (* scw.Duration , error ) {
487505 transientCheckDelay , ok := service .Annotations [serviceAnnotationLoadBalancerHealthTransientCheckDelay ]
488506 if ! ok {
0 commit comments