【问题标题】:Kubernetes Dashboard : Dashboard keeps cancelling connection to pod, resulting in bad gateway to userKubernetes Dashboard : Dashboard 不断取消与 pod 的连接,导致用户网关错误
【发布时间】:2020-08-31 05:41:16
【问题描述】:

我正在使用 kubernetes-dashboard 查看所有 pod,检查状态,登录,传递命令等。它工作得很好,但是有很多与之相关的连接问题。我目前在端口 8443 上运行它,并通过 Nginx 的代理通道将连接从 443 转发到 8443。但是我的网关一直很糟糕,并且连接不断下降。这不是 nginx 问题,因为我有 kubernetes 错误。我在 nginx 中使用 Letsencrypt 证书,我做错了什么?

错误日志:

E0831 05:31:45.839693   11324 portforward.go:385] error copying from local connection to remote stream: read tcp4 127.0.0.1:8443->127.0.0.1:33380: read: connection reset by peer
E0831 05:33:22.971448   11324 portforward.go:340] error creating error stream for port 8443 -> 8443: Timeout occured

这些是我经常遇到的两个错误。我将此命令作为 nohup 进程运行:

nohup kubectl port-forward -n kubernetes-dashboard service/kubernetes-dashboard 8443:443 --address 0.0.0.0 &

最后是我的 nginx 配置:

默认:

  location / {
             proxy_intercept_errors off;
             proxy_pass https://localhost:8443/;
        }

谢谢。 :-)

【问题讨论】:

    标签: nginx kubernetes kubernetes-dashboard


    【解决方案1】:

    不幸的是,这是 Kubernetes 端口转发的一个持续问题。当用于长时间运行的连接时,您可能会发现它不是特别可靠。如果可能,请尝试设置直接连接。可以在herehere 找到关于此的更详细的讨论。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-09-15
      • 2020-06-05
      • 2019-02-15
      • 1970-01-01
      • 2018-09-02
      • 2022-01-20
      • 1970-01-01
      相关资源
      最近更新 更多