Skip to content

Commit 50d0a32

Browse files
committed
Fill out more proposal details
1 parent 1c2a1e6 commit 50d0a32

File tree

1 file changed

+65
-6
lines changed
  • keps/sig-api-machinery/4330-compatibility-versions

1 file changed

+65
-6
lines changed

keps/sig-api-machinery/4330-compatibility-versions/README.md

Lines changed: 65 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ tags, and then generate with `hack/update-toc.sh`.
8383
- [Goals](#goals)
8484
- [Non-Goals](#non-goals)
8585
- [Proposal](#proposal)
86+
- [Flags](#flags)
87+
- [Feature Compatibility Versioning](#feature-compatibility-versioning)
88+
- [CEL Environment Compatibility Versioning](#cel-environment-compatibility-versioning)
89+
- [StorageVersion Compatibility Versioning](#storageversion-compatibility-versioning)
90+
- [API Compatibility Versioning](#api-compatibility-versioning)
8691
- [User Stories (Optional)](#user-stories-optional)
8792
- [Story 1](#story-1)
8893
- [Story 2](#story-2)
@@ -156,7 +161,7 @@ Items marked with (R) are required *prior to targeting to a milestone / release*
156161

157162
We intend to introduce a "compatibility version" option to Kubernetes control
158163
plane components to make upgrades safer by increasing the granularity of steps
159-
avilable to cluster administrators. The "compatibility version" is distinct from
164+
available to cluster administrators. The "compatibility version" is distinct from
160165
the binary version of a Kubernetes component, and can be used to emulate the
161166
behavior (APIs, features, ...) of a prior Kubernetes release version.
162167

@@ -180,7 +185,7 @@ achieved failure) and (2) failures are more easily auto-reverted by upgrade
180185
orchestration as we are taking smaller and more incremental steps forward,
181186
which means there is less to “undo” on a failure condition.
182187

183-
In beta, we intend to introduce support for greater compatibilty version skew
188+
In beta, we intend to introduce support for greater compatibility version skew
184189
(specifically, N-3) so that it would be possible to skip-level upgrade a
185190
Kubernetes control-plane, by means of:
186191

@@ -200,7 +205,7 @@ Kubernetes control-plane, by means of:
200205
- A Kubernetes binary with compatibility version set to N does not enable any
201206
changes (storage versions, CEL feature, features) that would prevent it
202207
from being rolled back to N-1.
203-
- The most recent Kubernetes version supports compatiblity version being set to
208+
- The most recent Kubernetes version supports compatibility version being set to
204209
the full range of supported versions (N..N-3).
205210

206211
### Non-Goals
@@ -210,11 +215,15 @@ Kubernetes control-plane, by means of:
210215

211216
## Proposal
212217

218+
### Flags
219+
213220
Kubernetes components (apiservers, controller managers, schedulers) will offer a
214221
`--compatibility-version` flag that can be set to any of the previous three
215222
minor versions. If unset, the compatibility version defaults to the minor
216223
version of the binary.
217224

225+
### Feature Compatibility Versioning
226+
218227
Features will be versioned, i.e.:
219228

220229
```go
@@ -230,8 +239,45 @@ When a component starts, feature gates will be compared against the
230239
compatibility version to determine which features to enable for that
231240
compatibility version.
232241

233-
Similarily, StorageVersions, APIs and CEL features will be versioned such that
234-
configured to match a compatibbility version.
242+
### CEL Environment Compatibility Versioning
243+
244+
CEL environments already [support a compatibility
245+
version](https://github.com/kubernetes/kubernetes/blob/7fe31be11fbe9b44af262d5f5cffb1e73648aa96/staging/src/k8s.io/apiserver/pkg/cel/environment/base.go#L45).
246+
The CEL compatibility version is use to ensure when a kubeneretes contol plane
247+
component reads a CEL expression from storage written by a N+1 newer version
248+
(either due to version skew or a rollback), that a compatible CEL environment
249+
can still be constructed. This is achieved by making any CEL environment changes
250+
(language settings, libraries, variables) available for [stored expressions one
251+
version before they are allowed to be written by new expressions](https://github.com/kubernetes/kubernetes/blob/7fe31be11fbe9b44af262d5f5cffb1e73648aa96/staging/src/k8s.io/apiserver/pkg/cel/environment/environment.go#L38).
252+
253+
The only change we must make for this enhancement is to remove the
254+
[compatibility version
255+
constant](https://github.com/kubernetes/kubernetes/blob/7fe31be11fbe9b44af262d5f5cffb1e73648aa96/staging/src/k8s.io/apiserver/pkg/cel/environment/base.go#L45)
256+
and instead always pass in N-1 of the compatibility version introduced by this enhancement.
257+
258+
### StorageVersion Compatibility Versioning
259+
260+
StorageVersions specify what version an apiserver uses to write resources to etcd
261+
for an API group. The StorageVersion differs across releases as API groups
262+
graduate through stability levels.
263+
264+
the StorageVersions of an API group will need to be modified to track which
265+
storage versions are used for which version ranges.
266+
267+
When an apiserver starts, StorageVersions will be compared against the compatibility version to
268+
determine which StorageVersions should be used for each API group.
269+
270+
### API Compatibility Versioning
271+
272+
Similar to feature flags, all APIs group-versions declarations will be modified
273+
to track which version the APIs are introduced and removed at.
274+
275+
If any on-by-default Beta APIs still exist (hopefully not), then they will be enabled
276+
if they were enabled at the compatibility version provided. Off-by-default Beta APIs
277+
will need to be enabled by flags.
278+
279+
When an apiserver starts, APIs will be compared against the compatibility version to
280+
determine which APIs to match the APIs that were enabled for that compatibility version.
235281

236282
### User Stories (Optional)
237283

@@ -258,6 +304,19 @@ the health of the cluster between each step.
258304

259305
#### Story 2
260306

307+
A cluster administrator is running Kubernetes 1.30.12 and wishes to perform a cautious
308+
upgrade to 1.31.5, but after upgrading realizes that a feature the workload depends on
309+
had been removed and needs to rollback until the workload can be modified to not
310+
depend on the feature.
311+
312+
- For each control plane component, in the [recommended
313+
order](https://kubernetes.io/releases/version-skew-policy/):
314+
- sets `--compatibility-version=1.30`
315+
316+
This avoids having to rollback the binary version. Once the workload is fixed, the
317+
cluster administrator can remove the `--compatibility-version` to roll the cluster
318+
forward again.
319+
261320
### Notes/Constraints/Caveats (Optional)
262321

263322
<!--
@@ -272,7 +331,7 @@ This might be a good place to talk about core concepts and how they relate.
272331
Risk: Introducing this change increases the maintenance burden on Kubernetes
273332
maintainers.
274333

275-
Why we think this is managable:
334+
Why we think this is manageable:
276335

277336
- We already author features to be gated. The only change here is include
278337
enough information about features so that they can be selectively enabled/disabled

0 commit comments

Comments
 (0)