Git Product home page Git Product logo

envoy-examples's Introduction

Envoy Traffic Control Examples

Overview

This repository is organized such that each commit adds more sophistication to the zipkin-tracing from the Envoy repository. Each step is tagged, so you can set the repository to a given step with

git checkout step<n>, e.g. git checkout step1.

The Envoy documentation provides a good overview of how to run the example.

We'll also use wrk and curl to drive load against our services.

We highly recommend you start with step1.

Step 6

In the last step we used header based routing to deploy a new service version before releasing it. In this step we'll execute an incremental release. We can leave our header-based routing in place, but add a new match rule that will activate 25% of the time. The runtime object in the route match tells Envoy to roll a 100 sided die, and if the result is less than the value of the runtime key (we default it to 25 here), then activate the match. By routing to a different cluster in this match, we can send a percentage of traffic to our new version.

                     retry_on: 5xx
                     num_retries: 3
                     per_try_timeout: 0.300s
+              - match:
+                  prefix: "/"
+                  runtime:
+                    default_value: 25
+                    runtime_key: routing.traffic_shift.helloworld
+                route:
+                  cluster: service1a
+                  retry_policy:
+                    retry_on: 5xx
+                    num_retries: 3
+                    per_try_timeout: 0.300s
               - match:
                   prefix: "/"
                 route:

Shut down your example, if needed by running

docker-compose down --remove-orphans

in the zipkin-tracing directory, and then start your example again by running

docker-compose up --build -d

Now if we make a request to our service with no headers we should see responses from service 1a about 25% of the time.

Wrapup

This touches on a number of Envoy traffic control features, but you can go much deeper. Our product, Houston provides a UI for configuring routes, along with a dashboard that lets you ensure that your changes haven't impacted customers.

There's also video of a talk I gave on these examples, as well as slides. If you have any questions, let me know, [email protected], or @mccv on Twitter.

envoy-examples's People

Contributors

mccv avatar

Stargazers

gc-ss avatar Whats_in_name avatar meodemsao avatar Claude Ebaneck avatar Oliver Mannion avatar Eddy Garcia avatar Kamil Sindi avatar Gopi Borra avatar Dmitri Kalintsev avatar

Watchers

 avatar Glen D Sanford avatar falun avatar James Cloos avatar doeg avatar kf avatar brook shelley avatar

Forkers

ggui

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.