1 Star 0 Fork 0

keren_chen/istio-distributed-tracing-example

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

Istio Distributed Tracing Mission

Purpose

Showcase Istio’s Distributed Tracing via a (minimally) instrumented set of Spring Boot applications

Prerequisites

  1. Openshift 3.10 cluster

  2. Istio 1.0.x installed on the aforementioned cluster using the Istio Operator.

    1. Follow these instructions for more information about the Operator

  3. Login to the cluster with the admin user

Environment preparation

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>

Build and deploy the application

With Fabric8 Maven Plugin (FMP)

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.

With Source to Image build (S2I)

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

Use Cases

Access the application via the Istio ingress-gateway

  1. Create a RouteRule to forward traffic from istio-ingress to the demo application

        oc create -f rules/greeting-gateway.yml
  2. 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.

  3. Follow the instructions in the application UI

View application traces

  1. Access the Jaeger tracing dashboard

    The traces from the invocation of the two endpoints should look like the following:

    traces

    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

Undeploy the application

With Fabric8 Maven Plugin (FMP)

mvn fabric8:undeploy

With Source to Image build (S2I)

oc delete all --all
oc delete ingress --all
find . | grep openshiftio | grep application | xargs -n 1 oc delete -f

Remove the namespace

This will delete the project from the OpenShift cluster

oc delete project <your project name>

Integration tests

To run integration tests, create a new namespace and run maven job

oc new-project <project-name>
mvn clean verify -Popenshift,openshift-it

空文件

简介

https://github.com/snowdrop/istio-distributed-tracing-example.git 展开 收起
Java 等 2 种语言
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/keren_chen/istio-distributed-tracing-example.git
git@gitee.com:keren_chen/istio-distributed-tracing-example.git
keren_chen
istio-distributed-tracing-example
istio-distributed-tracing-example
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385