目标
我在试着设置一个
Cloud LB -> GKE [istio-gateway -> my-service]这在以前是有效的,然而,我不得不在2天前重新创建集群,并遇到了这个问题。也许是一些版本的改变?
这是我的入口清单文件
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: "my-dev-ingress"
namespace: "istio-system"
annotations:
kubernetes.io/ingress.global-static-ip-name: "my-dev-gclb-ip"
ingress.gcp.kubernetes.io/pre-shared-cert: "my-dev-cluster-cert-05"
kubernetes.io/ingress.allow-http: "false"
spec:
backend:
serviceName: "istio-ingressgateway"
servicePort: 80问题
云LB健康检查问题失败。由入口创建的后端服务创建/:80默认健康检查。
我尝试过的东西
1)我尝试将gke入口生成的健康检查设置为指向后端配置控制台中的istio网关StatusPort端口15020。然后,运行状况检查通过了一段时间,直到后端配置恢复为使用它创建的原始/:80运行状况检查。我甚至尝试删除它创建的健康检查,它只是创建了另一个健康检查。
2)我还尝试使用istio-virtual服务将healthcheck路由到15020端口,如here所示,但没有太多成功。
3)我还尝试了将虚拟服务中的所有内容路由到healthcheck端口
hosts:
- "*"
gateways:
- my-web-gateway
http:
- match:
- method:
exact: GET
uri:
exact: /
route:
- destination:
host: istio-ingress.gke-system.svc.cluster.local
port:
number: 150204)我发现的大多数搜索结果都说,在部署中设置readinessProbe应该告诉入口设置适当的健康检查。然而,我所有的服务都在istio网关下,我真的不能做同样的事情。
我现在很迷茫,如果有人能给我指出正确的方向,我将不胜感激。谢谢
发布于 2021-04-09 23:46:55
我在gke 1.20.4-gke.2200和istio 1.9.2中得到了它,关于这个的文档不存在或者我没有找到任何东西,当使用"istioctl install -f values.yaml“命令时,你必须给istio-ingressgateway服务添加注释才能使用后端配置
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
spec:
components:
ingressGateways:
- name: istio-ingressgateway
enabled: true
k8s:
serviceAnnotations:
cloud.google.com/backend-config: '{"default": "istio-ingressgateway-config"}'然后,您必须使用正确的运行状况检查端口创建backend-config
apiVersion: cloud.google.com/v1
kind: BackendConfig
metadata:
name: istio-ingressgateway-config
namespace: istio-system
spec:
healthCheck:
checkIntervalSec: 30
port: 15021
type: HTTP
requestPath: /healthz/ready这样,入口应该自动更改指向istio端口80的负载均衡器健康检查的配置。
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: web
namespace: istio-system
annotations:
kubernetes.io/ingress.global-static-ip-name: web
networking.gke.io/managed-certificates: "web"
spec:
rules:
- host: test.example.com
http:
paths:
- path: "/*"
pathType: Prefix
backend:
service:
name: istio-ingressgateway
port:
number: 80apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: direct-web
namespace: istio-system
spec:
hosts:
- test.example.com
gateways:
- web
http:
- match:
- uri:
prefix: "/"
route:
- destination:
port:
number: 8080 #internal service port
host: "internal-service.service-namespace.svc.cluster.local"apiVersion: networking.istio.io/v1beta1
kind: Gateway
metadata:
name: web
namespace: istio-system
spec:
selector:
istio: ingressgateway
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- test.example.com您还可以在虚拟服务和网关中将主机设置为"*“
https://stackoverflow.com/questions/61811931
复制相似问题