MCPcopy Index your code
hub / github.com/envoyproxy/go-control-plane

github.com/envoyproxy/go-control-plane @v0.14.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.14.0 ↗ · + Follow
58,423 symbols 109,990 edges 1,995 files 25,649 documented · 44% 190 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

control-plane

OpenSSF Scorecard CI Status Go Report Card GoDoc

This repository contains a Go-based implementation of an API server that implements the discovery service APIs defined in data-plane-api.

Proto files

The Go proto files are synced from the upstream Envoy repository (https://github.com/envoyproxy/envoy) on every upstream commit.

Synchronization is triggered using the envoy-sync.yaml workflow.

Scope

Due to the variety of platforms out there, there is no single control plane implementation that can satisfy everyone's needs. Hence this code base does not attempt to be a full scale control plane for a fleet of Envoy proxies. Instead, it provides infrastructure that is shared by multiple different control plane implementations. The components provided by this library are:

  • API Server: A generic gRPC based API server that implements xDS APIs as defined in the data-plane-api. The API server is responsible for pushing configuration updates to Envoys. Consumers should be able to import this go library and use the API server as is, in production deployments.

  • Configuration Cache: The library will cache Envoy configurations in memory in an attempt to provide fast response to consumer Envoys. It is the responsibility of the consumer of this library to populate the cache as well as invalidate it when necessary. The cache will be keyed based on a pre-defined hash function whose keys are based on the Node information.

At this moment, this repository will not tackle translating platform specific representation of resources (e.g., services, instances of services, etc.) into Envoy-style configuration. Based on usage and feedback, we might decide to revisit this aspect at a later point in time.

Requirements

  1. Go 1.23+

Quick start

It's recommended to run the tests with make docker_tests as it executes the tests in the same environment as CI. This makes sure to produce a consistent set of generated files.

  1. Build and run tests:

    sh make docker_tests

  2. Take a look at the example server.

XDS API versioning

The Envoy xDS APIs follow a well defined versioning scheme.

Deprecated

V2 control-plane code has been removed and will no longer be supported. For previous conversations on support for various xDS versions, see here: - here - here

Note: It is recommended to use a previous SHA if there is still a need for V2.

Resource caching

Because Envoy clients are assumed to be ephemeral, and thus, can come and go away arbitrarily, the server relies on a configuration cache to minimize the client load on the server. There are several caches available in this repository:

  • Simple cache is a snapshot-based cache that maintains a consistent view of the configuration for each group of proxies. It supports running as an ADS server or as regular dis-aggregated xDS servers. In ADS mode, the cache can hold responses until the complete set of referenced resources is requested (e.g. the entire set of RDS as referenced by LDS). Holding the response enables an atomic update of xDS collections.

  • Linear is an eventually consistent cache for a single type URL collection. The cache maintains a single linear version history and a version vector for the resources in the cache. For each request, it compares the request version against latest versions for the requested resources, and responds with any updated resources. This cache assumes the resources are entirely opaque.

  • Mux cache is a simple cache combinator. It allows mixing multiple caches for different type URLs, e.g use a simple cache for LDS/RDS/CDS and a linear cache for EDS.

Usage

The example server demonstrates how to integrate the go-control-plane with your code.

Extension points exported contracts — how you extend this code

ResourceWithName (Interface)
ResourceWithName provides a name for out-of-tree resources. [175 implementers]
pkg/cache/types/types.go
Stream (Interface)
Generic RPC stream for state of the world. [100 implementers]
pkg/server/stream/v3/stream.go
Logger (Interface)
Logger interface for reporting informational and warning messages. [5 implementers]
pkg/log/log.go
DataInput (Interface)
DataInput describes a type that can extract an input value from the MatchingData. [5 implementers]
xdsmatcher/pkg/matcher/types/types.go
ADSClient (Interface)
ADSClient is a SoTW and ADS based generic gRPC xDS client which can be used to implement an xDS client which fetches res [1 …
pkg/client/sotw/v3/client.go
Generator (Interface)
Generator interface defines the ability to grab token providers based on the cluster name [1 implementers]
examples/dyplomat/auth.go
ConfigFetcher (Interface)
ConfigFetcher fetches configuration resources from cache [7 implementers]
pkg/cache/v3/cache.go
DeltaStream (Interface)
Generic RPC Stream for the delta based xDS protocol. [100 implementers]
pkg/server/stream/v3/stream.go

Core symbols most depended-on inside this repo

Validate
called by 306
envoy/config/route/v3/route_components.pb.validate.go
Validate
called by 214
envoy/api/v2/route/route_components.pb.validate.go
Errorf
called by 178
pkg/log/log.go
ValidateAll
called by 153
envoy/config/route/v3/route_components.pb.validate.go
Validate
called by 132
envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.pb.validate.go
Validate
called by 126
envoy/config/bootstrap/v3/bootstrap.pb.validate.go
Validate
called by 124
envoy/config/cluster/v3/cluster.pb.validate.go
ValidateAll
called by 107
envoy/api/v2/route/route_components.pb.validate.go

Shape

Method 48,162
Struct 5,341
Function 2,312
TypeAlias 2,003
Interface 603
FuncType 2

Languages

Go100%

Modules by API surface

envoy/config/route/v3/route_components.pb.go826 symbols
envoy/config/route/v3/route_components.pb.validate.go741 symbols
envoy/api/v2/route/route_components.pb.go574 symbols
envoy/api/v2/route/route_components.pb.validate.go494 symbols
envoy/config/route/v3/route_components_vtproto.pb.go408 symbols
envoy/config/cluster/v3/cluster.pb.go353 symbols
envoy/config/core/v3/base.pb.validate.go351 symbols
envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.pb.go330 symbols
envoy/config/core/v3/base.pb.go318 symbols
envoy/config/cluster/v3/cluster.pb.validate.go312 symbols
envoy/config/bootstrap/v3/bootstrap.pb.validate.go286 symbols
envoy/api/v2/route/route_components_vtproto.pb.go284 symbols

For agents

$ claude mcp add go-control-plane \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact