【发布时间】:2018-11-29 16:12:50
【问题描述】:
在 GKE 上,我们遇到了一些与 API 相关的随机错误。 很久以前我们有“错误拨号后端:EOF”。
我们在 K8s 之上使用 Jenkins 来管理我们的构建。不久前,作业因此错误而被杀死:
Executing shell script inside container [protobuf] of pod [kubernetes-bad0aa993add416e80bdc1e66d1b30fc-536045ac8bbe]
java.net.ProtocolException: Expected HTTP 101 response but was '500 Internal Server Error'
at com.squareup.okhttp.ws.WebSocketCall.createWebSocket(WebSocketCall.java:123)
at com.squareup.okhttp.ws.WebSocketCall.access$000(WebSocketCall.java:40)
at com.squareup.okhttp.ws.WebSocketCall$1.onResponse(WebSocketCall.java:98)
at com.squareup.okhttp.Call$AsyncCall.execute(Call.java:177)
at com.squareup.okhttp.internal.NamedRunnable.run(NamedRunnable.java:33)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
这个案例看起来很像:https://gitlab.com/gitlab-org/gitlab-runner/issues/3247
许多审核日志网址:
permission: "io.k8s.core.v1.pods.exec.create"
resource: "core/v1/namespaces/default/pods/pubsub-6132c0bc-2542-46a2-8041-c865f238698d-4ccc0-c1nkz-lqg5x/exec/pubsub-6132c0bc-2542-46a2-8041-c865f238698d-4ccc0-c1nkz-lqg5x"
和
permission: "io.k8s.core.v1.pods.exec.get"
resource: "core/v1/namespaces/default/pods/pubsub-a5a21f14-0bd1-4338-87b1-8658c3bbc7ad-9gm4n-8nz14/exec"
但我不明白为什么 Kubernetes 会出现这个错误...
更新:
可以使用 kube-state-metrics 验证这些错误,其中有 2 个: - ssh_tunnel_open_count - ssh_tunnel_open_fail_count
对我来说,打开隧道 ssh 失败的数量随着 200 多个 ssh 隧道打开而增长。
有关信息,我们使用 GKE 进行了一些测试 - 从区域集群切换到区域集群 - 使用新的本地 IP(旧别名 IP) 但这并不能解决问题。
在 node-pool 上禁用自动缩放后,我们没有更多错误。
【问题讨论】:
-
如果您认为是 GKE 问题,建议您使用 this link 打开私人问题报告,提供相关信息(例如:项目 ID、集群名称、Pod、K8 版本)等)和复制步骤(如果可能)进行验证。
-
我一直在调查这种行为以及corresponding issue in Jenkins 和
gitlab-runner。看起来 GitLab 通过捕获java.net.ProtocolException并重试解决了这个问题。 Jenkins 看到了 K8s 中的问题。在第一次测试中,重试似乎是一种解决方法,但是这需要将 Jenkinsfiles 中的每个语句都包装在一个重试函数中(常规闭包有帮助,但它仍然是一个疯狂的影响)。有任何更新甚至解决方案吗?
标签: networking kubernetes eof google-kubernetes-engine