开启灰度发布后 访问不了,没有开启,可以通过访问后端服务,试了nginx和higress,都不行。求助 #646
-
采用的命令,无法访问
对应的yaml文件: apiVersion: apps/v1
kind: Deployment
metadata:
name: test-demo
labels:
app: test-demo
spec:
replicas: 1
selector:
matchLabels:
app: test-demo
template:
metadata:
labels:
app: test-demo
spec:
containers:
- name: test-demo
image: registry.cn-hangzhou.aliyuncs.com/wang-test-yu/test-demo
ports:
- containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: test-demo
spec:
selector:
app: test-demo
ports:
- name: http
port: 8080
targetPort: 8080
type: ClusterIP
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: minimal-ingress-test-gray
annotations:
nginx.ingress.kubernetes.io/canary: "true"
nginx.ingress.kubernetes.io/canary-by-header: "foo"
nginx.ingress.kubernetes.io/canary-by-header-value: "bar"
spec:
ingressClassName: higress
rules:
- host: a.com
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: test-demo
port:
number: 8080 去掉灰度注解,是可以访问的
对应的yaml文件 ---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: minimal-ingress-test-gray
spec:
ingressClassName: higress
rules:
- host: a.com
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: test-demo
port:
number: 8080 |
Beta Was this translation helpful? Give feedback.
Answered by
johnlanni
Nov 19, 2023
Replies: 1 comment
-
@wangmingbo123 你的理解错了,canary 注解是用于找到一个路由条件一样的 ingress,然后根据设置 canary 的条件,如权重或特殊header匹配,将原来条件的请求路由到新的服务上。 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
johnlanni
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@wangmingbo123 你的理解错了,canary 注解是用于找到一个路由条件一样的 ingress,然后根据设置 canary 的条件,如权重或特殊header匹配,将原来条件的请求路由到新的服务上。