@@ -83,6 +83,11 @@ tags, and then generate with `hack/update-toc.sh`.
83
83
- [ Goals] ( #goals )
84
84
- [ Non-Goals] ( #non-goals )
85
85
- [ 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 )
86
91
- [ User Stories (Optional)] ( #user-stories-optional )
87
92
- [ Story 1] ( #story-1 )
88
93
- [ Story 2] ( #story-2 )
@@ -156,7 +161,7 @@ Items marked with (R) are required *prior to targeting to a milestone / release*
156
161
157
162
We intend to introduce a "compatibility version" option to Kubernetes control
158
163
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
160
165
the binary version of a Kubernetes component, and can be used to emulate the
161
166
behavior (APIs, features, ...) of a prior Kubernetes release version.
162
167
@@ -180,7 +185,7 @@ achieved failure) and (2) failures are more easily auto-reverted by upgrade
180
185
orchestration as we are taking smaller and more incremental steps forward,
181
186
which means there is less to “undo” on a failure condition.
182
187
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
184
189
(specifically, N-3) so that it would be possible to skip-level upgrade a
185
190
Kubernetes control-plane, by means of:
186
191
@@ -200,7 +205,7 @@ Kubernetes control-plane, by means of:
200
205
- A Kubernetes binary with compatibility version set to N does not enable any
201
206
changes (storage versions, CEL feature, features) that would prevent it
202
207
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
204
209
the full range of supported versions (N..N-3).
205
210
206
211
### Non-Goals
@@ -210,11 +215,15 @@ Kubernetes control-plane, by means of:
210
215
211
216
## Proposal
212
217
218
+ ### Flags
219
+
213
220
Kubernetes components (apiservers, controller managers, schedulers) will offer a
214
221
` --compatibility-version ` flag that can be set to any of the previous three
215
222
minor versions. If unset, the compatibility version defaults to the minor
216
223
version of the binary.
217
224
225
+ ### Feature Compatibility Versioning
226
+
218
227
Features will be versioned, i.e.:
219
228
220
229
``` go
@@ -230,8 +239,45 @@ When a component starts, feature gates will be compared against the
230
239
compatibility version to determine which features to enable for that
231
240
compatibility version.
232
241
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.
235
281
236
282
### User Stories (Optional)
237
283
@@ -258,6 +304,19 @@ the health of the cluster between each step.
258
304
259
305
#### Story 2
260
306
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
+
261
320
### Notes/Constraints/Caveats (Optional)
262
321
263
322
<!--
@@ -272,7 +331,7 @@ This might be a good place to talk about core concepts and how they relate.
272
331
Risk: Introducing this change increases the maintenance burden on Kubernetes
273
332
maintainers.
274
333
275
- Why we think this is managable :
334
+ Why we think this is manageable :
276
335
277
336
- We already author features to be gated. The only change here is include
278
337
enough information about features so that they can be selectively enabled/disabled
0 commit comments