OpenShift Service 4 of Mesh Tutorial (2) - Micro-service deployment of Istio

This section will deploy three micro-services, their relationship below: Backend_v1 background and will be forwarded to the Frontend_v1 Backend_v2 receive user requests.
Here Insert Picture Description

  1. Execute command to deploy three micro-services and related objects. After completion of the operation can be seen Pod 3, there are two each Pod Container (wherein a Container is automatically injected sidecar).
$ oc apply -f ocp/backend-v1-deployment.yml -n my-istio-app
$ oc apply -f ocp/backend-v2-deployment.yml -n my-istio-app
$ oc apply -f ocp/backend-service.yml -n my-istio-app
$ oc apply -f ocp/frontend-v1-deployment.yml -n my-istio-app
$ oc apply -f ocp/frontend-service.yml -n my-istio-app
$ oc apply -f ocp/frontend-route.yml -n my-istio-app
$ oc get pod -n my-istio-app
NAME                          READY   STATUS    RESTARTS   AGE
backend-v1-6ddf9c7dcf-zmn4b   2/2     Running   0          12h
backend-v2-7655885b8c-qg4d7   2/2     Running   0          12h
frontend-v1-655f4478c-9dwnv   2/2     Running   0          12h
  1. Access frontend micro-services. backend-v1 backend-v2 and is called a random, wherein a backend-v1 is short, but with longer time backend-v2
$ export FRONTEND_URL=http://$(oc get route frontend -n my-istio-app -o jsonpath='{.status.ingress[0].host}')
$ curl $FRONTEND_URL -s -w "\nElapsed Time:%{time_total}\n"
Frontend version: v1 => [Backend: http://backend:8080, Response: 200, Body: Backend version:v1,Response:200,Host:backend-v1-6ddf9c7dcf-zmn4b, Message: Hello World!!]
Elapsed Time:1.236257
$ curl $FRONTEND_URL -s -w "\nElapsed Time:%{time_total}\n"
Frontend version: v1 => [Backend: http://backend:8080, Response: 200, Body: Backend version:v2,Response:200,Host:backend-v2-7655885b8c-qg4d7, Message: Hello World!!]
Elapsed Time:6.092146
Published 54 original articles · won praise 0 · Views 1091

Guess you like

Origin blog.csdn.net/weixin_43902588/article/details/103840040