Showcase Istio’s Distributed Tracing via a (minimally) instrumented set of Spring Boot applications
Openshift 3.10 cluster
Istio 1.0.x installed on the aforementioned cluster using the Istio Operator.
Follow these instructions for more information about the Operator
Login to the cluster with the admin user
Create a new project/namespace on the cluster. This is where your application will be deployed.
oc new-project <whatever valid project name you want>
In OpenShift each service account must be granted permissions with the anyuid and privileged Security Context Constraints (SCC) to enable the sidecars to run correctly.
oc adm policy add-scc-to-user anyuid -z default -n <whatever valid project name you want>
oc adm policy add-scc-to-user privileged -z default -n <whatever valid project name you want>
Execute the following command to build the project and deploy it to OpenShift:
mvn clean fabric8:deploy -Popenshift
Configuration for FMP may be found both in pom.xml and src/main/fabric8
files/folders.
This configuration is used to define service names and deployments that control how pods are labeled/versioned on the OpenShift cluster. Labels and versions are key concepts for creating load-balanced or multi-versioned pods in a service.
Run the following commands to apply and execute the OpenShift templates that will configure and deploy the applications:
find . | grep openshiftio | grep application | xargs -n 1 oc apply -f
oc new-app --template=istio-distributed-tracing-example-greeting-service -p SOURCE_REPOSITORY_URL=https://github.com/snowdrop/istio-distributed-tracing-example -p SOURCE_REPOSITORY_REF=master -p SOURCE_REPOSITORY_DIR=spring-boot-istio-distributed-tracing-greeting-service
oc new-app --template=istio-distributed-tracing-example-cute-name-service -p SOURCE_REPOSITORY_URL=https://github.com/snowdrop/istio-distributed-tracing-example -p SOURCE_REPOSITORY_REF=master -p SOURCE_REPOSITORY_DIR=spring-boot-istio-distributed-tracing-cute-name-service
Create a RouteRule to forward traffic from istio-ingress to the demo application
oc create -f rules/greeting-gateway.yml
Access the application
Run the following command to determine the appropriate URL to access our demo. Make sure you access the url with the HTTP scheme. HTTPS is NOT enabled by default:
echo http://$(oc get route istio-ingressgateway -o jsonpath='{.spec.host}{"\n"}' -n istio-system)/greeting/
The result of the above command is the istio-system istio-ingress URL, appended with the RouteRule path. Open this URL in your a web browser.
Follow the instructions in the application UI
Access the Jaeger tracing dashboard
The traces from the invocation of the two endpoints should look like the following:
Note that it could take a few seconds for all the spans to be collected and presented in a trace that matches the picture above
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。