Vic*_*tor 20 spring-boot google-cloud-platform kubernetes istio java-11
我在将纯 Kubernetes 应用程序迁移到 Istio 托管时遇到问题。我正在使用 Google Cloud Platform (GCP)、Istio 1.4、Google Kubernetes Engine (GKE)、Spring Boot 和 JAVA 11。
我让容器在纯 GKE 环境中运行,没有出现任何问题。现在我开始将 Kubernetes 集群迁移到使用 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)
Run Code Online (Sandbox Code Playgroud)
下面是我的 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
Run Code Online (Sandbox Code Playgroud)
为了应用 yaml 文件,我使用了以下参数:
kubectl apply -f <(istioctl kube-inject -f ./tree-guest.yaml)
Run Code Online (Sandbox Code Playgroud)
部署应用程序后,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
Run Code Online (Sandbox Code Playgroud)
如果有人对出现的问题有任何提示,请告诉我。我被这个问题困扰了几天。
谢谢。
jt9*_*t97 19
正如 @Victor 提到的,这里的问题是错误的 yaml 文件。
\n\n\n我解决它。就我而言,yaml 文件是错误的。我检查了一下,现在问题已经解决了。谢谢你们。, \xe2\x80\x93 维克多
\n
如果您正在寻找 yaml 示例,我建议您查看istio github 示例。
\n正如503 upstream connect error or disconnect/reset before headers. reset reason: connection failure经常发生的那样,我设置了很少的故障排除答案,还有另一个带有 503 错误的问题,我在几个月内遇到了这些问题,并提供了答案、istio 文档中的有用信息以及我要检查的内容。
503 错误示例:
\nIstio 文档中 503 错误的常见原因:
\n我首先要检查的几件事:
\n<protocol>[-<suffix>]中提到的那样。kubectl get namespace -L istio-injection| 归档时间: |
|
| 查看次数: |
180087 次 |
| 最近记录: |