基于cookie流量切分
模拟仅带有user_from_cd 的cookie的请求转发给当前Canary I
Ingress 策略文件编写
[root@k8smaster1 ingress]# cat ingress-v2-cookie.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: nginx-canary
annotations:
nginx.ingress.kubernetes.io/canary: "true"
nginx.ingress.kubernetes.io/canary-by-cookie: "user_from_cd"
spec:
ingressClassName: nginx
rules:
- host: canary.example.com
http:
paths:
- backend:
service:
name: nginx-v2
port:
number: 80
pathType: Prefix
path: /