• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.circleci/H17-Feb-2021-

.github/H17-Feb-2021-

build/H17-Feb-2021-

docs/H17-Feb-2021-

envoy/H17-Feb-2021-

examples/dyplomat/H17-Feb-2021-

internal/H17-Feb-2021-

pkg/H17-Feb-2021-

sample/H17-Feb-2021-

scripts/H17-Feb-2021-

support/H17-Feb-2021-

.codecov.ymlH A D17-Feb-202199

.gitignoreH A D17-Feb-2021184

CHANGELOG.mdH A D17-Feb-20211.8 KiB

CONTRIBUTING.mdH A D17-Feb-20219.3 KiB

Dockerfile.ciH A D17-Feb-2021728

LICENSEH A D17-Feb-202111.1 KiB

MakefileH A D17-Feb-20212.2 KiB

OWNERS.mdH A D17-Feb-2021454

README.mdH A D17-Feb-20215.2 KiB

go.modH A D17-Feb-2021543

go.sumH A D17-Feb-20218.9 KiB

README.md

1# control-plane
2
3[![CircleCI](https://circleci.com/gh/envoyproxy/go-control-plane.svg?style=svg)](https://circleci.com/gh/envoyproxy/go-control-plane)
4[![Go Report Card](https://goreportcard.com/badge/github.com/envoyproxy/go-control-plane)](https://goreportcard.com/report/github.com/envoyproxy/go-control-plane)
5[![GoDoc](https://godoc.org/github.com/envoyproxy/go-control-plane?status.svg)](https://godoc.org/github.com/envoyproxy/go-control-plane)
6
7This repository contains a Go-based implementation of an API server that
8implements the discovery service APIs defined in
9[data-plane-api](https://github.com/envoyproxy/data-plane-api).
10
11
12## Scope
13
14Due to the variety of platforms out there, there is no single
15control plane implementation that can satisfy everyone's needs. Hence this
16code base does not attempt to be a full scale control plane for a fleet of
17Envoy proxies. Instead, it provides infrastructure that is shared by
18multiple different control plane implementations. The components provided
19by this library are:
20
21* _API Server:_ A generic gRPC based API server that implements xDS APIs as defined
22  in the
23  [data-plane-api](https://github.com/envoyproxy/data-plane-api). The API
24  server is responsible for pushing configuration updates to
25  Envoys. Consumers should be able to import this go library and use the
26  API server as is, in production deployments.
27
28* _Configuration Cache:_ The library will cache Envoy configurations in
29memory in an attempt to provide fast response to consumer Envoys. It is the
30responsibility of the consumer of this library to populate the cache as
31well as invalidate it when necessary. The cache will be keyed based on a
32pre-defined hash function whose keys are based on the
33[Node information](https://github.com/envoyproxy/data-plane-api/blob/d4988844024d0bcff4bcd030552eabe3396203fa/api/base.proto#L26-L36).
34
35At this moment, this repository will not tackle translating platform
36specific representation of resources (e.g., services, instances of
37services, etc.) into Envoy-style configuration. Based on usage and
38feedback, we might decided to revisit this aspect at a later point in time.
39
40## Requirements
41
421. Go 1.11+
43
44## Quick start
45
46It's recommended to run the command with script `./build/run_docker.sh` as it executes the command
47in the same environment as the circle ci. This makes sure to produce a consistent set of generated files.
48
491. Setup existing build:
50
51    ```sh
52    ./build/run_docker.sh make build test
53    ```
54
551. Run [integration test](pkg/test/main/README.md) against the latest Envoy binary:
56
57    ```sh
58    ./build/run_docker.sh make integration
59    ```
60
611. Take a look at the [example server](internal/example/README.md).
62
63
64## XDS API versioning
65
66The Envoy xDS APIs follow a well defined [versioning scheme](https://www.envoyproxy.io/docs/envoy/latest/configuration/overview/versioning).
67Due to lack of generics and function overloading in golang, creating a new version unfortunately involves code duplication.
68Based on the discussion [here](https://docs.google.com/document/d/1ZkHpz6DwEUmAlG0kb2Mgu4iaeQC2Bbb0egMbECoNNKY/edit?ts=5e602993#heading=h.15nsmgmjaaml) and [here](https://envoyproxy.slack.com/archives/C7LDJTM6Z/p1582925082005300), go-control-plane is adopting a mechanism to create a new version from an existing version by running a script.
69In order to handle deprecated/new fields between versions, make sure to create a shim such that duplication remains minimal. One such example today is how different [resource urls](https://github.com/envoyproxy/go-control-plane/tree/master/pkg/resource) are handled.
70
71For authoring changes, make changes to v2 and at the end, use `make create_version` to create the v3 specific files.
72Make sure to run `make build` and `make test` to identify and fix failures.
73
74When v2 version is frozen in the future, we will change the experience such that changes will need to happen to v3 and autogen will create the v2 version instead.
75
76## Resource caching
77
78Because Envoy clients are assumed to be ephemeral, and thus, can come and go
79away arbitrarily, the server relies on a configuration cache to minimize the
80client load on the server. There are several caches available in this
81repository:
82
83- `Simple` cache is a snapshot-based cache that maintains a consistent view of
84  the configuration for each group of proxies. It supports running as an ADS
85  server or as regular dis-aggregated xDS servers. In ADS mode, the cache can
86  hold responses until the complete set of referenced resources is requested
87  (e.g. the entire set of RDS as referenced by LDS). Holding the response
88  enables an atomic update of xDS collections.
89
90- `Linear` is an eventually consistent cache for a single type URL collection.
91  The cache maintains a single linear version history and a version vector for
92  the resources in the cache. For each request, it compares the request version
93  against latest versions for the requested resources, and responds with any
94  updated resources. This cache assumes the resources are entirely opaque.
95
96- `Mux` cache is a simple cache combinator. It allows mixing multiple caches
97  for different type URLs, e.g use a simple cache for LDS/RDS/CDS and a linear
98  cache for EDS.
99
100## Usage
101
102The [example server](internal/example/README.md) demonstrates how to integrate the go-control-plane with your code.
103
104