Coder Social home page Coder Social logo

envoy-pilot's Introduction

Envoy-Pilot

Build Status Version docker pulls

Envoy Pilot or Envoy xDS is a control plane implementation for Envoy written in Golang and uses Consul for persistence by default. It can also run without Consul by loading configuration from file.

This is an extension of go-control-plane

Currently Supports

  • CDS
  • LDS
  • RDS
  • EDS
  • ADS (for CDS & LDS)

Note: Some infrequent configurations might not be mapped. Feel free to PR

Checkout Envoy XDS PROTOCOL Overview for more detail

Also Checkout Sample Project

File Config

Checkout the above example to load config from file

Consul Usage

xDS Server will be exposed on port 7777

Run Envoy Proxy with the following configurations or use --service-node && --service-cluster

node:
  id: ride-service-replica-2
  cluster: ride-service

Every *DS requires two keys to be set in consul

  • config
  • version

And the key template is xDS/app-cluster/ride-service/CDS/(config|version)

For CDS add KV pairs

  • xDS/app-cluster/ride-service/CDS/version => "1.0"
  • xDS/app-cluster/ride-service/CDS/config => "[{ { "name": "app1", "connect_timeout": "0.250s", "type": "STRICT_DNS", "lb_policy": "RANDOM", "hosts": [{ "socket_address": { "address": "127.0.0.2", "port_value": 1234 } }] } }]"

Pushing new configuration

  • Envoy-Pilot will be polling for version change every 10 seconds.
  • If there is a version mismatch for any of xDS/app-cluster/ride-service/(CDS|LDS|RDS|EDS)/version then new config xDS/app-cluster/ride-service/(CDS|LDS|RDS|EDS)/config will be pushed to subscriber envoy.
  • If update succeed there will be an ACK log for the instance.

Running Docker Compose

From root directory

docker network create envoy-pilot_xds-demo
docker-compose -f docker-compose.consul.yaml up
docker-compose -f docker-compose.server.yaml up --build

Running test

cd test/integration
docker-compose up --build

cd test/rspec
DEVMODE=true rspec basic_spec.rb --order defined --format documentation

Runnnig Docker

Consul url need to be set in .env

env_values.txt

CONSUL_PATH="http://consul-server:8500"
CONSUL_PREFIX=""xDS"

Docker run

docker run -v $(pwd)/env_values.txt:/.env -p 7777:7777 -p 9090:9090 tak2siva/envoy-pilot:latest

Helm Chart

Install using the Helm Chart for Envoy-Pilot.

Debugging

  • xDS-Server is running on port 7777
  • A http server is running on port 9090 for debugging

localhost:9090/dump/KEY_TEMPLATE will give a json dump of proto mapping

Ex:

http://localhost:9090/dump/xDS/app-cluster/ride-service/(CDS|LDS|RDS|EDS)/config
  • To get list of subcsribers hit localhost:9090/dump/subscribers/

Prometheus metrics

Prometheus is running on localhost:8081/metrics and the following stats are available

  • xds_active_connections[cluster] (GAUGE)
  • xds_active_subscribers[cluster][type] (GAUGE)
  • xds_update_counter[cluster][subscribedTo] (Counter)

envoy-pilot's People

Contributors

alexberry avatar tak2siva avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

envoy-pilot's Issues

DEVMODE=true rspec ./basic_spec.rb --order defined --format documentation

An error occurred while loading ./basic_spec.rb.
Failure/Error: return gem_original_require(path)

LoadError:
cannot load such file -- plissken

./basic_spec.rb:3:in `<top (required)>'

No examples found.

Finished in 0.00108 seconds (files took 0.63475 seconds to load)
0 examples, 0 failures, 1 error occurred outside of examples

Cluster tls_context config not sent to Envoy

Hi,

I'm testing Envoy-Pilot as control-plane for envoys using the File Config method.

All looks good except I'm having problems supplying tls_context config through cds. This results in envoys using http to the backend, when I want them to use https.

The same configuration works just fine when configuring envoys statically.

My CDS.yaml file looks like this:

- name: service1
  connect_timeout: 15.0s
  type: STATIC
  dns_lookup_family: V4_ONLY
  lb_policy: ROUND_ROBIN
  hosts: 
  - socket_address: 
      address: 10.10.10.20 
      port_value: 443
  tls_context:
    sni: www.examplehost.com

Config_dump from enoy does not include tls_context config.

   "@type": "type.googleapis.com/envoy.admin.v2alpha.ClustersConfigDump",
   "version_info": "bha00nbfmjktkn861csg",
   "static_clusters": [
    {
     "cluster": {
      "name": "xds_cluster",
      "type": "STRICT_DNS",
      "connect_timeout": "0.250s",
      "hosts": [
       {
        "socket_address": {
         "address": "10.10.10.10",
         "port_value": 7777
        }
       }
      ],
      "http2_protocol_options": {},
      "dns_refresh_rate": "5s"
     },
     "last_updated": "2019-02-01T08:16:29.946Z"
    }
   ],
   "dynamic_active_clusters": [
    {
     "version_info": "bha00nbfmjktkn861csg",
     "cluster": {
      "name": "service1",
      "connect_timeout": "15s",
      "hosts": [
       {
        "socket_address": {
         "address": "10.10.10.20",
         "port_value": 443
        }
       }
      ]
     },
     "last_updated": "2019-02-01T08:16:29.953Z"
    }
   ]
  },```

Is what I'm trying to archive possible through cds, or is there something wrong with my syntax in the CDS.yaml file? 

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.