istio: cannot access book info example

Describe the bug I followed the steps to install istio and the book info example. i got down as far as accessing the service https://istio.io/docs/examples/bookinfo/#confirm-the-app-is-running.

$ kubectl get svc istio-ingressgateway -n istio-system
NAME                   TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)                                                                                                     AGE
istio-ingressgateway   LoadBalancer   10.107.177.68   localhost     80:31380/TCP,443:31390/TCP,31400:31400/TCP,15011:31531/TCP,8060:30656/TCP,15030:32388/TCP,15031:31829/TCP   52m

I am running docker for mac with kubernetes and have a feeling that this is the issue.

Expected behavior I expected to access the service on the nodeport and host localhost

Steps to reproduce the bug Install istio on docker for mac with kubernetes locally and install the book info example.

Version


$ istioctl version
Version: 1.0.0
GitRevision: 3a136c90ec5e308f236e0d7ebb5c4c5e405217f4
User: root@71a9470ea93c
Hub: gcr.io/istio-release
GolangVersion: go1.10.1
BuildStatus: Clean
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.3", GitCommit:"2bba0127d85d5a46ab4b778548be28623b32d0b0", GitTreeState:"clean", BuildDate:"2018-05-21T09:17:39Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.3", GitCommit:"2bba0127d85d5a46ab4b778548be28623b32d0b0", GitTreeState:"clean", BuildDate:"2018-05-21T09:05:37Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}

Is Istio Auth enabled or not? I installed without mutual TLS kubectl apply -f install/kubernetes/istio-demo.yaml

Environment Docker for mac version 18.06.0-ce-mac69

Services


$ kubectl get services
NAME          TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)    AGE
details       ClusterIP   10.104.19.162    <none>        9080/TCP   1h
kubernetes    ClusterIP   10.96.0.1        <none>        443/TCP    28d
productpage   ClusterIP   10.99.191.13     <none>        9080/TCP   1h
ratings       ClusterIP   10.101.138.190   <none>        9080/TCP   1h
reviews       ClusterIP   10.103.132.194   <none>        9080/TCP   1h
sleep         ClusterIP   10.97.58.54      <none>        80/TCP     1h

pods

$ kubectl get pods
NAME                           READY     STATUS    RESTARTS   AGE
details-v1-6865b9b99d-nhw2q    2/2       Running   0          1h
productpage-v1-f8c8fb8-6d6rs   2/2       Running   0          1h
ratings-v1-77f657f55d-xb9nf    2/2       Running   0          1h
reviews-v1-6b7f6db5c5-7fklj    2/2       Running   0          1h
reviews-v2-7ff5966b99-jlm67    2/2       Running   0          1h
reviews-v3-5df889bcff-v4t7m    2/2       Running   0          1h
sleep-86f6b99f94-xwr7b         2/2       Running   0          1h

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 31 (7 by maintainers)

Most upvoted comments

I’m using Docker Desktop for Mac (v2.5.0.1) and I don’t see any issues now. The EXTERNAL-IP value is set to localhost. You can see this when you do: kubectl get svc istio-ingressgateway -n istio-system

Therefore, make sure the INGRESS_PORT is set to 80. export INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].port}')

Set INGRESS_HOST as follows: export INGRESS_HOST=127.0.0.1

Set GATEWAY_URL: export GATEWAY_URL=$INGRESS_HOST:$INGRESS_PORT

echo $GATEWAY_URL should show 127.0.0.1:80

Try accessing productpage from the browser like http://localhost/productpage. This should work!

I am having the same problem. I’m using Mac with Docker for Desktop installed (k8s running too). Istio v1.5.2 and bookinfo deployment is fine. I have defined both gateway and virtual service, but unable to access http://localhost/productpage

I was testing kubernetes supplied by docker-for-mac with istio 1.0.5 where encountered the exact same problem. I deployed the stack by using a istio-demo.yaml file. Took me a while to figure out the routing issue. I found out that the problem is from Gateway resource from that file. It had a wrong pod selector. The correct one should be istio: ingressgateway but the package contains just istio: ingress

Here is a working copy

apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: istio-autogenerated-k8s-ingress
  namespace: istio-system
spec:
  selector:
    istio: ingressgateway
  servers:
  - port:
      number: 80
      protocol: HTTP2
      name: http
    hosts:
    - "*"

Once updated, technically, you should be able to access http://localhost/productpage straightaway. However, In my case, I needed to restart an isio-ingressgateway controller pod in istio-system. I shouldn’t need to do that tho.

Following the documentation in https://istio.io/latest/docs/setup/getting-started/ doesnt end up with the correct link , namely http://localhost/productpage. Please fix documentation

I met the same problem in docker for mac with istio installed that can not open access book info product page with http://localhost/productpage, as following the troubleshooting instructions:

istio-1.0.2 kubectl get svc -n istio-system
NAME                       TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)                                                                                                                   AGE
grafana                    ClusterIP      10.100.116.141   <none>        3000/TCP                                                                                                                  1d
istio-citadel              ClusterIP      10.108.72.29     <none>        8060/TCP,9093/TCP                                                                                                         1d
istio-egressgateway        ClusterIP      10.102.66.3      <none>        80/TCP,443/TCP                                                                                                            1d
istio-galley               ClusterIP      10.99.138.132    <none>        443/TCP,9093/TCP                                                                                                          1d
istio-ingressgateway       LoadBalancer   10.106.78.166    localhost     80:31380/TCP,443:31390/TCP,31400:31400/TCP,15011:32523/TCP,8060:31900/TCP,853:32209/TCP,15030:30291/TCP,15031:31182/TCP   1d
istio-pilot                ClusterIP      10.97.204.147    <none>        15010/TCP,15011/TCP,8080/TCP,9093/TCP                                                                                     1d
istio-policy               ClusterIP      10.102.205.125   <none>        9091/TCP,15004/TCP,9093/TCP                                                                                               1d
istio-sidecar-injector     ClusterIP      10.108.52.252    <none>        443/TCP                                                                                                                   1d
istio-statsd-prom-bridge   ClusterIP      10.103.154.220   <none>        9102/TCP,9125/UDP                                                                                                         1d
istio-telemetry            ClusterIP      10.110.145.2     <none>        9091/TCP,15004/TCP,9093/TCP,42422/TCP                                                                                     1d
jaeger-agent               ClusterIP      None             <none>        5775/UDP,6831/UDP,6832/UDP                                                                                                1d
jaeger-collector           ClusterIP      10.109.15.202    <none>        14267/TCP,14268/TCP                                                                                                       1d
jaeger-query               ClusterIP      10.102.135.101   <none>        16686/TCP                                                                                                                 1d
prometheus                 ClusterIP      10.98.106.248    <none>        9090/TCP                                                                                                                  1d
servicegraph               ClusterIP      10.110.182.120   <none>        8088/TCP                                                                                                                  1d
tracing                    ClusterIP      10.106.207.170   <none>        80/TCP                                                                                                                    1d
zipkin                     ClusterIP      10.100.192.34    <none>        9411/TCP                                                                                                                  1d
➜  istio-1.0.2 kubectl get pods -n istio-system
NAME                                        READY     STATUS      RESTARTS   AGE
grafana-6cbdcfb45-xskvg                     1/1       Running     0          1d
istio-citadel-6b6fdfdd6f-7td4k              1/1       Running     0          1d
istio-cleanup-secrets-p7fbb                 0/1       Completed   0          1d
istio-egressgateway-56bdd5fcfb-nscpn        1/1       Running     0          1d
istio-galley-96464ff6-68g56                 1/1       Running     0          1d
istio-grafana-post-install-7fqwb            0/1       Completed   0          1d
istio-ingressgateway-7f4dd7d699-kv66d       1/1       Running     0          32s
istio-pilot-6f8d49d4c4-b5ss2                0/2       Pending     0          1d
istio-policy-67f4d49564-qkjnf               2/2       Running     0          1d
istio-sidecar-injector-69c4bc7974-b4px4     1/1       Running     0          1d
istio-statsd-prom-bridge-7f44bb5ddb-29q2g   1/1       Running     0          1d
istio-telemetry-76869cd64f-j955t            2/2       Running     0          1d
istio-tracing-ff94688bb-6r8ph               1/1       Running     0          1d
prometheus-84bd4b9796-t2nvv                 1/1       Running     0          1d
servicegraph-c6456d6f5-f8zt5                1/1       Running     0          1d
➜  istio-1.0.2 kubectl -n istio-system exec -it istio-ingressgateway-7f4dd7d699-kv66d -- netstat -ant
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 127.0.0.1:15000         0.0.0.0:*               LISTEN
tcp        0      0 10.1.0.131:41084        10.97.204.147:15010     ESTABLISHED

even I restart the istio-ingressgateway pod, is this a common issue?

I meet a problem,I start the bookinfo application without changing any yaml files: kubectl apply -f <(istioctl kube-injct -f bookinfo.yaml) And start the gateway: kubectl apply -f bookinfo-gateway.yaml Then try to access the productpage service use the port:31380 image access the service failed,I tried several times,can not work. But,It can be access when I start the gateway again. The first is failed,the second time is successful,why?