通过Consul运行Istio的bookInfo示例时出错

时间:2018-12-19 14:41:06

标签: consul istio

我按照所有说明从website部署Istio和bookInfo示例。当我应用'bookinfo.sidecars.yaml'文件时,出现此错误:

ERROR: Service 'details-v1-init' uses the network stack of container 'consul_details-v1_1' which does not exist.

有任何线索/建议吗? docker ps的输出如下。 谢谢。

# docker ps

CONTAINER ID        IMAGE                                                  COMMAND                  CREATED             STATUS              PORTS                                                                                                             NAMES
b0e0101a3eee        istio/examples-bookinfo-reviews-v3:1.8.0               "/opt/ibm/docker/doc…"   10 hours ago        Up 10 hours         9080/tcp, 9443/tcp                                                                                                consul_reviews-v3_1_28883479b3a9
537541698e6d        istio/examples-bookinfo-details-v1:1.8.0               "/bin/sh -c 'ruby de…"   10 hours ago        Up 10 hours         9080/tcp                                                                                                          consul_details-v1_1_cdccfbf1a4f4
5f99a4af633e        istio/examples-bookinfo-reviews-v2:1.8.0               "/opt/ibm/docker/doc…"   10 hours ago        Up 10 hours         9080/tcp, 9443/tcp                                                                                                consul_reviews-v2_1_862dda9b3ebb
7168373c7151        istio/examples-bookinfo-ratings-v1:1.8.0               "/bin/sh -c 'node /o…"   10 hours ago        Up 10 hours         9080/tcp                                                                                                          consul_ratings-v1_1_36958d99bd3c
7d49f4a2756f        istio/examples-bookinfo-productpage-v1:1.8.0           "/bin/sh -c 'python …"   10 hours ago        Up 10 hours         0.0.0.0:9081->9080/tcp                                                                                            consul_productpage-v1_1_c76939929d14
c7a48c76955c        istio/examples-bookinfo-reviews-v1:1.8.0               "/opt/ibm/docker/doc…"   10 hours ago        Up 10 hours         9080/tcp, 9443/tcp                                                                                                consul_reviews-v1_1_d5ff8edaea77
584d82ad2f9d        istio/pilot:1.0.4                                      "/usr/local/bin/pilo…"   10 hours ago        Up 10 hours         15003/tcp, 15005/tcp, 0.0.0.0:8081->15007/tcp                                                                     consul_pilot_1_a886d8efde70
2ea3814a9430        openzipkin/zipkin:2.7                                  "/bin/sh -c 'test -n…"   10 hours ago        Up 10 hours         9410/tcp, 0.0.0.0:9411->9411/tcp                                                                                  consul_zipkin_1_1adb4c433f62
620b53b530a9        gcr.io/google_containers/kube-apiserver-amd64:v1.7.3   "kube-apiserver --et…"   10 hours ago        Up 10 hours         0.0.0.0:8080->8080/tcp                                                                                            consul_istio-apiserver_1_74bc95072d1d
ab2c2f5a529b        quay.io/coreos/etcd:latest                             "/usr/local/bin/etcd…"   10 hours ago        Up 10 hours         0.0.0.0:2379-2380->2379-2380/tcp, 0.0.0.0:4001->4001/tcp                                                          consul_etcd_1_a16aeb2d7508
529adeda3b3f        gliderlabs/consul-server                               "/bin/consul agent -…"   10 hours ago        Up 10 hours         0.0.0.0:8400->8400/tcp, 8300-8302/tcp, 8600/tcp, 8301-8302/udp, 0.0.0.0:8500->8500/tcp, 172.28.0.1:53->8600/udp   consul_consul_1_3d8dd30c0067
1846d35812e2        gliderlabs/registrator:latest                          "/bin/registrator -i…"   10 hours ago        Up 10 hours                                                                                                                           consul_registrator_1_cbcf37b622e7

1 个答案:

答案 0 :(得分:0)

network_mode 与 docker 的 --network 参数相同。所以它在同一个网络中制作了两个容器。就像使用 K8S 时在同一个 Pod 中的两个容器一样。而在 docker-compose 中,它支持一种特殊的形式:“container:[container name/id]”,这使得新容器在 container name/id 指定的旧容器的相同网络空间中工作。 所以你最好把bookinfo.sidecars.yaml中的consul_details-v1_1更新为consul_details-v1_1_cdccfbf1a4f4,这样可以让sidecar容器和主容器通信。您还应该更新 consul_ratings-v1_1 以及 consul_productpage-v1_1consul_reviews-v1_1 等。