Skip to content

Commit 7db9191

Browse files
committed
Clarify ranges
1 parent db0c050 commit 7db9191

File tree

1 file changed

+40
-17
lines changed
  • keps/sig-architecture/4330-compatibility-versions

1 file changed

+40
-17
lines changed

keps/sig-architecture/4330-compatibility-versions/README.md

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ tags, and then generate with `hack/update-toc.sh`.
8888
- [Feature Gate Lifecycles](#feature-gate-lifecycles)
8989
- [Feature gating changes](#feature-gating-changes)
9090
- [CEL Environment Compatibility Versioning](#cel-environment-compatibility-versioning)
91+
- [Validation ratcheting](#validation-ratcheting)
9192
- [StorageVersion Compatibility Versioning](#storageversion-compatibility-versioning)
9293
- [API Compatibility Versioning](#api-compatibility-versioning)
9394
- [Discovery](#discovery)
@@ -204,9 +205,12 @@ achieved failure) and (2) failures are more easily auto-reverted by upgrade
204205
orchestration as we are taking smaller and more incremental steps forward,
205206
which means there is less to “undo” on a failure condition.
206207

207-
In beta, we intend to introduce support for greater compatibility version skew
208-
(specifically, N-3) so that it would be possible to skip binary versions while
209-
still performing a stepwise upgrade of Kubernetes control-plane. For example:
208+
In alpha we intend to support a `1.n`..`1.{n-1}` compatibility version range
209+
for a binary version of `1.n`.
210+
211+
In beta, we intend to extend that to `1.n`..`1.{n-3}` so that it would be possible
212+
to skip binary versions while still performing a stepwise upgrade of Kubernetes
213+
control-plane. For example:
210214

211215
- (starting point) binary-version 1.28 (compat-version 1.28)
212216
- upgrade binary-version to 1.31 (compat-version stays at 1.28 - this is our skip-level binary upgrade)
@@ -250,7 +254,7 @@ Benefits to upgrading binary version independent of compatibility version:
250254
changes (storage versions, CEL feature, features) that would prevent it
251255
from being rolled back to N-1.
252256
- The most recent Kubernetes version supports compatibility version being set to
253-
the full range of supported versions (N..N-3).
257+
the full range of supported versions (alpha: `1.n`..`1.{n-1}`, beta: `1.n`..`1.{n-3}`).
254258

255259
### Non-Goals
256260

@@ -269,12 +273,17 @@ Kubernetes components (apiservers, controller managers, schedulers) will offer a
269273
minor versions. If unset, the compatibility version defaults to the `<major.minor>`
270274
version of the binary version.
271275

272-
If the `--compatibility-version` is set to a version outside of the supported version
273-
range (N..N-3), the binary will exit and report an invalid flag value error telling
274-
the user what versions are allowed.
276+
If the `--compatibility-version` is set to a version outside of the supported
277+
version range (alpha: `1.n`..`1.{n-1}`, beta: `1.n`..`1.{n-3}`), the binary will
278+
exit and report an invalid flag value error telling the user what versions are
279+
allowed.
275280

276-
The kubelet is out of scope for this enhancement. Note that the kubelet already
277-
supports N-3 version skew with the kube-apiserver.
281+
Adding `--compatibility-version` kubelet is out of scope for this enhancement.
282+
But we do need to define how kubelet skew behaves when the kube-apiserver has
283+
`--compatibility-version` set. Our general rule is that we want to define skew
284+
using compatibility versions when they are in use. So not only must a kubelet
285+
version be <= the kube-apiserver binary version, it must also be <= the
286+
`--compatibility-version` of the kube-apiserver.
278287

279288
### Changes to Feature Gates
280289

@@ -310,8 +319,8 @@ version the compatibility version is set to. I.e. it must be possible to use
310319
`--feature-gates` to disable features that were beta, and enable feature that
311320
were alpha in the Kubernetes version the compatibility version is set to. One
312321
important implication of this requirement is that feature gating must be kept in
313-
the Kubenetes codebase until a feature has reached GA (or been removed) for N-3
314-
releases.
322+
the Kubenetes codebase until a feature has reached GA (or been removed) for supported
323+
compatibility version range (alpha: `1.n`..`1.{n-1}`, beta: `1.n`..`1.{n-3}`).
315324
316325
For example, a feature that is promoted once per release would look something like:
317326
@@ -336,8 +345,8 @@ The lifecycle of the feature would be:
336345
| 1.30 | GA | Alpha: 1.26, Beta: 1.27 (on-by-default), GA: 1.28 |
337346
| 1.31 | GA | **Feature implementation becomes part of normal code. `if featureGate enabled { // implement feature }` code may be removed at this step** |
338347

339-
All feature gating and tracking must remain in code through 1.30 for N-3
340-
compatibility version support.
348+
All feature gating and tracking must remain in code through 1.30 for
349+
compatibility version support (alpha: `1.n`..`1.{n-1}`, beta: `1.n`..`1.{n-3}`).
341350

342351
For a Beta feature that is removed, e.g.:
343352

@@ -364,13 +373,13 @@ The steps to remove the Beta feature would be:
364373
| 1.32 | - | Beta: 1.26, Deprecated: 1.27, Removed: 1.31 |
365374
| 1.33 | - | **`if featureGate enabled { // implement feature }` code may be removed at this step** |
366375

367-
(Features that are deleted before reaching Beta do not require n-3 compatibility
376+
(Features that are deleted before reaching Beta do not require compatibility version
368377
support since we don't support compatibility version for alpha features)
369378
370379
Note that this respects a 1yr deprecation policy.
371380
372-
All feature gating and tracking must remain in code through 1.32 for N-3
373-
compatibility version support.
381+
All feature gating and tracking must remain in code through 1.32 for
382+
compatibility version support range (alpha: `1.n`..`1.{n-1}`, beta: `1.n`..`1.{n-3}`).
374383
375384
#### Feature gating changes
376385
@@ -496,6 +505,18 @@ constant](https://github.com/kubernetes/kubernetes/blob/7fe31be11fbe9b44af262d5f
496505
and instead always pass in N-1 of the compatibility version introduced by this
497506
enhancement as the CEL compatibility version.
498507

508+
### Validation ratcheting
509+
510+
Any validationg ratcheting needs to account for compatibility version.
511+
512+
For example, if a validation is widened (tolerates values not previously
513+
allowed) at minor version N, then if the compatibility version is set to minor
514+
version N-1, widened values must be allowed for already stored field values, but
515+
not allowed for writes that change the field value.
516+
517+
The above "CEL Environment Compatibility Versioning" is actually a special
518+
case of this requirement.
519+
499520
### StorageVersion Compatibility Versioning
500521

501522
StorageVersions specify what version an apiserver uses to write resources to etcd
@@ -734,9 +755,11 @@ API Storage version changed|v1beta1|v1|Resources stored as v1beta1|Resources sto
734755
new CEL function|-|function in StoredExpressions CEL environment|CEL function does not exist|Resources already containing CEL expression can be evaluated
735756
introduced CEL function|function in StoredExpressions CEL environment|function in NewExpressions CEL environment|Resources already containing CEL expression can be evaluated|CEL expression can be written to resources and can be evaluted from storage
736757
737-
- The other edge cases we will test are:
758+
- Other cases we will test are:
738759
- `--compatibility-version=<N-2>` - fails flag validation, binary exits
739760
- `--compatibility-version=<N+1>` - fails flag validation, binary exits
761+
- we only allow data into new API fields once they existed in the previous release, this needs to account for compatibility version
762+
- we only relax validation after the previous release tolerates it, this needs to account for compatibility version
740763
741764
##### e2e tests
742765

0 commit comments

Comments
 (0)