Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

route-rule do not work #6240

Closed
kinderyj opened this issue Jun 13, 2018 · 7 comments
Closed

route-rule do not work #6240

kinderyj opened this issue Jun 13, 2018 · 7 comments

Comments

@kinderyj
Copy link

kinderyj commented Jun 13, 2018

env:
istio version: 0.8
minikube
Mac

description:
I install the bookinfo app according to the doc:
https://istio.io/docs/tasks/traffic-management/request-routing/

and then create route-rule-all by this:
istioctl create -f samples/bookinfo/kube/route-rule-all-v1.yaml

I found this route-rule doesn't work,

Expected result:
the productpage is displayed with no rating stars since reviews:v1 does not access the ratings service.
Actual result:
route rule doen't work , I can still see the stars of v2 or v3.

kubectl get svc --all-namespaces
NAMESPACE      NAME                       TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)                                                               AGE
default        details                    ClusterIP      10.111.171.116   <none>        9080/TCP                                                              4h
default        kubernetes                 ClusterIP      10.96.0.1        <none>        443/TCP                                                               6d
default        productpage                ClusterIP      10.96.81.128     <none>        9080/TCP                                                              4h
default        ratings                    ClusterIP      10.97.111.166    <none>        9080/TCP                                                              4h
default        reviews                    ClusterIP      10.105.239.229   <none>        9080/TCP                                                              4h
istio-system   grafana                    ClusterIP      10.104.245.76    <none>        3000/TCP                                                              6d
istio-system   istio-citadel              ClusterIP      10.108.121.202   <none>        8060/TCP,9093/TCP                                                     6d
istio-system   istio-egressgateway        ClusterIP      10.99.134.236    <none>        80/TCP,443/TCP                                                        6d
istio-system   istio-ingressgateway       LoadBalancer   10.100.177.31    <pending>     80:31380/TCP,443:31390/TCP,31400:31400/TCP                            6d
istio-system   istio-pilot                ClusterIP      10.103.139.254   <none>        15003/TCP,15005/TCP,15007/TCP,15010/TCP,15011/TCP,8080/TCP,9093/TCP   6d
istio-system   istio-policy               ClusterIP      10.99.90.97      <none>        9091/TCP,15004/TCP,9093/TCP                                           6d
istio-system   istio-sidecar-injector     ClusterIP      10.98.150.122    <none>        443/TCP                                                               6d
istio-system   istio-statsd-prom-bridge   ClusterIP      10.103.206.238   <none>        9102/TCP,9125/UDP                                                     6d
istio-system   istio-telemetry            ClusterIP      10.103.136.193   <none>        9091/TCP,15004/TCP,9093/TCP,42422/TCP                                 6d
istio-system   prometheus                 ClusterIP      10.109.32.182    <none>        9090/TCP                                                              6d
istio-system   servicegraph               ClusterIP      10.101.103.144   <none>        8088/TCP                                                              6d
istio-system   tracing                    LoadBalancer   10.96.246.253    <pending>     80:31676/TCP                                                          6d
istio-system   zipkin                     ClusterIP      10.98.84.57      <none>        9411/TCP                                                              6d
kube-system    kube-dns                   ClusterIP      10.96.0.10       <none>        53/UDP,53/TCP                                                         6d
kube-system    kubernetes-dashboard       NodePort       10.100.38.42     <none>        80:30000/TCP                                                          6d
kubectl get pod --all-namespaces
NAMESPACE      NAME                                       READY     STATUS      RESTARTS   AGE
default        details-v1-7b97668445-hrmkw                2/2       Running     3          4h
default        productpage-v1-7bbdd59459-dgvp2            2/2       Running     3          4h
default        ratings-v1-76dc7f6b9-4rvml                 2/2       Running     3          4h
default        reviews-v1-64545d97b4-fgmhg                2/2       Running     3          4h
default        reviews-v2-8cb9489c6-62mlg                 2/2       Running     3          4h
default        reviews-v3-6bc884b456-p4gxk                2/2       Running     3          4h
istio-system   grafana-6f6dff9986-qc9hl                   1/1       Running     6          6d
istio-system   istio-citadel-7bdc7775c7-nnlsr             1/1       Running     6          6d
istio-system   istio-cleanup-old-ca-l4f6d                 0/1       Completed   0          6d
istio-system   istio-egressgateway-795fc9b47-ndjbb        1/1       Running     11         6d
istio-system   istio-ingressgateway-7d89dbf85f-ssncr      1/1       Running     11         6d
istio-system   istio-mixer-post-install-959d8             0/1       Completed   0          6d
istio-system   istio-pilot-66f4dd866c-gv4sq               2/2       Running     20         6d
istio-system   istio-policy-76c8896799-4pf9q              2/2       Running     14         6d
istio-system   istio-sidecar-injector-645c89bc64-vc8vf    1/1       Running     20         6d
istio-system   istio-statsd-prom-bridge-949999c4c-4zctp   1/1       Running     6          6d
istio-system   istio-telemetry-6554768879-jdp9w           2/2       Running     13         6d
istio-system   istio-tracing-754cdfd695-mjlld             1/1       Running     17         6d
istio-system   prometheus-86cb6dd77c-498wd                1/1       Running     6          6d
istio-system   servicegraph-5849b7d696-28rq2              1/1       Running     24         6d
kube-system    etcd-minikube                              1/1       Running     0          1h
kube-system    kube-addon-manager-minikube                1/1       Running     9          6d
kube-system    kube-apiserver-minikube                    1/1       Running     0          1h
kube-system    kube-controller-manager-minikube           1/1       Running     0          1h
kube-system    kube-dns-86f4d74b45-jnbjv                  3/3       Running     36         6d
kube-system    kube-proxy-cg4sf                           1/1       Running     0          1h
kube-system    kube-scheduler-minikube                    1/1       Running     3          6h
kube-system    kubernetes-dashboard-5498ccf677-c9zqb      1/1       Running     28         6d
kube-system    storage-provisioner                        1/1       Running     29         6d
kubectl get pod
NAME                              READY     STATUS    RESTARTS   AGE
details-v1-7b97668445-hrmkw       2/2       Running   3          4h
productpage-v1-7bbdd59459-dgvp2   2/2       Running   3          4h
ratings-v1-76dc7f6b9-4rvml        2/2       Running   3          4h
reviews-v1-64545d97b4-fgmhg       2/2       Running   3          4h
reviews-v2-8cb9489c6-62mlg        2/2       Running   3          4h
reviews-v3-6bc884b456-p4gxk       2/2       Running   3          4h
kubectl get svc
NAME          TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)    AGE
details       ClusterIP   10.111.171.116   <none>        9080/TCP   4h
kubernetes    ClusterIP   10.96.0.1        <none>        443/TCP    6d
productpage   ClusterIP   10.96.81.128     <none>        9080/TCP   4h
ratings       ClusterIP   10.97.111.166    <none>        9080/TCP   4h
reviews       ClusterIP   10.105.239.229   <none>        9080/TCP   4h
istioctl get routerules
NAME                  KIND                                 NAMESPACE
details-default       RouteRule.config.istio.io.v1alpha2   default
productpage-default   RouteRule.config.istio.io.v1alpha2   default
ratings-default       RouteRule.config.istio.io.v1alpha2   default
reviews-default       RouteRule.config.istio.io.v1alpha2   default
istioctl get routerules -oyaml
apiVersion: config.istio.io/v1alpha2
kind: RouteRule
metadata:
  creationTimestamp: null
  name: details-default
  namespace: default
  resourceVersion: "136955"
spec:
  destination:
    name: details
  precedence: 1
  route:
  - labels:
      version: v1
---
apiVersion: config.istio.io/v1alpha2
kind: RouteRule
metadata:
  creationTimestamp: null
  name: productpage-default
  namespace: default
  resourceVersion: "136952"
spec:
  destination:
    name: productpage
  precedence: 1
  route:
  - labels:
      version: v1
---
apiVersion: config.istio.io/v1alpha2
kind: RouteRule
metadata:
  creationTimestamp: null
  name: ratings-default
  namespace: default
  resourceVersion: "136954"
spec:
  destination:
    name: ratings
  precedence: 1
  route:
  - labels:
      version: v1
---
apiVersion: config.istio.io/v1alpha2
kind: RouteRule
metadata:
  creationTimestamp: null
  name: reviews-default
  namespace: default
  resourceVersion: "136953"
spec:
  destination:
    name: reviews
  precedence: 1
  route:
  - labels:
      version: v1
---
@sisiras
Copy link

sisiras commented Jun 14, 2018

I am having the same issue. Not sure if routing rules correctly picked up by the Istio mesh. Big thank for any help.

@frankbu
Copy link
Contributor

frankbu commented Jun 14, 2018

You are using the old version of this file: samples/bookinfo/kube/route-rule-all-v1.yaml. The new version (look closely at the doc) is in samples/bookinfo/routing/route-rule-all-v1.yaml

@sisiras
Copy link

sisiras commented Jun 14, 2018

@frankbu Thank you for your prompt reply. I used samples/bookinfo/routing/route-rule-all-v1.yaml.
I followed the issue appeared in istio/old_issues_repo#375 and tried with :
istioctl create -f samples/bookinfo/routing/route-rule-all-v1-mtls.yaml
but it is not successful.
Any help appreciated.
Thanks again

@frankbu
Copy link
Contributor

frankbu commented Jun 14, 2018

@sisiras: your problem sounds different than the one that @kinderyj is describing above (notice that the example above is using the bookinfo/kube version and it's creating RouteRule resources instead of VirtualServices).

It might be best if you open a different issue and describe the details of your configuration and show the output of the various commands in your case?

@sisiras
Copy link

sisiras commented Jun 14, 2018

@frankbu
Sure, I will open an issue.
Thanks again.

@kinderyj
Copy link
Author

@frankbu
thanks for your response;
2 points:

  1. In samples/bookinfo/kube/route-rule-all-v1.yaml (this version do not work for me), the kind is "RouteRule", you can get the router-rules by using command "istioctl get routerules";
  2. But, in samples/bookinfo/routing/route-rule-all-v1.yaml(this version work for me), the kind is "VirtualService" and "DestinationRule"; you will get nothing by using command "istioctl get routerules";
    Do you mean the kind "RouteRule" in samples/bookinfo/kube/route-rule-all-v1.yaml is deprecated?

@frankbu
Copy link
Contributor

frankbu commented Jun 15, 2018

@kinderyl: Yes, RouteRule is deprecated. To see the route rules, you now should use istioctl get virtualservices. You can read about this change here: https://istio.io/blog/2018/v1alpha3-routing/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants