Skip to content

Commit a3735fb

Browse files
authored
api: document the fact that v3 is forever (envoyproxy#24081)
Signed-off-by: Matt Klein <[email protected]>
1 parent 8d78246 commit a3735fb

File tree

4 files changed

+27
-186
lines changed

4 files changed

+27
-186
lines changed

api/API_VERSIONING.md

+19-132
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,22 @@ stability.
77

88
# API semantic versioning
99

10-
The Envoy APIs consist of a family of packages, e.g. `envoy.admin.v2alpha`,
11-
`envoy.service.trace.v2`. Each package is independently versioned with a protobuf semantic
10+
The Envoy APIs consist of a family of packages, e.g. `envoy.admin.v3alpha`,
11+
`envoy.service.trace.v3`. Each package is independently versioned with a protobuf semantic
1212
versioning scheme based on https://cloud.google.com/apis/design/versioning.
1313

14-
The major version for a package is captured in its name (and directory structure). E.g. version 2
15-
of the tracing API package is named `envoy.service.trace.v2` and its constituent protos are located
16-
in `api/envoy/service/trace/v2`. Every protobuf must live directly in a versioned package namespace,
17-
we do not allow subpackages such as `envoy.service.trace.v2.somethingelse`.
18-
19-
Minor and patch versions will be implemented in the future, this effort is tracked in
20-
https://github.com/envoyproxy/envoy/issues/8416.
14+
The major version for a package is captured in its name (and directory structure). E.g. version 3
15+
of the tracing API package is named `envoy.service.trace.v3` and its constituent protos are located
16+
in `api/envoy/service/trace/v3`. Every protobuf must live directly in a versioned package namespace,
17+
we do not allow subpackages such as `envoy.service.trace.v3.somethingelse`.
2118

2219
In everyday discussion and GitHub labels, we refer to the `v2`, `v3`, `vN`, `...` APIs. This has a
2320
specific technical meaning. Any given message in the Envoy API, e.g. the `Bootstrap` at
2421
`envoy.config.bootstrap.v3.Bootstrap`, will transitively reference a number of packages in the Envoy
2522
API. These may be at `vN`, `v(N-1)`, etc. The Envoy API is technically a DAG of versioned package
2623
namespaces. When we talk about the `vN xDS API`, we really refer to the `N` of the root
2724
configuration resources (e.g. bootstrap, xDS resources such as `Cluster`). The
28-
v3 API bootstrap configuration is `envoy.config.bootstrap.v3.Bootstrap`, even
29-
though it might transitively reference `envoy.service.trace.v2`.
25+
v3 API bootstrap configuration is `envoy.config.bootstrap.v3.Bootstrap`.
3026

3127
# Backwards compatibility
3228

@@ -82,57 +78,18 @@ implementations within a major version should set explicit values for these fiel
8278

8379
# API lifecycle
8480

85-
A new major version is a significant event in the xDS API ecosystem, inevitably requiring support
86-
from clients (Envoy, gRPC) and a large number of control planes, ranging from simple in-house custom
87-
management servers to xDS-as-a-service offerings run by vendors. The [xDS API
88-
shepherds](https://github.com/orgs/envoyproxy/teams/api-shepherds) will make the decision to add a
89-
new major version subject to the following constraints:
90-
* There exists sufficient technical debt in the xDS APIs in the existing supported major version
91-
to justify the cost burden for xDS client/server implementations.
92-
* At least one year has elapsed since the last major version was cut.
93-
* Consultation with the Envoy community (via Envoy community call, `#xds` channel on Slack), as
94-
well as gRPC OSS community (via reaching out to language maintainers) is made. This is not a veto
95-
process; the API shepherds retain the right to move forward with a new major API version after
96-
weighing this input with the first two considerations above.
97-
98-
Following the release of a new major version, the API lifecycle follows a deprecation clock.
99-
Envoy will support at most three major versions of any API package at all times:
100-
* The current stable major version, e.g. v3.
101-
* The previous stable major version, e.g. v2. This is needed to ensure that we provide at least 1
102-
year for a supported major version to sunset. By supporting two stable major versions
103-
simultaneously, this makes it easier to coordinate control plane and Envoy
104-
rollouts as well. This previous stable major version will be supported for exactly 1
105-
year after the introduction of the new current stable major version, after which it will be
106-
removed from the Envoy implementation.
107-
* Optionally, the next experimental alpha major version, e.g. v4alpha. This is a release candidate
108-
for the next stable major version. This is only generated when the current stable major version
109-
requires a breaking change at the next cycle, e.g. a deprecation or field rename. This release
110-
candidate is mechanically generated via the
111-
[protoxform](https://github.com/envoyproxy/envoy/tree/main/tools/protoxform) tool from the
112-
current stable major version, making use of annotations such as `deprecated = true`. This is not a
113-
human editable artifact.
114-
115-
An example of how this might play out is that at the end of December in 2020, if a v4 major version
116-
is justified, we might freeze
117-
`envoy.config.bootstrap.v4alpha` and this package would then become the current stable major version
118-
`envoy.config.bootstrap.v4`. The `envoy.config.bootstrap.v3` package will become the previous stable
119-
major version and support for `envoy.config.bootstrap.v2` will be dropped from the Envoy
120-
implementation. Note that some transitively referenced package, e.g.
121-
`envoy.config.filter.network.foo.v2` may remain at version 2 during this release, if no changes were
122-
made to the referenced package. If no major version is justified at this point, the decision to cut
123-
v4 might occur at some point in 2021 or beyond, however v2 support will still be removed at the end
124-
of 2020.
125-
126-
The implication of this API lifecycle and clock is that any deprecated feature in the Envoy API will
127-
retain implementation support for at least 1-2 years.
128-
129-
We are currently working on a strategy to introduce minor versions
130-
(https://github.com/envoyproxy/envoy/issues/8416). This will bump the xDS API minor version on every
131-
deprecation and field introduction/modification. This will provide an opportunity for the control
132-
plane to condition on client and major/minor API version support. Currently under discussion, but
133-
not finalized will be the sunsetting of Envoy client support for deprecated features after a year
134-
of support within a major version. Please post to https://github.com/envoyproxy/envoy/issues/8416
135-
any thoughts around this.
81+
At one point, the Envoy project planned for regular major version updates to the xDS API in order to
82+
remove technical debt. At this point we recognize that Envoy and the larger xDS ecosystem (gRPC,
83+
etc.) is too widely used to make version bumps realistic. As such, for practical purposes, the v3
84+
API is the final major version of the API and will be supported forever. Deprecations will still
85+
occur as an end-user indication that there is a preferred way to configure a particular feature, but
86+
no field will ever be removed nor will Envoy ever remove the implementation for any deprecated
87+
field.
88+
89+
**NOTE**: Client implementations are free to output additional warnings about field usage beyond
90+
deprecation, if for example, the use of the continued use of the field is deemed a substantial
91+
security risk. Individual client versions are also free to stop supporting fields if they want to,
92+
though Envoy Proxy (as an xDS client) commits to never doing so.
13693

13794
# New API features
13895

@@ -147,45 +104,6 @@ only be made to the *current stable major version*. The rationale for this polic
147104
* We encourage Envoy users to move to the current stable major version from the previous one to
148105
consume new functionality.
149106

150-
# When can an API change be made to a package's previous stable major version?
151-
152-
As a pragmatic concession, we allow API feature additions to the previous stable major version for a
153-
single quarter following a major API version increment. Any changes to the previous stable major
154-
version must be manually reflected in a consistent manner in the current stable major version as
155-
well.
156-
157-
# How to make a breaking change across major versions
158-
159-
We maintain [backwards compatibility](#backwards-compatibility) within a major version but allow
160-
breaking changes across major versions. This enables API deprecations, cleanups, refactoring and
161-
reorganization. The Envoy APIs have a stylized workflow for achieving this. There are two prescribed
162-
methods, depending on whether the change is mechanical or manual.
163-
164-
## Mechanical breaking changes
165-
166-
Field deprecations, renames, etc. are mechanical changes that are supported by the
167-
[protoxform](https://github.com/envoyproxy/envoy/tree/main/tools/protoxform) tool. These are
168-
guided by [annotations](STYLE.md#api-annotations).
169-
170-
## Manual breaking changes
171-
172-
A manual breaking change is distinct from the mechanical changes such as field deprecation, since in
173-
general it requires new code and tests to be implemented in Envoy by hand. For example, if a developer
174-
wants to unify `HeaderMatcher` with `StringMatcher` in the route configuration, this is a likely
175-
candidate for this class of change. The following steps are required:
176-
1. The new version of the feature, e.g. the `NewHeaderMatcher` message should be added, together
177-
with referencing fields, in the current stable major version for the route configuration proto.
178-
2. The Envoy implementation should be changed to consume configuration from the fields added in (1).
179-
Translation code (and tests) should be written to map from the existing field and messages to
180-
(1).
181-
3. The old message/enum/field/enum value should be annotated as deprecated.
182-
4. At the next major version, `protoxform` will remove the deprecated version automatically.
183-
184-
This make-before-break approach ensures that API major version releases are predictable and
185-
mechanical, and has the bulk of the Envoy code and test changes owned by feature developers, rather
186-
than the API owners. There will be no major `vN` initiative to address technical debt beyond that
187-
enabled by the above process.
188-
189107
# Client features
190108

191109
Not all clients will support all fields and features in a given major API version. In general, it is
@@ -203,34 +121,3 @@ This approach does not always work, for example:
203121
For this purpose, we have [client
204122
features](https://www.envoyproxy.io/docs/envoy/latest/api/client_features).
205123

206-
# One Definition Rule (ODR)
207-
208-
To avoid maintaining more than two stable major versions of a package, and to cope with diamond
209-
dependency, we add a restriction on how packages may be referenced transitively; a package may have
210-
at most one version of another package in its transitive dependency set. This implies that some
211-
packages will have a major version bump during a release cycle simply to allow them to catch up to
212-
the current stable version of their dependencies.
213-
214-
Some of this complexity and churn can be avoided by having strict rules on how packages may
215-
reference each other. Package organization and `BUILD` visibility constraints should be used
216-
restrictions to maintain a shallow depth in the dependency tree for any given package.
217-
218-
# Minimizing the impact of churn
219-
220-
In addition to stability, the API versioning policy has an explicit goal of minimizing the developer
221-
overhead for the Envoy community, other clients of the APIs (e.g. gRPC), management server vendors
222-
and the wider API tooling ecosystem. A certain amount of API churn between major versions is
223-
desirable to reduce technical debt and to support API evolution, but too much creates costs and
224-
barriers to upgrade.
225-
226-
We consider deprecations to be *mandatory changes*. Any deprecation will be removed at the next
227-
stable API version.
228-
229-
Other mechanical breaking changes are considered *discretionary*. These include changes such as
230-
field renames and are largely reflected in protobuf comments. The `protoxform` tool may decide to
231-
minimize API churn by deferring application of discretionary changes until a major version cycle
232-
where the respective message is undergoing a mandatory change.
233-
234-
The Envoy API structure helps with minimizing churn between versions. Developers should architect
235-
and split packages such that high churn protos, e.g. HTTP connection manager, are isolated in
236-
packages and have a shallow reference hierarchy.

docs/root/api/api_supported_versions.rst

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
Supported API versions
44
======================
55

6-
Envoy's APIs follow a :repo:`versioning scheme <api/API_VERSIONING.md>` in which Envoy supports
7-
multiple major API versions at any point in time. The following versions are currently supported:
6+
Envoy's APIs follow a :repo:`versioning scheme <api/API_VERSIONING.md>`. The following version is
7+
currently supported:
88

9-
* :ref:`v3 xDS API <envoy_v3_api_reference>` (*active*). Envoy developers and
10-
operators are encouraged to be actively adopting and working with v3 xDS.
9+
* :ref:`v3 xDS API <envoy_v3_api_reference>` (*active*). Per the additional information in the
10+
:repo:`versioning scheme <api/API_VERSIONING.md#api-lifecycle>`, the v3 xDS is the final major
11+
version and will be supported forever.
1112

1213
The following API versions are no longer supported by Envoy:
1314

docs/root/faq/api/envoy_v3.rst

+2-18
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,5 @@
33
How do I configure Envoy to use the v3 API?
44
===========================================
55

6-
All bootstrap files are expected to be v3.
7-
8-
For dynamic configuration, we have introduced two new fields to :ref:`config sources
9-
<envoy_v3_api_msg_config.core.v3.ConfigSource>`, transport API version and resource API version. The
10-
distinction is as follows:
11-
12-
* The :ref:`transport API version
13-
<envoy_v3_api_field_config.core.v3.ApiConfigSource.transport_api_version>` indicates the API
14-
endpoint and version of *DiscoveryRequest*/*DiscoveryResponse* messages used.
15-
16-
* The :ref:`resource API version
17-
<envoy_v3_api_field_config.core.v3.ConfigSource.resource_api_version>` indicates whether a v2 or
18-
v3 resource, e.g. v2 *RouteConfiguration* or v3 *RouteConfiguration*, is delivered.
19-
20-
The API version must be set for both transport and resource API versions.
21-
22-
If you see a warning or error with ``V2 (and AUTO) xDS transport protocol versions are deprecated``,
23-
it is likely that you are missing explicit V3 configuration of the transport API version.
6+
No work is required. All bootstrap files are expected to be v3. Support for v1 and v2 has been
7+
completely removed.

docs/root/faq/api/why_versioning.rst

+1-32
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,4 @@
11
Why are the Envoy xDS APIs versioned? What is the benefit?
22
==========================================================
33

4-
Envoy is a platform and needs to allow its APIs to grow and evolve to encompass new features,
5-
improve ergonomics and address new use cases. At the same time, we need a disciplined approach to
6-
turning down stale functionality and removing APIs and their supporting code that are no longer
7-
maintained. If we don't do this, we lose the ability in the long term to provide a reliable,
8-
maintainable, scalable code base and set of APIs for our users.
9-
10-
We had previously put in place policies around :repo:`breaking changes
11-
<CONTRIBUTING.md#breaking-change-policy>` across releases, the :repo:`API versioning policy
12-
<api/API_VERSIONING.md>` takes this a step further, articulating a guaranteed multi-year support
13-
window for APIs that provides control plane authors a predictable clock when considering support
14-
for a range of Envoy versions.
15-
16-
For the v3 xDS APIs, a brief list of the key improvements that were made with a clean break from v2:
17-
18-
* Packages organization was improved to reflect a more logical grouping of related APIs:
19-
20-
- The legacy ``envoy.api.v2`` tree was eliminated, with protos moved to their logical groupings,
21-
e.g. ``envoy.config.core.v3``, ``envoy.server.listener.v3``.
22-
- All packages are now versioned with a ``vN`` at the end. This allows for type-level identification
23-
of major version.
24-
- xDS service endpoints/transport and configuration are split between ``envoy.service`` and
25-
``envoy.config``.
26-
- Extensions now reflect the Envoy source tree layout under ``envoy.extensions``.
27-
* ``std::regex`` regular expressions were dropped from the API, in favor of RE2. The former have dangerous
28-
security implications.
29-
* ``google.protobuf.Struct`` configuration of extensions was dropped from the API, in favor of
30-
typed configuration. This provides for better support for multiple instances of extensions, e.g.
31-
in filter chains, and more flexible naming of extension instances.
32-
* Over 60 deprecated fields were removed from the API.
33-
* Tooling and processes were established for API versioning support. This has now been reflected in
34-
the bootstrap ``Node``, providing a long term notion of API support that control planes can depend
35-
upon for client negotiation.
4+
See more information about the :repo:`versioning scheme <api/API_VERSIONING.md>`.

0 commit comments

Comments
 (0)