You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Promote annotations to fields](#promote-annotations-to-fields)
7
+
-[Goals/Non-Goals](#goalsnon-goals)
8
+
-[Proposal](#proposal)
9
+
-[Promote annotations to fields (beta)](#promote-annotations-to-fields-beta)
9
10
-[Promote <code>--experimental-allowed-unsafe-sysctls</code> kubelet flag to kubelet config api option](#promote--kubelet-flag-to-kubelet-config-api-option)
This proposal aims at extending the current pod specification with support
76
+
for namespaced kernel parameters (sysctls) set for each pod.
77
+
78
+
See the [abstract and motivation](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/node/sysctl.md#abstract) from the original proposal in v1.4.
79
+
80
+
## Motivation
81
+
82
+
See the original design proposal's [motivation section](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/node/sysctl.md#motivation).
83
+
84
+
As mentioned in [contributors/devel/api_changes.md#alpha-field-in-existing-api-version](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api_changes.md#alpha-field-in-existing-api-version):
85
+
86
+
> Previously, annotations were used for experimental alpha features, but are no longer recommended for several reasons:
87
+
>
88
+
> They expose the cluster to "time-bomb" data added as unstructured annotations against an earlier API server (https://issue.k8s.io/30819)
89
+
> They cannot be migrated to first-class fields in the same API version (see the issues with representing a single value in multiple places in backward compatibility gotchas)
90
+
>
91
+
> The preferred approach adds an alpha field to the existing object, and ensures it is disabled by default:
92
+
>
93
+
> ...
94
+
95
+
The annotations as a means to set `sysctl` are no longer necessary.
96
+
The original intent of annotations was to provide additional description of Kubernetes
97
+
objects through metadata.
98
+
It's time to separate the ability to annotate from the ability to change sysctls settings
99
+
so a cluster operator can elevate the distinction between experimental and supported usage
100
+
of the feature.
101
+
102
+
103
+
### Goals/Non-Goals
104
+
105
+
See: original [constraints and assumptions](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/node/sysctl.md#constraints-and-assumptions)
106
+
107
+
## Proposal
108
+
109
+
See the [original design proposal](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/node/sysctl.md#proposed-design) for alpha.
110
+
111
+
### Promote annotations to fields (beta)
112
+
21
113
Setting the `sysctl` parameters through annotations provided a successful story
22
114
for defining better constraints of running applications.
23
115
The `sysctl` feature has been tested by a number of people without any serious
@@ -61,28 +153,6 @@ in the following way:
61
153
62
154
The `sysctl` design document with more details and rationals is available at [design-proposals/node/sysctl.md](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/node/sysctl.md#pod-api-changes)
63
155
64
-
## Motivation
65
-
66
-
As mentioned in [contributors/devel/api_changes.md#alpha-field-in-existing-api-version](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api_changes.md#alpha-field-in-existing-api-version):
67
-
68
-
> Previously, annotations were used for experimental alpha features, but are no longer recommended for several reasons:
69
-
>
70
-
> They expose the cluster to "time-bomb" data added as unstructured annotations against an earlier API server (https://issue.k8s.io/30819)
71
-
> They cannot be migrated to first-class fields in the same API version (see the issues with representing a single value in multiple places in backward compatibility gotchas)
72
-
>
73
-
> The preferred approach adds an alpha field to the existing object, and ensures it is disabled by default:
74
-
>
75
-
> ...
76
-
77
-
The annotations as a means to set `sysctl` are no longer necessary.
78
-
The original intent of annotations was to provide additional description of Kubernetes
79
-
objects through metadata.
80
-
It's time to separate the ability to annotate from the ability to change sysctls settings
81
-
so a cluster operator can elevate the distinction between experimental and supported usage
82
-
of the feature.
83
-
84
-
### Promote annotations to fields
85
-
86
156
* Introduce native `sysctl` fields in pods through `spec.securityContext.sysctl` field as:
87
157
88
158
```yaml
@@ -139,11 +209,9 @@ If disabled, the fields and the whitelist are just ignored.
This is where we get down to the nitty gritty of what the proposal actually is.
212
+
### User Stories (Optional)
145
213
146
-
### User Stories
214
+
See also: [original sysctl proposal](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/node/sysctl.md#abstract-use-cases)
147
215
148
216
* As a cluster admin, I want to have `sysctl` feature versioned so I can assure backward compatibility
149
217
and proper transformation between versioned to internal representation and back..
@@ -152,7 +220,7 @@ This is where we get down to the nitty gritty of what the proposal actually is.
152
220
* As a cluster admin, I want to be able to apply the `sysctl` constraints on the cluster level so
153
221
I can define the default constraints for all pods.
154
222
155
-
### Implementation Details/Notes/Constraints
223
+
### Notes/Constraints/Caveats
156
224
157
225
Extending `SecurityContext` struct with `Sysctls` field:
158
226
@@ -188,15 +256,181 @@ Validation checks implemented as part of [#27180](https://github.com/kubernetes/
188
256
We need to assure backward compatibility, i.e. object specifications with `sysctl` annotations
189
257
must still work after the graduation.
190
258
191
-
## Graduation Criteria
259
+
## Design Details
260
+
261
+
All of the above details were copied out of earlier proposals. For graduation, the PRR template below is completed.
262
+
263
+
### Test Plan
264
+
265
+
- Unit tests and e2es for all applicable changes.
266
+
- Any required conformance tests for graduation.
267
+
268
+
### Graduation Criteria
269
+
270
+
#### Alpha
271
+
272
+
* add sysctl support to pods
273
+
* e2e tests
274
+
275
+
Alpha since 1.4.
276
+
277
+
#### Beta
192
278
193
279
* API changes allowing to configure the pod-scoped `sysctl` via `spec.securityContext` field.
194
280
* API changes allowing to configure the cluster-scoped `sysctl` via `PodSecurityPolicy` object
195
-
* Promote `--experimental-allowed-unsafe-sysctls` kubelet flag to kubelet config api option
196
281
* feature gate enabled by default
197
-
* e2e tests
282
+
283
+
Beta since 1.11.
284
+
285
+
#### Graduation
286
+
287
+
* Promote `--experimental-allowed-unsafe-sysctls` kubelet flag to kubelet config api option
288
+
* lock feature gate on
289
+
290
+
### Upgrade / Downgrade Strategy
291
+
292
+
There are [e2es](https://github.com/kubernetes/kubernetes/blob/28e2e12b887fe082929d3ece4b3cbd572dc15d39/test/e2e/upgrades/sysctl.go) for sysctl behaviour on upgrades.
293
+
294
+
### Version Skew Strategy
295
+
296
+
N/A
297
+
298
+
## Production Readiness Review Questionnaire
299
+
300
+
### Feature Enablement and Rollback
301
+
302
+
###### How can this feature be enabled / disabled in a live cluster?
303
+
304
+
-[X] Feature gate (also fill in values in `kep.yaml`)
305
+
- Feature gate name: Sysctls
306
+
- Components depending on the feature gate: kubelet, apiserver
307
+
-[ ] Other
308
+
- Describe the mechanism:
309
+
- Will enabling / disabling the feature require downtime of the control
310
+
plane?
311
+
- Will enabling / disabling the feature require downtime or reprovisioning
312
+
of a node? (Do not assume `Dynamic Kubelet Config` feature is enabled).
313
+
314
+
###### Does enabling the feature change any default behavior?
315
+
316
+
No. Enabling the feature allows the use of sysctls.
317
+
318
+
###### Can the feature be disabled once it has been enabled (i.e. can we roll back the enablement)?
319
+
320
+
Yes, disable the feature flag.
321
+
322
+
###### What happens if we reenable the feature if it was previously rolled back?
323
+
324
+
Feature will become available again on the component.
325
+
326
+
###### Are there any tests for feature enablement/disablement?
327
+
328
+
Not currently. Feature has defaulted to on since 1.11; graduation criteria would lock feature to on.
329
+
330
+
### Rollout, Upgrade and Rollback Planning
331
+
332
+
###### How can a rollout fail? Can it impact already running workloads?
333
+
334
+
N/A
335
+
336
+
###### What specific metrics should inform a rollback?
337
+
338
+
N/A
339
+
340
+
###### Were upgrade and rollback tested? Was the upgrade->downgrade->upgrade path tested?
- 2018-05-14: [Update KEP with beta criteria](https://github.com/kubernetes/community/pull/2093)
425
+
- 2018-06-06: [Promote sysctl annotations to fields](https://github.com/kubernetes/kubernetes/pull/63717)
426
+
- 2018-06-14: [Update sysctls to beta on website](https://github.com/kubernetes/website/pull/8804)
427
+
- 2019-07-02: [Add allowed sysctl to KubeletConfiguration](https://github.com/kubernetes/kubernetes/pull/72974)
428
+
- 2021-02-08: Update KEP with final graduation criteria/complete PRR questionnaire
429
+
430
+
## Drawbacks / Alternatives
431
+
432
+
See also: [original design alternatives and considerations](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/node/sysctl.md#design-alternatives-and-considerations)
0 commit comments