Skip to content

About

Envoy xDS control plane library for Java: SotW and delta ADS, in make-before-break order

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

448 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Envoy xDS

Forked from transferwise/wise-envoy-xds, originally developed at Wise.

Envoy xDS is an Envoy ADS implementation. It provides the framework necessary to correctly sequence xDS updates towards Envoy instances. See the envoy xDS docs for details of the protocol.

This is not a service mesh control plane, it is a library that can be used to implement one.

Why did you write this?

There wasn't a choice at the time. It was originally written at Wise, where the first production deployment was in early 2018, making it one of the first xDS implementations to be deployed large scale to a production environment. It went on to form the core of EGADS, Wise's service mesh control plane, and was open sourced as transferwise/wise-envoy-xds. This repository is an independently maintained fork of that project.

Does it do anything special?

Its main features are:

  • Make before break - It sequences the different discovery service updates to ensure they get applied in a safe order, as per the xDS protocol spec;
  • Easy to implement an incremental control plane;
  • Highly customisable behaviour per client;
  • Workarounds for various envoy behaviours/bugs.

Does it scale?

In the largest cluster at Wise it ran about 25 network changes a second through it, with up to around 1000 envoys per instance, resulting in peaks of emitting around 333 DeltaDiscoveryResponses per second for a single instance (plus handling the corresponding acks from envoy.) Is that good? I have no idea. But mostly its Pods ticked along at under half a core. This isn't very quantitative, is it? But I guess the answer is - it scales well enough under non-trivial loads.

Use

docs/USAGE.md is a guide to building a control plane with it: a quick start with snapshots, per-client config, writing your own sources and config builders, NACKs, reconnects, threads, metrics and testing against a real Envoy. docs/ARCHITECTURE.md explains how it works, for anyone about to change it.

envoy-xds-example contains a toy example ADS, documented here. Any implementation will need to provide a dependency on a version of the Envoy API supported by the envoy version they run, e.g. net.woaf.jono.envoy:envoy-api, which is published for each Envoy release.

Versioning

The library has a compile-only dependency on net.woaf.jono.envoy:envoy-api, built from the oldest Envoy release the e2e tests cover. It relies only on classes and fields that are common to all versions of the v3 API, there is no dependency on anything known to be envoy version specific.

Users of the library can depend on the net.woaf.jono.envoy:envoy-api version matching the Envoy they run. Other builds of the same protos, such as com.transferwise.envoy:envoy-api or java-control-plane's io.envoyproxy.controlplane:api, should also work, as the generated packages are the same.

The e2e tests run the conformance suite against every Envoy release upstream supports, 1.36 to 1.40, over both SotW and delta ADS. They need Docker, and run four tests at a time, each with its own Envoy. To pick the versions and how many at once: ./gradlew :envoy-xds-e2e-tests:test -PenvoyVersions=1.36,1.40 -PtestParallelism=8. The suite and its harness live in envoy-xds-spec's conformance/, which every port runs, so this repo has the spec as a submodule at spec/: clone with --recurse-submodules, or run git submodule update --init. See Envoy's deprecation rules for specifics of what version you should choose.

In the future it's possible this library will support new API versions, or that the v3 API will change in some way that breaks compatibility. If that happens we'll have to introduce some compatibility shim.

History

  • Oct 2017 - PoC service mesh control plane implementing the original envoy REST api (API v1)
  • Nov 2017 - Rewritten to use the xDS API
  • Feb 2018 - Merged into our service registry (eureka-service) codebase, first production deployment!
  • Apr 2019 - Extracted into its own service, EGADS
  • Mar 2020 - Major overhaul to focus on the delta protocol
  • Nov 2020 - Dual API v2 and API v3 support (v2 later removed, but we can do it again for v4...)
  • May 2022 - Split xds package out of EGADS to allow open source release

Acknowledgements

Because this has moved between repos, blame will claim @JonathanO wrote all of it. It's nearly correct in terms of LoC, but nothing like this gets written in a vacuum. This would not have been possible without much collaborative white-boarding and passionate exchanges of ideas in Google Docs. It took us a while to work out what good looked like. The people who've worked on the proprietary service bridges, cluster manager and config builders that make up the rest of EGADS - this code would have been useless without your efforts! Thank you too to all the people who've discussed and reviewed PRs over the years, and the leads who believed it was worth investing time in.

License

Copyright 2022 Wise Plc. Copyright 2026 Jonathan Oddy.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

Envoy xDS control plane library for Java: SotW and delta ADS, in make-before-break order

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages