Git Product home page Git Product logo

dahora's Introduction

Istio Distributed Tracing Mission

Purpose

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

Prerequisites

  1. Openshift 3.9 cluster

  2. Istio 0.7.1 with authentication installed on the aforementioned cluster. To install Istio simply follow one of the following docs:

  3. Enable automatic sidecar injection for Istio (See this for details)

    In order for Istio automatic sidecar injection to work properly, the following Istio configuration needs to be in place:

    1. The policy field is set to disabled in the istio-inject configmap of the istio-system namespace. This can be checked by inspecting the output of

      oc get configmap istio-inject -o jsonpath='{.data.config}' -n istio-system | grep policy
    2. The istio-sidecar-injector MutatingWebhookConfiguration should not limit the injection to properly labeled namespaces, If Istio was installed using the default settings, then make sure the output of

      oc get MutatingWebhookConfiguration istio-sidecar-injector -o jsonpath='{.webhooks[0].namespaceSelector}' -n istio-system`

      is empty. It is advised however that you inspect the output of

      oc get MutatingWebhookConfiguration istio-sidecar-injector -o yaml

      to make sure that no other "filters" have been applied.

  4. Expose services and Istio ingress:

    oc expose svc istio-ingress -n istio-system
  5. 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>

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 package 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=spring-boot-istio-distributed-tracing-booster-greeting-service -p SOURCE_REPOSITORY_URL=https://github.com/snowdrop/spring-boot-istio-distributed-tracing-booster -p SOURCE_REPOSITORY_REF=master -p SOURCE_REPOSITORY_DIR=spring-boot-istio-distributed-tracing-greeting-service
    oc new-app --template=spring-boot-istio-distributed-tracing-booster-cute-name-service -p SOURCE_REPOSITORY_URL=https://github.com/snowdrop/spring-boot-istio-distributed-tracing-booster -p SOURCE_REPOSITORY_REF=master -p SOURCE_REPOSITORY_DIR=spring-boot-istio-distributed-tracing-cute-name-service

Use Cases

Configure an ingress Route to access the application

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

        oc create -f rules/route-rule-redir.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-ingress -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>

dahora's People

Contributors

openshiftio-launchpad avatar

Watchers

James Cloos avatar Elvis Rocha avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.