-
Hi, My system is based on Nginx for ingress and LinkerD for Service mesh. Using header-based routing (the user agent, Firefox for example), I route the traffic to the relevant service, which works as planned on the ingress level I have 2 services but they both require a label selector, which can only be the same one as defined on the rollout. canary-service---
apiVersion: v1
kind: Service
metadata:
name: rollouts-demo-preview
namespace: rollout-ing
labels:
app: rollouts-demo-preview
spec:
ports:
- port: 80
targetPort: http
protocol: TCP
name: http
selector:
app: rollouts-demo
type: ClusterIP Stable service---
apiVersion: v1
kind: Service
metadata:
name: rollouts-demo
namespace: rollout-ing
labels:
app: rollouts-demo
spec:
ports:
- port: 80
targetPort: http
protocol: TCP
name: http
selector:
app: rollouts-demo
type: ClusterIP RolloutapiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: rollouts-demo
namespace: rollout-ing
labels:
app: rollouts-demo
spec:
replicas: 3
revisionHistoryLimit: 3
selector:
matchLabels:
app: rollouts-demo
template:
metadata:
annotations:
linkerd.io/inject: enabled
role: stable
labels:
app: rollouts-demo
role: stable
spec:
containers:
- name: rollouts-demo
image: alexmt/rollouts-demo:yellow
ports:
- name: http
containerPort: 80
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http
strategy:
canary:
canaryService: rollouts-demo-preview # required
stableService: rollouts-demo # required
canaryMetadata:
annotations:
role: canary
labels:
role: canary
# metadata which will be attached to the stable pods
stableMetadata:
annotations:
role: stable
labels:
role: stable
trafficRouting:
smi:
rootService: rollouts-demo
trafficSplitName: rollout-demo-traffic-split # optional
nginx:
stableIngress: rollouts-demo # required
additionalIngressAnnotations: # optional
canary-by-header: "User-Agent"
canary-by-header-pattern: "Mozilla.+Firefox+."
steps:
- setWeight: 30
- pause: {}
- setWeight: 60
- pause: {duration: 15s} Things I did trycanaryMetadata traffic selector Thanks for your time and feedback. Chen |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The problem was on the Nginx Ingress, nginx.ingress.kubernetes.io/affinity: "cookie" The stickiness to the stable pods was achieved. |
Beta Was this translation helpful? Give feedback.
The problem was on the Nginx Ingress,
Using the annotation
The stickiness to the stable pods was achieved.