【问题标题】:Kubernetes: How to change the default timeout of 60 sec of the AWS Load Balancer when exposing a service?Kubernetes:公开服务时如何更改 AWS 负载均衡器的默认超时 60 秒?
【发布时间】:2016-08-27 06:42:46
【问题描述】:

在 AWS 中使用 --type="LoadBalancer" 公开服务当前会创建一个默认超时为 60 秒的 TCP 级 AWS ELB。除了手动查找负载均衡器并使用 AWS 工具重新配置它之外,还有其他方法可以更改超时吗? (即费力的 kubectl describe service xyz | grep "LoadBalancer Ingress" -> 使用 AWS API 通过此 URL 查找负载均衡器并设置其超时)或者是使用此自动创建的 ELB 的良好替代方案吗?

当前情况的问题是 (1) 1 分钟对于我们的某些服务来说太短了 (2) 由于 TCP(而不是 HTTP)级别的负载平衡,客户端无法获得信息超时时报错(在 curl 的情况下:“curl: (52) Empty reply from server”)

谢谢!

【问题讨论】:

标签: amazon-web-services timeout kubernetes amazon-elb


【解决方案1】:

在最近的 Kubernetes 版本(1.4 或更高版本?)中,可以使用服务上的注释为 ELB 设置连接空闲超时。例如:

kubectl annotate service my-service service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout=1200

此外,您可以使用以下注释将负载平衡协议更改为 HTTP。

service.beta.kubernetes.io/aws-load-balancer-backend-protocol

有关 AWS ELB 的更多注释,请参阅 the AWS provider source

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-07-11
    • 1970-01-01
    • 2017-09-30
    • 2022-10-23
    • 2018-06-26
    • 2014-04-26
    • 2017-12-22
    • 2018-06-14
    相关资源
    最近更新 更多