Вызов службы из мультиконтейнера с коляской Istio - PullRequest
0 голосов
/ 01 ноября 2018

У меня есть две капсулы с двумя контейнерами. В каждом модуле один контейнер - это прокси-сервер Istio (Envoy)

$ kubectl get pods
NAME                                     READY   STATUS    RESTARTS   AGE
helloserver-744bf7487-m426t              2/2     Running   0          14h
helloworld-deployment-7dfc7db54d-d4ddf   2/2     Running   0          15h

У меня есть служба helloworld в модуле helloworld-deployment-7dfc7db54d-d4ddf. Я хочу вызвать этот сервис из helloserver-744bf7487-m426t pod.

$kubectl get services
NAME                 TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)          AGE
helloserver          NodePort    10.100.244.253   <none>        9095:30161/TCP   13h
helloworld-service   NodePort    10.111.142.95    <none>        9095:32685/TCP   14h

Я использовал команду,

$ kubectl exec -it helloserver-744bf7487-m426t -c helloserver -- \bin\sh\
> curl http://helloworld-service:9095/helloworld/

Но выдает ошибку как,

OCI runtime exec failed: exec failed: container_linux.go:348: starting container process caused "exec: \"binshcurl\": executable file not found in $PATH": unknown
command terminated with exit code 126

Как вызвать этот сервис?

1 Ответ

0 голосов
/ 01 ноября 2018

Просто используйте следующую команду:

kubectl exec -it helloserver-744bf7487-m426t -c helloserver -- curl http://helloworld-service:9095/helloworld/
...