Skip to content

Commit

Permalink
Merge pull request #125 from jtherin/lbdefaultvalues
Browse files Browse the repository at this point in the history
chore(lb): change default values
  • Loading branch information
jtherin committed Mar 21, 2023
2 parents 334f760 + d558199 commit 428c8bd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions docs/loadbalancer-annotations.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ NB: depending on the type, some other annotations are required, see below.

### `service.beta.kubernetes.io/scw-loadbalancer-health-check-delay`
This is the annotation to set the time between two consecutive health checks.
The default value is `10s`. The duration are go's time.Duration (ex: `1s`, `2m`, `4h`, ...).
The default value is `5s`. The duration are go's time.Duration (ex: `1s`, `2m`, `4h`, ...).

### `service.beta.kubernetes.io/scw-loadbalancer-health-check-timeout`
This is the annotaton to set the additional check timeout, after the connection has been already established.
The default value is `10s`. The duration are go's time.Duration (ex: `1s`, `2m`, `4h`, ...).
The default value is `5s`. The duration are go's time.Duration (ex: `1s`, `2m`, `4h`, ...).

### `service.beta.kubernetes.io/scw-loadbalancer-health-check-max-retries`
This is the annotation to set the number of consecutive unsuccessful health checks, after wich the server will be considered dead.
The default value is `10`.
The default value is `5`.

### `service.beta.kubernetes.io/scw-loadbalancer-health-check-http-uri`
This is the annotation to set the URI that is used by the `http` health check.
Expand Down Expand Up @@ -105,7 +105,7 @@ The default value is `10m`. The duration are go's time.Duration (ex: `1s`, `2m`,

### `service.beta.kubernetes.io/scw-loadbalancer-timeout-connect`
This is the annotation to set the maximum initial server connection establishment time.
The default value is `10m`. The duration are go's time.Duration (ex: `1s`, `2m`, `4h`, ...).
The default value is `10s`. The duration are go's time.Duration (ex: `1s`, `2m`, `4h`, ...).

### `service.beta.kubernetes.io/scw-loadbalancer-timeout-tunnel`
This is the annotation to set the maximum tunnel inactivity time.
Expand Down
16 changes: 8 additions & 8 deletions scaleway/loadbalancers.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ const (
serviceAnnotationLoadBalancerHealthCheckType = "service.beta.kubernetes.io/scw-loadbalancer-health-check-type"

// serviceAnnotationLoadBalancerHealthCheckDelay is the time between two consecutive health checks
// The default value is "10s". The duration are go's time.Duration (ex: "1s", "2m", "4h", ...)
// The default value is "5s". The duration are go's time.Duration (ex: "1s", "2m", "4h", ...)
serviceAnnotationLoadBalancerHealthCheckDelay = "service.beta.kubernetes.io/scw-loadbalancer-health-check-delay"

// serviceAnnotationLoadBalancerHealthCheckTimeout is the additional check timeout, after the connection has been already established
// The default value is "10s". The duration are go's time.Duration (ex: "1s", "2m", "4h", ...)
// The default value is "5s". The duration are go's time.Duration (ex: "1s", "2m", "4h", ...)
serviceAnnotationLoadBalancerHealthCheckTimeout = "service.beta.kubernetes.io/scw-loadbalancer-health-check-timeout"

// serviceAnnotationLoadBalancerHealthCheckMaxRetries is the number of consecutive unsuccessful health checks, after wich the server will be considered dead
// The default value is "10".
// The default value is "5".
serviceAnnotationLoadBalancerHealthCheckMaxRetries = "service.beta.kubernetes.io/scw-loadbalancer-health-check-max-retries"

// serviceAnnotationLoadBalancerHealthCheckHTTPURI is the URI that is used by the "http" health check
Expand Down Expand Up @@ -124,7 +124,7 @@ const (
serviceAnnotationLoadBalancerTimeoutServer = "service.beta.kubernetes.io/scw-loadbalancer-timeout-server"

// serviceAnnotationLoadBalancerTimeoutConnect is the maximum initical server connection establishment time
// The default value is "10m". The duration are go's time.Duration (ex: "1s", "2m", "4h", ...)
// The default value is "10s". The duration are go's time.Duration (ex: "1s", "2m", "4h", ...)
serviceAnnotationLoadBalancerTimeoutConnect = "service.beta.kubernetes.io/scw-loadbalancer-timeout-connect"

// serviceAnnotationLoadBalancerTimeoutTunnel is the maximum tunnel inactivity time
Expand Down Expand Up @@ -1408,7 +1408,7 @@ func getTimeoutClient(service *v1.Service) (time.Duration, error) {
func getTimeoutServer(service *v1.Service) (time.Duration, error) {
timeoutServer, ok := service.Annotations[serviceAnnotationLoadBalancerTimeoutServer]
if !ok {
return time.ParseDuration("10m")
return time.ParseDuration("10s")
}

timeoutServerDuration, err := time.ParseDuration(timeoutServer)
Expand Down Expand Up @@ -1469,7 +1469,7 @@ func getOnMarkedDownAction(service *v1.Service) (scwlb.OnMarkedDownAction, error
func getHealthCheckDelay(service *v1.Service) (time.Duration, error) {
healthCheckDelay, ok := service.Annotations[serviceAnnotationLoadBalancerHealthCheckDelay]
if !ok {
return time.ParseDuration("10s")
return time.ParseDuration("5s")
}

healthCheckDelayDuration, err := time.ParseDuration(healthCheckDelay)
Expand All @@ -1484,7 +1484,7 @@ func getHealthCheckDelay(service *v1.Service) (time.Duration, error) {
func getHealthCheckTimeout(service *v1.Service) (time.Duration, error) {
healthCheckTimeout, ok := service.Annotations[serviceAnnotationLoadBalancerHealthCheckTimeout]
if !ok {
return time.ParseDuration("10s")
return time.ParseDuration("5s")
}

healthCheckTimeoutDuration, err := time.ParseDuration(healthCheckTimeout)
Expand All @@ -1499,7 +1499,7 @@ func getHealthCheckTimeout(service *v1.Service) (time.Duration, error) {
func getHealthCheckMaxRetries(service *v1.Service) (int32, error) {
healthCheckMaxRetries, ok := service.Annotations[serviceAnnotationLoadBalancerHealthCheckMaxRetries]
if !ok {
return 10, nil
return 5, nil
}

healthCheckMaxRetriesInt, err := strconv.Atoi(healthCheckMaxRetries)
Expand Down

0 comments on commit 428c8bd

Please sign in to comment.