[英]upstream connect error or disconnect/reset before headers. reset reason: connection failure. Spring Boot and java 11
I'm having a problem migrating my pure Kube.netes app to an Istio managed.我在将我的纯 Kube.netes 应用程序迁移到 Istio 托管时遇到问题。 I'm using Google Cloud Platform (GCP), Istio 1.4, Google Kube.netes Engine (GKE), Spring Boot and JAVA 11.
我正在使用谷歌云平台 (GCP)、Istio 1.4、谷歌 Kube.netes 引擎 (GKE)、Spring Boot 和 JAVA 11。
I had the containers running in a pure GKE environment without a problem.我让容器在纯 GKE 环境中运行没有问题。 Now I started the migration of my Kube.netes cluster to use Istio.
现在我开始迁移我的 Kube.netes 集群以使用 Istio。 Since then I'm getting the following message when I try to access the exposed service.
从那时起,当我尝试访问公开的服务时,我收到了以下消息。
upstream connect error or disconnect/reset before headers.上游连接错误或在标头之前断开连接/重置。 reset reason: connection failure
重置原因:连接失败
This error message looks like a really generic.这个错误信息看起来很普通。 I found a lot of different problems, with the same error message, but no one was related to my problem.
我发现了很多不同的问题,都有相同的错误信息,但没有一个与我的问题有关。
Bellow the version of the Istio:下面是 Istio 的版本:
client version: 1.4.10
control plane version: 1.4.10-gke.5
data plane version: 1.4.10-gke.5 (2 proxies)
Bellow my yaml files:下面是我的 yaml 文件:
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
account: tree-guest
name: tree-guest-service-account
---
apiVersion: v1
kind: Service
metadata:
labels:
app: tree-guest
service: tree-guest
name: tree-guest
spec:
ports:
- name: http
port: 8080
targetPort: 8080
selector:
app: tree-guest
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: tree-guest
version: v1
name: tree-guest-v1
spec:
replicas: 1
selector:
matchLabels:
app: tree-guest
version: v1
template:
metadata:
labels:
app: tree-guestaz
version: v1
spec:
containers:
- image: registry.hub.docker.com/victorsens/tree-quest:circle_ci_build_00923285-3c44-4955-8de1-ed578e23c5cf
imagePullPolicy: IfNotPresent
name: tree-guest
ports:
- containerPort: 8080
serviceAccount: tree-guest-service-account
---
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: tree-guest-gateway
spec:
selector:
istio: ingressgateway # use istio default controller
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- "*"
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: tree-guest-virtual-service
spec:
hosts:
- "*"
gateways:
- tree-guest-gateway
http:
- match:
- uri:
prefix: /v1
route:
- destination:
host: tree-guest
port:
number: 8080
To apply the yaml file I used the following argument:为了应用 yaml 文件,我使用了以下参数:
kubectl apply -f <(istioctl kube-inject -f ./tree-guest.yaml)
Below the result of the Istio proxy argument, after deploying the application:部署应用程序后,在 Istio 代理参数的结果下方:
istio-ingressgateway-6674cc989b-vwzqg.istio-system SYNCED SYNCED SYNCED SYNCED
istio-pilot-ff4489db8-2hx5f 1.4.10-gke.5 tree-guest-v1-774bf84ddd-jkhsh.default SYNCED SYNCED SYNCED SYNCED istio-pilot-ff4489db8-2hx5f 1.4.10-gke.5
If someone have a tip about what is going wrong, please let me know.如果有人知道出了什么问题,请告诉我。 I'm stuck in this problem for a couple of days.
我被这个问题困了几天。
Thanks.谢谢。
As @Victor mentioned the problem here was the wrong yaml file.正如@Victor 提到的,这里的问题是错误的 yaml 文件。
I solve it.
我解决它。 In my case the yaml file was wrong.
在我的情况下,yaml 文件是错误的。 I reviewed it and the problem now is solved.
我查看了它,现在问题已经解决了。 Thank you guys., – Victor
谢谢你们。,-维克多
If you're looking for yaml samples I would suggest to take a look at istio github samples .如果您正在寻找 yaml 示例,我建议您查看istio github 示例。
As 503 upstream connect error or disconnect/reset before headers. reset reason: connection failure
作为
503 upstream connect error or disconnect/reset before headers. reset reason: connection failure
503 upstream connect error or disconnect/reset before headers. reset reason: connection failure
occurs very often I set up little troubleshooting answer, there are another questions with 503 error which I encountered for several months with answers, useful informations from istio documentation and things I would check. 503 upstream connect error or disconnect/reset before headers. reset reason: connection failure
经常发生我设置了很少的故障排除答案,还有另一个问题与 503 错误,我遇到了几个月的答案,来自 istio 文档的有用信息和我会检查的东西。
Examples with 503 error:带有 503 错误的示例:
Common cause of 503 errors from istio documentation: istio 文档中 503 错误的常见原因:
Few things I would check first:我会先检查几件事:
<protocol>[-<suffix>]
as mentioned in istio documentation .<protocol>[-<suffix>]
。kubectl get namespace -L istio-injection
kubectl get namespace -L istio-injection
I landed exactly here with exactly similar symptoms.我正好降落在这里,症状完全相似。
But in my case I had to但就我而言,我不得不
switch pod listen address from 172.0.0.1 to 0.0.0.0
将 pod 监听地址从 172.0.0.1 切换到 0.0.0.0
which solved my issue这解决了我的问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.