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?
kubernetes istio spinnaker
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?
kubernetes istio spinnaker
Do you have other VS / DR defined than these ones? Maybe some are conflicting.
– Joel
Nov 19 at 13:16
Could you add information about your deployments (or whatever you have) of your application
– Artem Golenyaev
Nov 19 at 15:26
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?
kubernetes istio spinnaker
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?
kubernetes istio spinnaker
kubernetes istio spinnaker
edited Nov 19 at 14:22
Joel
1,4101119
1,4101119
asked Nov 19 at 10:41
Subit Das
63
63
Do you have other VS / DR defined than these ones? Maybe some are conflicting.
– Joel
Nov 19 at 13:16
Could you add information about your deployments (or whatever you have) of your application
– Artem Golenyaev
Nov 19 at 15:26
add a comment |
Do you have other VS / DR defined than these ones? Maybe some are conflicting.
– Joel
Nov 19 at 13:16
Could you add information about your deployments (or whatever you have) of your application
– Artem Golenyaev
Nov 19 at 15:26
Do you have other VS / DR defined than these ones? Maybe some are conflicting.
– Joel
Nov 19 at 13:16
Do you have other VS / DR defined than these ones? Maybe some are conflicting.
– Joel
Nov 19 at 13:16
Could you add information about your deployments (or whatever you have) of your application
– Artem Golenyaev
Nov 19 at 15:26
Could you add information about your deployments (or whatever you have) of your application
– Artem Golenyaev
Nov 19 at 15:26
add a comment |
3 Answers
3
active
oldest
votes
up vote
1
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
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
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.
Labels: app=web app.kubernetes.io/managed-by=spinnaker app.kubernetes.io/name=web pod-template-hash=2895261194 version=canary
– Subit Das
Nov 19 at 12:06
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
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
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
up vote
1
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 Nov 20 at 19:29
answered Nov 20 at 19:07
Frank B
36017
36017
add a comment |
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
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
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
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
answered Nov 20 at 4:25
Subit Das
63
63
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.
Labels: app=web app.kubernetes.io/managed-by=spinnaker app.kubernetes.io/name=web pod-template-hash=2895261194 version=canary
– Subit Das
Nov 19 at 12:06
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.
Labels: app=web app.kubernetes.io/managed-by=spinnaker app.kubernetes.io/name=web pod-template-hash=2895261194 version=canary
– Subit Das
Nov 19 at 12:06
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.
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.
answered Nov 19 at 11:09
Anna Slastnikova
392
392
Labels: app=web app.kubernetes.io/managed-by=spinnaker app.kubernetes.io/name=web pod-template-hash=2895261194 version=canary
– Subit Das
Nov 19 at 12:06
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
Nov 19 at 12:06
Labels: app=web app.kubernetes.io/managed-by=spinnaker app.kubernetes.io/name=web pod-template-hash=2895261194 version=canary
– Subit Das
Nov 19 at 12:06
Labels: app=web app.kubernetes.io/managed-by=spinnaker app.kubernetes.io/name=web pod-template-hash=2895261194 version=canary
– Subit Das
Nov 19 at 12:06
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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
Nov 19 at 13:16
Could you add information about your deployments (or whatever you have) of your application
– Artem Golenyaev
Nov 19 at 15:26