Skip to content

Commit

Permalink
Drop second health check port const
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelSpeed committed Aug 7, 2023
1 parent 67a16bf commit c1e7910
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pkg/providers/v1/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -3987,7 +3987,7 @@ func (c *Cloud) buildNLBHealthCheckConfiguration(svc *v1.Service) (healthCheckCo
// When the node is shutting down, the health check should fail before the node loses the ability to route traffic to the backend pod.
// This allows the load balancer to gracefully drain connections from the node.
if svc.Spec.ExternalTrafficPolicy != v1.ServiceExternalTrafficPolicyTypeLocal && !(pathModified || portModified || protocolModified) {
hc.Port = kubeProxyHealthCheckPort
hc.Port = strconv.Itoa(kubeProxyHealthCheckPort)
hc.Path = kubeProxyHealthCheckPath
hc.Protocol = elbv2.ProtocolEnumHttp
}
Expand Down Expand Up @@ -4383,7 +4383,7 @@ func (c *Cloud) EnsureLoadBalancer(ctx context.Context, clusterName string, apiS
klog.V(4).Infof("service %v does not need custom health checks", apiService.Name)

// Use the kube-proxy port as the health check port for non-local services.
err = c.ensureLoadBalancerHealthCheck(loadBalancer, "HTTP", kubeProxyHealthCheckPortInt, kubeProxyHealthCheckPath, annotations)
err = c.ensureLoadBalancerHealthCheck(loadBalancer, "HTTP", int32(kubeProxyHealthCheckPort), kubeProxyHealthCheckPath, annotations)
if err != nil {
return nil, err
}
Expand Down
6 changes: 2 additions & 4 deletions pkg/providers/v1/aws_loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,8 @@ var (
defaultHealthCheckPort = "traffic-port"
defaultHealthCheckPath = "/"

// We need the port as both string and int.
kubeProxyHealthCheckPort = "10256"
kubeProxyHealthCheckPortInt = int32(10256)
kubeProxyHealthCheckPath = "/healthz"
kubeProxyHealthCheckPort = 10256
kubeProxyHealthCheckPath = "/healthz"

// Defaults for ELB Target operations
defaultRegisterTargetsChunkSize = 100
Expand Down

0 comments on commit c1e7910

Please sign in to comment.