How to resolve Istio traffic routing bug?
up vote
1
down vote
favorite
For the below files , ISTIO is showing output in the first v1 app only. If I change the version of the v1 the output changes. So the traffic is not moving to the other version at all.
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: sampleweb
namespace: default
spec:
hosts:
- "web.xyz.com"
gateways:
- http-gateway
http:
- route:
- destination:
port:
number: 8080
host: web
subset: v1
weight: 30
- route:
- destination:
port:
number: 8080
host: web
subset: v2
weight: 30
- route:
- destination:
port:
number: 8080
host: web
subset: v3
weight: 40
---
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: samplewebdr
namespace: default
spec:
host: web
subsets:
- name: v1
labels:
app: web
version: prod
- name: v2
labels:
app: web
version: baseline
- name: v3
labels:
app: web
version: canary
trafficPolicy:
tls:
mode: ISTIO_MUTUAL
Can anyone please help on this?

New contributor
Subit Das is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
up vote
1
down vote
favorite
For the below files , ISTIO is showing output in the first v1 app only. If I change the version of the v1 the output changes. So the traffic is not moving to the other version at all.
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: sampleweb
namespace: default
spec:
hosts:
- "web.xyz.com"
gateways:
- http-gateway
http:
- route:
- destination:
port:
number: 8080
host: web
subset: v1
weight: 30
- route:
- destination:
port:
number: 8080
host: web
subset: v2
weight: 30
- route:
- destination:
port:
number: 8080
host: web
subset: v3
weight: 40
---
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: samplewebdr
namespace: default
spec:
host: web
subsets:
- name: v1
labels:
app: web
version: prod
- name: v2
labels:
app: web
version: baseline
- name: v3
labels:
app: web
version: canary
trafficPolicy:
tls:
mode: ISTIO_MUTUAL
Can anyone please help on this?

New contributor
Subit Das is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Do you have other VS / DR defined than these ones? Maybe some are conflicting.
– Joel
2 days ago
Could you add information about your deployments (or whatever you have) of your application
– Artem Golenyaev
2 days ago
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
For the below files , ISTIO is showing output in the first v1 app only. If I change the version of the v1 the output changes. So the traffic is not moving to the other version at all.
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: sampleweb
namespace: default
spec:
hosts:
- "web.xyz.com"
gateways:
- http-gateway
http:
- route:
- destination:
port:
number: 8080
host: web
subset: v1
weight: 30
- route:
- destination:
port:
number: 8080
host: web
subset: v2
weight: 30
- route:
- destination:
port:
number: 8080
host: web
subset: v3
weight: 40
---
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: samplewebdr
namespace: default
spec:
host: web
subsets:
- name: v1
labels:
app: web
version: prod
- name: v2
labels:
app: web
version: baseline
- name: v3
labels:
app: web
version: canary
trafficPolicy:
tls:
mode: ISTIO_MUTUAL
Can anyone please help on this?

New contributor
Subit Das is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
For the below files , ISTIO is showing output in the first v1 app only. If I change the version of the v1 the output changes. So the traffic is not moving to the other version at all.
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: sampleweb
namespace: default
spec:
hosts:
- "web.xyz.com"
gateways:
- http-gateway
http:
- route:
- destination:
port:
number: 8080
host: web
subset: v1
weight: 30
- route:
- destination:
port:
number: 8080
host: web
subset: v2
weight: 30
- route:
- destination:
port:
number: 8080
host: web
subset: v3
weight: 40
---
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: samplewebdr
namespace: default
spec:
host: web
subsets:
- name: v1
labels:
app: web
version: prod
- name: v2
labels:
app: web
version: baseline
- name: v3
labels:
app: web
version: canary
trafficPolicy:
tls:
mode: ISTIO_MUTUAL
Can anyone please help on this?


New contributor
Subit Das is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Subit Das is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited 2 days ago
Joel
1,4101119
1,4101119
New contributor
Subit Das is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 2 days ago


Subit Das
61
61
New contributor
Subit Das is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Subit Das is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Subit Das is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Do you have other VS / DR defined than these ones? Maybe some are conflicting.
– Joel
2 days ago
Could you add information about your deployments (or whatever you have) of your application
– Artem Golenyaev
2 days ago
add a comment |
Do you have other VS / DR defined than these ones? Maybe some are conflicting.
– Joel
2 days ago
Could you add information about your deployments (or whatever you have) of your application
– Artem Golenyaev
2 days ago
Do you have other VS / DR defined than these ones? Maybe some are conflicting.
– Joel
2 days ago
Do you have other VS / DR defined than these ones? Maybe some are conflicting.
– Joel
2 days ago
Could you add information about your deployments (or whatever you have) of your application
– Artem Golenyaev
2 days ago
Could you add information about your deployments (or whatever you have) of your application
– Artem Golenyaev
2 days ago
add a comment |
3 Answers
3
active
oldest
votes
up vote
0
down vote
There were some indentation issues. I resolved it referring the following links
https://raw.githubusercontent.com/istio/istio/release-1.0/samples/bookinfo/networking/destination-rule-all-mtls.yaml
New contributor
Subit Das is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
up vote
0
down vote
Your problem is that you have created a VirtualService
with 3 rules in it. The first rule, which has no specific match criteria, is therefore always the one that gets invoked. When you have multiple rules in a VirtualService
, you need to be careful to order them properly, as described here.
That said, in your case, you really don't want multiple rules, but rather a single rule with multiple weighted destinations like this:
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: sampleweb
namespace: default
spec:
hosts:
- "web.xyz.com"
gateways:
- http-gateway
http:
- route:
- destination:
port:
number: 8080
host: web
subset: v1
weight: 30
- destination:
port:
number: 8080
host: web
subset: v2
weight: 30
- destination:
port:
number: 8080
host: web
subset: v3
weight: 40
Btw, although harmless, you don't need to include the app: web
label in you DestinationRule
subsets. You only need the labels that uniquely identify the difference between the subsets of the web service.
add a comment |
up vote
-1
down vote
I think the problem is that for all versions you've got the same label app: web
so istio directs traffic to pods with these labels they're just happened to be the same pod. You need to specify different labels for different versions like vor v2 the label is version: v1
, for v2 - version: v2
and you also need to create pods with these labels.
New contributor
Anna Slastnikova is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Labels: app=web app.kubernetes.io/managed-by=spinnaker app.kubernetes.io/name=web pod-template-hash=2895261194 version=canary
– Subit Das
2 days ago
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
There were some indentation issues. I resolved it referring the following links
https://raw.githubusercontent.com/istio/istio/release-1.0/samples/bookinfo/networking/destination-rule-all-mtls.yaml
New contributor
Subit Das is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
up vote
0
down vote
There were some indentation issues. I resolved it referring the following links
https://raw.githubusercontent.com/istio/istio/release-1.0/samples/bookinfo/networking/destination-rule-all-mtls.yaml
New contributor
Subit Das is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
up vote
0
down vote
up vote
0
down vote
There were some indentation issues. I resolved it referring the following links
https://raw.githubusercontent.com/istio/istio/release-1.0/samples/bookinfo/networking/destination-rule-all-mtls.yaml
New contributor
Subit Das is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
There were some indentation issues. I resolved it referring the following links
https://raw.githubusercontent.com/istio/istio/release-1.0/samples/bookinfo/networking/destination-rule-all-mtls.yaml
New contributor
Subit Das is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Subit Das is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
answered yesterday


Subit Das
61
61
New contributor
Subit Das is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Subit Das is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Subit Das is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
add a comment |
up vote
0
down vote
Your problem is that you have created a VirtualService
with 3 rules in it. The first rule, which has no specific match criteria, is therefore always the one that gets invoked. When you have multiple rules in a VirtualService
, you need to be careful to order them properly, as described here.
That said, in your case, you really don't want multiple rules, but rather a single rule with multiple weighted destinations like this:
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: sampleweb
namespace: default
spec:
hosts:
- "web.xyz.com"
gateways:
- http-gateway
http:
- route:
- destination:
port:
number: 8080
host: web
subset: v1
weight: 30
- destination:
port:
number: 8080
host: web
subset: v2
weight: 30
- destination:
port:
number: 8080
host: web
subset: v3
weight: 40
Btw, although harmless, you don't need to include the app: web
label in you DestinationRule
subsets. You only need the labels that uniquely identify the difference between the subsets of the web service.
add a comment |
up vote
0
down vote
Your problem is that you have created a VirtualService
with 3 rules in it. The first rule, which has no specific match criteria, is therefore always the one that gets invoked. When you have multiple rules in a VirtualService
, you need to be careful to order them properly, as described here.
That said, in your case, you really don't want multiple rules, but rather a single rule with multiple weighted destinations like this:
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: sampleweb
namespace: default
spec:
hosts:
- "web.xyz.com"
gateways:
- http-gateway
http:
- route:
- destination:
port:
number: 8080
host: web
subset: v1
weight: 30
- destination:
port:
number: 8080
host: web
subset: v2
weight: 30
- destination:
port:
number: 8080
host: web
subset: v3
weight: 40
Btw, although harmless, you don't need to include the app: web
label in you DestinationRule
subsets. You only need the labels that uniquely identify the difference between the subsets of the web service.
add a comment |
up vote
0
down vote
up vote
0
down vote
Your problem is that you have created a VirtualService
with 3 rules in it. The first rule, which has no specific match criteria, is therefore always the one that gets invoked. When you have multiple rules in a VirtualService
, you need to be careful to order them properly, as described here.
That said, in your case, you really don't want multiple rules, but rather a single rule with multiple weighted destinations like this:
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: sampleweb
namespace: default
spec:
hosts:
- "web.xyz.com"
gateways:
- http-gateway
http:
- route:
- destination:
port:
number: 8080
host: web
subset: v1
weight: 30
- destination:
port:
number: 8080
host: web
subset: v2
weight: 30
- destination:
port:
number: 8080
host: web
subset: v3
weight: 40
Btw, although harmless, you don't need to include the app: web
label in you DestinationRule
subsets. You only need the labels that uniquely identify the difference between the subsets of the web service.
Your problem is that you have created a VirtualService
with 3 rules in it. The first rule, which has no specific match criteria, is therefore always the one that gets invoked. When you have multiple rules in a VirtualService
, you need to be careful to order them properly, as described here.
That said, in your case, you really don't want multiple rules, but rather a single rule with multiple weighted destinations like this:
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: sampleweb
namespace: default
spec:
hosts:
- "web.xyz.com"
gateways:
- http-gateway
http:
- route:
- destination:
port:
number: 8080
host: web
subset: v1
weight: 30
- destination:
port:
number: 8080
host: web
subset: v2
weight: 30
- destination:
port:
number: 8080
host: web
subset: v3
weight: 40
Btw, although harmless, you don't need to include the app: web
label in you DestinationRule
subsets. You only need the labels that uniquely identify the difference between the subsets of the web service.
edited 23 hours ago
answered 23 hours ago
Frank B
34817
34817
add a comment |
add a comment |
up vote
-1
down vote
I think the problem is that for all versions you've got the same label app: web
so istio directs traffic to pods with these labels they're just happened to be the same pod. You need to specify different labels for different versions like vor v2 the label is version: v1
, for v2 - version: v2
and you also need to create pods with these labels.
New contributor
Anna Slastnikova is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Labels: app=web app.kubernetes.io/managed-by=spinnaker app.kubernetes.io/name=web pod-template-hash=2895261194 version=canary
– Subit Das
2 days ago
add a comment |
up vote
-1
down vote
I think the problem is that for all versions you've got the same label app: web
so istio directs traffic to pods with these labels they're just happened to be the same pod. You need to specify different labels for different versions like vor v2 the label is version: v1
, for v2 - version: v2
and you also need to create pods with these labels.
New contributor
Anna Slastnikova is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Labels: app=web app.kubernetes.io/managed-by=spinnaker app.kubernetes.io/name=web pod-template-hash=2895261194 version=canary
– Subit Das
2 days ago
add a comment |
up vote
-1
down vote
up vote
-1
down vote
I think the problem is that for all versions you've got the same label app: web
so istio directs traffic to pods with these labels they're just happened to be the same pod. You need to specify different labels for different versions like vor v2 the label is version: v1
, for v2 - version: v2
and you also need to create pods with these labels.
New contributor
Anna Slastnikova is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I think the problem is that for all versions you've got the same label app: web
so istio directs traffic to pods with these labels they're just happened to be the same pod. You need to specify different labels for different versions like vor v2 the label is version: v1
, for v2 - version: v2
and you also need to create pods with these labels.
New contributor
Anna Slastnikova is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Anna Slastnikova is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
answered 2 days ago
Anna Slastnikova
392
392
New contributor
Anna Slastnikova is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Anna Slastnikova is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Anna Slastnikova is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Labels: app=web app.kubernetes.io/managed-by=spinnaker app.kubernetes.io/name=web pod-template-hash=2895261194 version=canary
– Subit Das
2 days ago
add a comment |
Labels: app=web app.kubernetes.io/managed-by=spinnaker app.kubernetes.io/name=web pod-template-hash=2895261194 version=canary
– Subit Das
2 days ago
Labels: app=web app.kubernetes.io/managed-by=spinnaker app.kubernetes.io/name=web pod-template-hash=2895261194 version=canary
– Subit Das
2 days ago
Labels: app=web app.kubernetes.io/managed-by=spinnaker app.kubernetes.io/name=web pod-template-hash=2895261194 version=canary
– Subit Das
2 days ago
add a comment |
Subit Das is a new contributor. Be nice, and check out our Code of Conduct.
Subit Das is a new contributor. Be nice, and check out our Code of Conduct.
Subit Das is a new contributor. Be nice, and check out our Code of Conduct.
Subit Das is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53372861%2fhow-to-resolve-istio-traffic-routing-bug%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Do you have other VS / DR defined than these ones? Maybe some are conflicting.
– Joel
2 days ago
Could you add information about your deployments (or whatever you have) of your application
– Artem Golenyaev
2 days ago