【问题标题】:Random 'Connection Refused' Errors when making get requests to my kubernetes cluster向我的 kubernetes 集群发出 get 请求时出现随机“连接被拒绝”错误
【发布时间】:2022-01-28 17:57:43
【问题描述】:

相当标准的设置

Nginx Ingress,带有外部 IP 当向 IP 发送批量请求(串行)时,大约有一半最终会出错...这里的示例:

$ curl -vI http://my-ip
*   Trying my-ip:80...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:02 --:--:--     0* connect to my-ip port 80 failed: Connection refused
* Failed to connect to my-ip port 80: Connection refused
  0     0    0     0    0     0      0      0 --:--:--  0:00:02 --:--:--     0
* Closing connection 0
curl: (7) Failed to connect to my-ip port 80: Connection refused

另一半及时返回200个状态码。

我可以在 nginx 控制器 pod 日志中看到带有 200 个状态代码的请求,但是我没有看到任何连接被拒绝请求的内容

nginx pod 在整个请求过程中都是健康的,没有崩溃或异常行为。我是直接调用nginx外部IP

nginx          ingress-nginx-1636864778-controller                  LoadBalancer   10.101.134.218   my-ip   80:30892/TCP,443:32566/TCP     74d

如果这些请求甚至没有到达控制器 pod,不确定从哪里继续?

【问题讨论】:

    标签: http nginx kubernetes networking routes


    【解决方案1】:

    上图显示了 HTTP 请求如何通过 LoadBalancer svc 传递到 pod。所以问题可能与您的特定节点或端口可用性有关。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-05-04
      • 2021-06-13
      • 2020-07-19
      • 2022-10-05
      • 2021-05-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多