I am having an issue with Istio traffic routing. I want to test canary release with Istio .I´ve created a microk8s cluster, installed istio and injected it to default namespace. I´ve also deployed book-info aplication ( https://raw.githubusercontent.com/istio/istio/release-1.17/samples/bookinfo/platform/kube/bookinfo.yaml ) . But version 2 is missing in the manifest, so I did it by myself with other image. It looks like this :
apiVersion: apps/v1
kind: Deployment
metadata:
name: productpage-v2
labels:
app: productpage
version: v2
spec:
replicas: 1
selector:
matchLabels:
app: productpage
version: v2
template:
metadata:
labels:
app: productpage
version: v2
spec:
serviceAccountName: bookinfo-productpage
containers:
- name: productpage
image: sixeyed/bookinfo-productpage:v2
imagePullPolicy: IfNotPresent
ports:
- containerPort: 9080
volumeMounts:
- name: tmp
mountPath: /tmp
securityContext:
runAsUser: 1000
volumes:
- name: tmp
emptyDir: {}
I have created Virtual Service and Destination Rule :
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: bookinfo-canary
spec:
hosts:
- "*"
gateways:
- bookinfo-gateway
http:
- match:
- uri:
prefix: /productpage
route:
- destination:
host: productpage
subset: v1
weight: 50
- destination:
host: productpage
subset: v2
weight: 50
~
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: productpage
spec:
host: productpage
subsets:
- name: v1
labels:
version: v1
- name: v2
labels:
version: v2
This virtual service should be routing 50% to version 1 and 50% traffic to vesion 2.
I tunneled the port from server to my own laptop. I can get to the application via localhost.
The issue is, that everytime I refresh the page, it stays the same. The application doesn´t do the canary release, but routes me everytime to version 1.
When I look to logs via command : kubectl logs -l version=v2 -c istio-proxy -f
, it logs the v2 in 50 % of cases, but everytime it does this, it also logs v1. So it routes from v2 to v1 again. From v1 it doesn't route me to v2.
The logs I am getting are here:
(Version1 on the left, Version 2 on the right)
Curl command :
curl -s http://192.168.1.101:31737/productpage
Logs version 2 :
2023-04-14T06:53:01.141360Z info xdsproxy connected to upstream XDS server: istiod.istio-system.svc:15012
2023-04-14T06:55:45.529656Z info xdsproxy connected to upstream XDS server: istiod.istio-system.svc:15012
[2023-04-14T06:56:54.075Z] "GET /ratings/0 HTTP/1.1" 200 - via_upstream - "-" 0 48 12 11 "-" "curl/7.81.0" "41970b96-2dfa-9fc2-9846-b66cc930a2e8" "ratings:9080" "10.1.145.228:9080" outbound|9080||ratings.default.svc.cluster.local 10.1.145.224:46272 10.152.183.45:9080 10.1.145.224:50620 - default
[2023-04-14T06:56:54.064Z] "GET /reviews/0 HTTP/1.1" 200 - via_upstream - "-" 0 379 27 26 "-" "curl/7.81.0" "41970b96-2dfa-9fc2-9846-b66cc930a2e8" "reviews:9080" "10.1.145.224:9080" inbound|9080|| 127.0.0.6:41589 10.1.145.224:9080 10.1.145.203:34646 outbound_.9080_._.reviews.default.svc.cluster.local default
[2023-04-14T06:57:03.056Z] "GET /ratings/0 HTTP/1.1" 200 - via_upstream - "-" 0 48 3 3 "-" "curl/7.81.0" "7c61f2d1-b3bd-9c91-b974-608129617c16" "ratings:9080" "10.1.145.228:9080" outbound|9080||ratings.default.svc.cluster.local 10.1.145.224:46272 10.152.183.45:9080 10.1.145.224:45314 - default
[2023-04-14T06:57:03.048Z] "GET /reviews/0 HTTP/1.1" 200 - via_upstream - "-" 0 379 14 14 "-" "curl/7.81.0" "7c61f2d1-b3bd-9c91-b974-608129617c16" "reviews:9080" "10.1.145.224:9080" inbound|9080|| 127.0.0.6:41589 10.1.145.224:9080 10.1.145.203:34646 outbound_.9080_._.reviews.default.svc.cluster.local default
[2023-04-14T06:57:06.536Z] "GET /details/0 HTTP/1.1" 200 - via_upstream - "-" 0 178 11 10 "-" "curl/7.81.0" "1a5886d3-3a72-98fd-9479-bdf569014450" "details:9080" "10.1.145.225:9080" outbound|9080||details.default.svc.cluster.local 10.1.145.234:56106 10.152.183.85:9080 10.1.145.234:36726 - default
[2023-04-14T06:57:06.554Z] "GET /reviews/0 HTTP/1.1" 200 - via_upstream - "-" 0 375 25 24 "-" "curl/7.81.0" "1a5886d3-3a72-98fd-9479-bdf569014450" "reviews:9080" "10.1.145.222:9080" outbound|9080||reviews.default.svc.cluster.local 10.1.145.234:42066 10.152.183.192:9080 10.1.145.234:40224 - default
[2023-04-14T06:57:06.528Z] "GET /productpage HTTP/1.1" 200 - via_upstream - "-" 0 5537 55 54 "192.168.1.101" "curl/7.81.0" "1a5886d3-3a72-98fd-9479-bdf569014450" "192.168.1.101:31737" "10.1.145.234:9080" inbound|9080|| 127.0.0.6:32903 10.1.145.234:9080 192.168.1.101:0 outbound_.9080_.v2_.productpage.default.svc.cluster.local default
[2023-04-14T06:57:14.361Z] "GET /ratings/0 HTTP/1.1" 200 - via_upstream - "-" 0 48 6 5 "-" "curl/7.81.0" "30166699-78ac-9ac0-ad9f-ab3f7d207c35" "ratings:9080" "10.1.145.228:9080" outbound|9080||ratings.default.svc.cluster.local 10.1.145.224:42516 10.152.183.45:9080 10.1.145.224:55638 - default
[2023-04-14T06:57:14.352Z] "GET /reviews/0 HTTP/1.1" 200 - via_upstream - "-" 0 379 18 17 "-" "curl/7.81.0" "30166699-78ac-9ac0-ad9f-ab3f7d207c35" "reviews:9080" "10.1.145.224:9080" inbound|9080|| 127.0.0.6:41589 10.1.145.224:9080 10.1.145.203:34646 outbound_.9080_._.reviews.default.svc.cluster.local default
[2023-04-14T06:57:17.581Z] "GET /details/0 HTTP/1.1" 200 - via_upstream - "-" 0 178 5 5 "-" "curl/7.81.0" "47b009d9-fac5-9893-ab40-ecd1c418c6aa" "details:9080" "10.1.145.225:9080" outbound|9080||details.default.svc.cluster.local 10.1.145.234:33398 10.152.183.85:9080 10.1.145.234:36428 - default
[2023-04-14T06:57:17.594Z] "GET /reviews/0 HTTP/1.1" 200 - via_upstream - "-" 0 375 16 16 "-" "curl/7.81.0" "47b009d9-fac5-9893-ab40-ecd1c418c6aa" "reviews:9080" "10.1.145.222:9080" outbound|9080||reviews.default.svc.cluster.local 10.1.145.234:42066 10.152.183.192:9080 10.1.145.234:32852 - default
[2023-04-14T06:57:17.572Z] "GET /productpage HTTP/1.1" 200 - via_upstream - "-" 0 5537 43 42 "192.168.1.101" "curl/7.81.0" "47b009d9-fac5-9893-ab40-ecd1c418c6aa" "192.168.1.101:31737" "10.1.145.234:9080" inbound|9080|| 127.0.0.6:42741 10.1.145.234:9080 192.168.1.101:0 outbound_.9080_.v2_.productpage.default.svc.cluster.local default
Logs version 1 :
2023-04-14T06:40:01.221009Z info xdsproxy connected to upstream XDS server: istiod.istio-system.svc:15012
2023-04-14T06:48:48.309551Z info xdsproxy connected to upstream XDS server: istiod.istio-system.svc:15012
[2023-04-14T06:56:49.059Z] "GET /reviews/0 HTTP/1.1" 200 - via_upstream - "-" 0 295 7 6 "-" "curl/7.81.0" "4d887152-418d-93aa-9a48-3a361029d56a" "reviews:9080" "10.1.145.229:9080" inbound|9080|| 127.0.0.6:54095 10.1.145.229:9080 10.1.145.203:33048 outbound_.9080_._.reviews.default.svc.cluster.local default
[2023-04-14T06:56:49.039Z] "GET /details/0 HTTP/1.1" 200 - via_upstream - "-" 0 178 3 2 "-" "curl/7.81.0" "4d887152-418d-93aa-9a48-3a361029d56a" "details:9080" "10.1.145.225:9080" inbound|9080|| 127.0.0.6:54139 10.1.145.225:9080 10.1.145.203:42046 outbound_.9080_._.details.default.svc.cluster.local default
[2023-04-14T06:56:49.028Z] "GET /details/0 HTTP/1.1" 200 - via_upstream - "-" 0 178 15 14 "-" "curl/7.81.0" "4d887152-418d-93aa-9a48-3a361029d56a" "details:9080" "10.1.145.225:9080" outbound|9080||details.default.svc.cluster.local 10.1.145.203:42046 10.152.183.85:9080 10.1.145.203:33648 - default
[2023-04-14T06:56:49.049Z] "GET /reviews/0 HTTP/1.1" 200 - via_upstream - "-" 0 295 17 16 "-" "curl/7.81.0" "4d887152-418d-93aa-9a48-3a361029d56a" "reviews:9080" "10.1.145.229:9080" outbound|9080||reviews.default.svc.cluster.local 10.1.145.203:33048 10.152.183.192:9080 10.1.145.203:60114 - default
[2023-04-14T06:56:49.019Z] "GET /productpage HTTP/1.1" 200 - via_upstream - "-" 0 4183 51 50 "192.168.1.101" "curl/7.81.0" "4d887152-418d-93aa-9a48-3a361029d56a" "192.168.1.101:31737" "10.1.145.203:9080" inbound|9080|| 127.0.0.6:43735 10.1.145.203:9080 192.168.1.101:0 outbound_.9080_.v1_.productpage.default.svc.cluster.local default
[2023-04-14T06:56:51.072Z] "GET /ratings/0 HTTP/1.1" 200 - via_upstream - "-" 0 48 2 1 "-" "curl/7.81.0" "6a3e0baf-f73a-9973-9854-b06ea90e9eac" "ratings:9080" "10.1.145.228:9080" inbound|9080|| 127.0.0.6:46601 10.1.145.228:9080 10.1.145.222:57574 outbound_.9080_._.ratings.default.svc.cluster.local default
[2023-04-14T06:56:51.034Z] "GET /details/0 HTTP/1.1" 200 - via_upstream - "-" 0 178 3 2 "-" "curl/7.81.0" "6a3e0baf-f73a-9973-9854-b06ea90e9eac" "details:9080" "10.1.145.225:9080" inbound|9080|| 127.0.0.6:38931 10.1.145.225:9080 10.1.145.203:42054 outbound_.9080_._.details.default.svc.cluster.local default
[2023-04-14T06:56:51.031Z] "GET /details/0 HTTP/1.1" 200 - via_upstream - "-" 0 178 6 5 "-" "curl/7.81.0" "6a3e0baf-f73a-9973-9854-b06ea90e9eac" "details:9080" "10.1.145.225:9080" outbound|9080||details.default.svc.cluster.local 10.1.145.203:42054 10.152.183.85:9080 10.1.145.203:33660 - default
[2023-04-14T06:56:51.044Z] "GET /reviews/0 HTTP/1.1" 200 - via_upstream - "-" 0 375 36 35 "-" "curl/7.81.0" "6a3e0baf-f73a-9973-9854-b06ea90e9eac" "reviews:9080" "10.1.145.222:9080" outbound|9080||reviews.default.svc.cluster.local 10.1.145.203:41080 10.152.183.192:9080 10.1.145.203:60118 - default
[2023-04-14T06:56:51.023Z] "GET /productpage HTTP/1.1" 200 - via_upstream - "-" 0 5179 61 60 "192.168.1.101" "curl/7.81.0" "6a3e0baf-f73a-9973-9854-b06ea90e9eac" "192.168.1.101:31737" "10.1.145.203:9080" inbound|9080|| 127.0.0.6:36383 10.1.145.203:9080 192.168.1.101:0 outbound_.9080_.v1_.productpage.default.svc.cluster.local default
[2023-04-14T06:56:54.085Z] "GET /ratings/0 HTTP/1.1" 200 - via_upstream - "-" 0 48 1 1 "-" "curl/7.81.0" "41970b96-2dfa-9fc2-9846-b66cc930a2e8" "ratings:9080" "10.1.145.228:9080" inbound|9080|| 127.0.0.6:46601 10.1.145.228:9080 10.1.145.224:46272 outbound_.9080_._.ratings.default.svc.cluster.local default
[2023-04-14T06:56:54.043Z] "GET /details/0 HTTP/1.1" 200 - via_upstream - "-" 0 178 2 2 "-" "curl/7.81.0" "41970b96-2dfa-9fc2-9846-b66cc930a2e8" "details:9080" "10.1.145.225:9080" inbound|9080|| 127.0.0.6:54139 10.1.145.225:9080 10.1.145.203:42046 outbound_.9080_._.details.default.svc.cluster.local default
[2023-04-14T06:56:54.043Z] "GET /details/0 HTTP/1.1" 200 - via_upstream - "-" 0 178 3 3 "-" "curl/7.81.0" "41970b96-2dfa-9fc2-9846-b66cc930a2e8" "details:9080" "10.1.145.225:9080" outbound|9080||details.default.svc.cluster.local 10.1.145.203:42046 10.152.183.85:9080 10.1.145.203:48768 - default
[2023-04-14T06:56:54.055Z] "GET /reviews/0 HTTP/1.1" 200 - via_upstream - "-" 0 379 38 37 "-" "curl/7.81.0" "41970b96-2dfa-9fc2-9846-b66cc930a2e8" "reviews:9080" "10.1.145.224:9080" outbound|9080||reviews.default.svc.cluster.local 10.1.145.203:34646 10.152.183.192:9080 10.1.145.203:41306 - default
[2023-04-14T06:56:54.034Z] "GET /productpage HTTP/1.1" 200 - via_upstream - "-" 0 5183 62 61 "192.168.1.101" "curl/7.81.0" "41970b96-2dfa-9fc2-9846-b66cc930a2e8" "192.168.1.101:31737" "10.1.145.203:9080" inbound|9080|| 127.0.0.6:48027 10.1.145.203:9080 192.168.1.101:0 outbound_.9080_.v1_.productpage.default.svc.cluster.local default
[2023-04-14T06:57:03.057Z] "GET /ratings/0 HTTP/1.1" 200 - via_upstream - "-" 0 48 2 1 "-" "curl/7.81.0" "7c61f2d1-b3bd-9c91-b974-608129617c16" "ratings:9080" "10.1.145.228:9080" inbound|9080|| 127.0.0.6:43263 10.1.145.228:9080 10.1.145.224:46272 outbound_.9080_._.ratings.default.svc.cluster.local default
[2023-04-14T06:57:03.037Z] "GET /details/0 HTTP/1.1" 200 - via_upstream - "-" 0 178 2 2 "-" "curl/7.81.0" "7c61f2d1-b3bd-9c91-b974-608129617c16" "details:9080" "10.1.145.225:9080" inbound|9080|| 127.0.0.6:54139 10.1.145.225:9080 10.1.145.203:42046 outbound_.9080_._.details.default.svc.cluster.local default
[2023-04-14T06:57:03.037Z] "GET /details/0 HTTP/1.1" 200 - via_upstream - "-" 0 178 3 3 "-" "curl/7.81.0" "7c61f2d1-b3bd-9c91-b974-608129617c16" "details:9080" "10.1.145.225:9080" outbound|9080||details.default.svc.cluster.local 10.1.145.203:42046 10.152.183.85:9080 10.1.145.203:58372 - default
[2023-04-14T06:57:03.048Z] "GET /reviews/0 HTTP/1.1" 200 - via_upstream - "-" 0 379 15 15 "-" "curl/7.81.0" "7c61f2d1-b3bd-9c91-b974-608129617c16" "reviews:9080" "10.1.145.224:9080" outbound|9080||reviews.default.svc.cluster.local 10.1.145.203:34646 10.152.183.192:9080 10.1.145.203:35588 - default
[2023-04-14T06:57:03.027Z] "GET /productpage HTTP/1.1" 200 - via_upstream - "-" 0 5183 42 41 "192.168.1.101" "curl/7.81.0" "7c61f2d1-b3bd-9c91-b974-608129617c16" "192.168.1.101:31737" "10.1.145.203:9080" inbound|9080|| 127.0.0.6:47739 10.1.145.203:9080 192.168.1.101:0 outbound_.9080_.v1_.productpage.default.svc.cluster.local default
[2023-04-14T06:57:06.545Z] "GET /details/0 HTTP/1.1" 200 - via_upstream - "-" 0 178 2 1 "-" "curl/7.81.0" "1a5886d3-3a72-98fd-9479-bdf569014450" "details:9080" "10.1.145.225:9080" inbound|9080|| 127.0.0.6:38931 10.1.145.225:9080 10.1.145.234:56106 outbound_.9080_._.details.default.svc.cluster.local default
[2023-04-14T06:57:06.572Z] "GET /ratings/0 HTTP/1.1" 200 - via_upstream - "-" 0 48 1 1 "-" "curl/7.81.0" "1a5886d3-3a72-98fd-9479-bdf569014450" "ratings:9080" "10.1.145.228:9080" inbound|9080|| 127.0.0.6:43263 10.1.145.228:9080 10.1.145.222:46854 outbound_.9080_._.ratings.default.svc.cluster.local default
[2023-04-14T06:57:10.707Z] "GET /details/0 HTTP/1.1" 200 - via_upstream - "-" 0 178 3 2 "-" "curl/7.81.0" "bb067a74-342a-9e59-9c7b-9de5bc3da348" "details:9080" "10.1.145.225:9080" inbound|9080|| 127.0.0.6:54139 10.1.145.225:9080 10.1.145.203:42046 outbound_.9080_._.details.default.svc.cluster.local default
[2023-04-14T06:57:10.707Z] "GET /details/0 HTTP/1.1" 200 - via_upstream - "-" 0 178 4 4 "-" "curl/7.81.0" "bb067a74-342a-9e59-9c7b-9de5bc3da348" "details:9080" "10.1.145.225:9080" outbound|9080||details.default.svc.cluster.local 10.1.145.203:42046 10.152.183.85:9080 10.1.145.203:58374 - default
[2023-04-14T06:57:10.717Z] "GET /reviews/0 HTTP/1.1" 200 - via_upstream - "-" 0 375 14 14 "-" "curl/7.81.0" "bb067a74-342a-9e59-9c7b-9de5bc3da348" "reviews:9080" "10.1.145.222:9080" outbound|9080||reviews.default.svc.cluster.local 10.1.145.203:41080 10.152.183.192:9080 10.1.145.203:35598 - default
[2023-04-14T06:57:10.698Z] "GET /productpage HTTP/1.1" 200 - via_upstream - "-" 0 5179 38 37 "192.168.1.101" "curl/7.81.0" "bb067a74-342a-9e59-9c7b-9de5bc3da348" "192.168.1.101:31737" "10.1.145.203:9080" inbound|9080|| 127.0.0.6:33537 10.1.145.203:9080 192.168.1.101:0 outbound_.9080_.v1_.productpage.default.svc.cluster.local default
[2023-04-14T06:57:10.726Z] "GET /ratings/0 HTTP/1.1" 200 - via_upstream - "-" 0 48 1 1 "-" "curl/7.81.0" "bb067a74-342a-9e59-9c7b-9de5bc3da348" "ratings:9080" "10.1.145.228:9080" inbound|9080|| 127.0.0.6:43263 10.1.145.228:9080 10.1.145.222:46854 outbound_.9080_._.ratings.default.svc.cluster.local default
[2023-04-14T06:57:14.342Z] "GET /details/0 HTTP/1.1" 200 - via_upstream - "-" 0 178 2 2 "-" "curl/7.81.0" "30166699-78ac-9ac0-ad9f-ab3f7d207c35" "details:9080" "10.1.145.225:9080" inbound|9080|| 127.0.0.6:54139 10.1.145.225:9080 10.1.145.203:42046 outbound_.9080_._.details.default.svc.cluster.local default
[2023-04-14T06:57:14.342Z] "GET /details/0 HTTP/1.1" 200 - via_upstream - "-" 0 178 3 3 "-" "curl/7.81.0" "30166699-78ac-9ac0-ad9f-ab3f7d207c35" "details:9080" "10.1.145.225:9080" outbound|9080||details.default.svc.cluster.local 10.1.145.203:42046 10.152.183.85:9080 10.1.145.203:41124 - default
[2023-04-14T06:57:14.351Z] "GET /reviews/0 HTTP/1.1" 200 - via_upstream - "-" 0 379 19 19 "-" "curl/7.81.0" "30166699-78ac-9ac0-ad9f-ab3f7d207c35" "reviews:9080" "10.1.145.224:9080" outbound|9080||reviews.default.svc.cluster.local 10.1.145.203:34646 10.152.183.192:9080 10.1.145.203:50540 - default
[2023-04-14T06:57:14.333Z] "GET /productpage HTTP/1.1" 200 - via_upstream - "-" 0 5183 41 40 "192.168.1.101" "curl/7.81.0" "30166699-78ac-9ac0-ad9f-ab3f7d207c35" "192.168.1.101:31737" "10.1.145.203:9080" inbound|9080|| 127.0.0.6:42289 10.1.145.203:9080 192.168.1.101:0 outbound_.9080_.v1_.productpage.default.svc.cluster.local default
[2023-04-14T06:57:14.363Z] "GET /ratings/0 HTTP/1.1" 200 - via_upstream - "-" 0 48 2 1 "-" "curl/7.81.0" "30166699-78ac-9ac0-ad9f-ab3f7d207c35" "ratings:9080" "10.1.145.228:9080" inbound|9080|| 127.0.0.6:46081 10.1.145.228:9080 10.1.145.224:42516 outbound_.9080_._.ratings.default.svc.cluster.local default
[2023-04-14T06:57:17.584Z] "GET /details/0 HTTP/1.1" 200 - via_upstream - "-" 0 178 2 2 "-" "curl/7.81.0" "47b009d9-fac5-9893-ab40-ecd1c418c6aa" "details:9080" "10.1.145.225:9080" inbound|9080|| 127.0.0.6:38931 10.1.145.225:9080 10.1.145.234:33398 outbound_.9080_._.details.default.svc.cluster.local default
[2023-04-14T06:57:17.602Z] "GET /ratings/0 HTTP/1.1" 200 - via_upstream - "-" 0 48 3 2 "-" "curl/7.81.0" "47b009d9-fac5-9893-ab40-ecd1c418c6aa" "ratings:9080" "10.1.145.228:9080" inbound|9080|| 127.0.0.6:42885 10.1.145.228:9080 10.1.145.222:57574 outbound_.9080_._.ratings.default.svc.cluster.local default
Can anyone help me out with this?
I think that problem is somewhere in the manifest, but I cannot find it.