Skip to content

Commit 00195f2

Browse files
authored
Merge pull request kubernetes#2471 from ehashman/34-sysctls
Migrate KEP-34 to new template
2 parents 5e794b0 + 61bc65c commit 00195f2

File tree

3 files changed

+296
-46
lines changed

3 files changed

+296
-46
lines changed

keps/prod-readiness/sig-node/34.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
kep-number: 34
2+
stable:
3+
approver: "@johnbelamaric"

keps/sig-node/34-sysctl-fields/README.md

Lines changed: 274 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,115 @@
1-
# Promote sysctl annotations to fields
2-
3-
## Table of Contents
1+
# KEP-34: Promote sysctl annotations to fields
42

53
<!-- toc -->
4+
- [Release Signoff Checklist](#release-signoff-checklist)
65
- [Summary](#summary)
76
- [Motivation](#motivation)
8-
- [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)
910
- [Promote <code>--experimental-allowed-unsafe-sysctls</code> kubelet flag to kubelet config api option](#promote--kubelet-flag-to-kubelet-config-api-option)
1011
- [Gate the feature](#gate-the-feature)
11-
- [Proposal](#proposal)
12-
- [User Stories](#user-stories)
13-
- [Implementation Details/Notes/Constraints](#implementation-detailsnotesconstraints)
12+
- [User Stories (Optional)](#user-stories-optional)
13+
- [Notes/Constraints/Caveats](#notesconstraintscaveats)
1414
- [Risks and Mitigations](#risks-and-mitigations)
15-
- [Graduation Criteria](#graduation-criteria)
15+
- [Design Details](#design-details)
16+
- [Test Plan](#test-plan)
17+
- [Graduation Criteria](#graduation-criteria)
18+
- [Alpha](#alpha)
19+
- [Beta](#beta)
20+
- [Graduation](#graduation)
21+
- [Upgrade / Downgrade Strategy](#upgrade--downgrade-strategy)
22+
- [Version Skew Strategy](#version-skew-strategy)
23+
- [Production Readiness Review Questionnaire](#production-readiness-review-questionnaire)
24+
- [Feature Enablement and Rollback](#feature-enablement-and-rollback)
25+
- [Rollout, Upgrade and Rollback Planning](#rollout-upgrade-and-rollback-planning)
26+
- [Monitoring Requirements](#monitoring-requirements)
27+
- [Dependencies](#dependencies)
28+
- [Scalability](#scalability)
29+
- [Troubleshooting](#troubleshooting)
1630
- [Implementation History](#implementation-history)
31+
- [Drawbacks / Alternatives](#drawbacks--alternatives)
32+
- [Infrastructure Needed (Optional)](#infrastructure-needed-optional)
1733
<!-- /toc -->
1834

35+
## Release Signoff Checklist
36+
37+
<!--
38+
**ACTION REQUIRED:** In order to merge code into a release, there must be an
39+
issue in [kubernetes/enhancements] referencing this KEP and targeting a release
40+
milestone **before the [Enhancement Freeze](https://git.k8s.io/sig-release/releases)
41+
of the targeted release**.
42+
43+
For enhancements that make changes to code or processes/procedures in core
44+
Kubernetes—i.e., [kubernetes/kubernetes], we require the following Release
45+
Signoff checklist to be completed.
46+
47+
Check these off as they are completed for the Release Team to track. These
48+
checklist items _must_ be updated for the enhancement to be released.
49+
-->
50+
51+
Items marked with (R) are required *prior to targeting to a milestone / release*.
52+
53+
- [x] (R) Enhancement issue in release milestone, which links to KEP dir in [kubernetes/enhancements] (not the initial KEP PR)
54+
- [x] (R) KEP approvers have approved the KEP status as `implementable`
55+
- [x] (R) Design details are appropriately documented
56+
- [x] (R) Test plan is in place, giving consideration to SIG Architecture and SIG Testing input
57+
- [x] (R) Graduation criteria is in place
58+
- [x] (R) Production readiness review completed
59+
- [x] (R) Production readiness review approved
60+
- [ ] "Implementation History" section is up-to-date for milestone
61+
- [x] User-facing documentation has been created in [kubernetes/website], for publication to [kubernetes.io]
62+
- [ ] Supporting documentation—e.g., additional design documents, links to mailing list discussions/SIG meetings, relevant PRs/issues, release notes
63+
64+
<!--
65+
**Note:** This checklist is iterative and should be reviewed and updated every time this enhancement is being considered for a milestone.
66+
-->
67+
68+
[kubernetes.io]: https://kubernetes.io/
69+
[kubernetes/enhancements]: https://git.k8s.io/enhancements
70+
[kubernetes/kubernetes]: https://git.k8s.io/kubernetes
71+
[kubernetes/website]: https://git.k8s.io/website
72+
1973
## Summary
2074

75+
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+
21113
Setting the `sysctl` parameters through annotations provided a successful story
22114
for defining better constraints of running applications.
23115
The `sysctl` feature has been tested by a number of people without any serious
@@ -61,28 +153,6 @@ in the following way:
61153

62154
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)
63155

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-
86156
* Introduce native `sysctl` fields in pods through `spec.securityContext.sysctl` field as:
87157

88158
```yaml
@@ -139,11 +209,9 @@ If disabled, the fields and the whitelist are just ignored.
139209

140210
[1] https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/
141211

142-
## Proposal
143-
144-
This is where we get down to the nitty gritty of what the proposal actually is.
212+
### User Stories (Optional)
145213

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)
147215

148216
* As a cluster admin, I want to have `sysctl` feature versioned so I can assure backward compatibility
149217
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.
152220
* As a cluster admin, I want to be able to apply the `sysctl` constraints on the cluster level so
153221
I can define the default constraints for all pods.
154222

155-
### Implementation Details/Notes/Constraints
223+
### Notes/Constraints/Caveats
156224

157225
Extending `SecurityContext` struct with `Sysctls` field:
158226

@@ -188,15 +256,181 @@ Validation checks implemented as part of [#27180](https://github.com/kubernetes/
188256
We need to assure backward compatibility, i.e. object specifications with `sysctl` annotations
189257
must still work after the graduation.
190258

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
192278

193279
* API changes allowing to configure the pod-scoped `sysctl` via `spec.securityContext` field.
194280
* 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
196281
* 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?
341+
342+
Yes: https://github.com/kubernetes/kubernetes/blob/28e2e12b887fe082929d3ece4b3cbd572dc15d39/test/e2e/upgrades/sysctl.go
343+
344+
###### Is the rollout accompanied by any deprecations and/or removals of features, APIs, fields of API types, flags, etc.?
345+
346+
N/A
347+
348+
### Monitoring Requirements
349+
350+
###### How can an operator determine if the feature is in use by workloads?
351+
352+
No metric currently exists. Feature flag will be set to on and Pod or PSP specifications will include sysctl fields set.
353+
354+
###### What are the SLIs (Service Level Indicators) an operator can use to determine the health of the service?
355+
356+
N/A, not a service.
357+
358+
###### What are the reasonable SLOs (Service Level Objectives) for the above SLIs?
359+
360+
N/A, not a service.
361+
362+
###### Are there any missing metrics that would be useful to have to improve observability of this feature?
363+
364+
N/A
365+
366+
### Dependencies
367+
368+
Underlying kernel support for sysctls.
369+
370+
###### Does this feature depend on any specific services running in the cluster?
371+
372+
No.
373+
374+
### Scalability
375+
376+
###### Will enabling / using this feature result in any new API calls?
377+
378+
No.
379+
380+
###### Will enabling / using this feature result in introducing new API types?
381+
382+
No.
383+
384+
###### Will enabling / using this feature result in any new calls to the cloud provider?
385+
386+
No.
387+
388+
###### Will enabling / using this feature result in increasing size or count of the existing API objects?
389+
390+
Yes: pods and PSPs have new fields for sysctl values.
391+
392+
###### Will enabling / using this feature result in increasing time taken by any operations covered by existing SLIs/SLOs?
393+
394+
No.
395+
396+
###### Will enabling / using this feature result in non-negligible increase of resource usage (CPU, RAM, disk, IO, ...) in any components?
397+
398+
No.
399+
400+
### Troubleshooting
401+
402+
###### How does this feature react if the API server and/or etcd is unavailable?
403+
404+
Feature is an API field on pod specification; kubelets behave as usual when API server/etcd are unavailable.
405+
406+
###### What are other known failure modes?
407+
408+
- https://github.com/kubernetes/kubernetes/issues/72593
409+
- https://github.com/kubernetes/kubernetes/issues/74151
410+
411+
There may be some follow-ups required to improve usability, but I do not
412+
believe this should block graduation.
413+
414+
Any scheduling enhancement we make around a node that is configured to allow
415+
unsafe sysctls would be a distinct feature.
416+
417+
###### What steps should be taken if SLOs are not being met to determine the problem?
418+
419+
SLOs do not apply, N/A.
198420

199421
## Implementation History
200422

201-
The `sysctl` feature is tracked as part of [features#34](https://github.com/kubernetes/features/issues/34).
202-
This is one of the goals to promote the annotations to fields.
423+
- 2017-06-12: [Original design proposal](https://github.com/kubernetes/community/pull/700)
424+
- 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)
433+
434+
## Infrastructure Needed (Optional)
435+
436+
N/A

0 commit comments

Comments
 (0)