Skip to content

Commit e55c925

Browse files
committed
clarify beta apis off by default
1 parent c1323be commit e55c925

File tree

4 files changed

+289
-585
lines changed

4 files changed

+289
-585
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
kep-number: 3136
2+
stable:
3+
approver: "@wojtek-t"
Lines changed: 286 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,286 @@
1+
<!--
2+
**Note:** When your KEP is complete, all of these comment blocks should be removed.
3+
4+
To get started with this template:
5+
6+
- [ ] **Pick a hosting SIG.**
7+
Make sure that the problem space is something the SIG is interested in taking
8+
up. KEPs should not be checked in without a sponsoring SIG.
9+
- [ ] **Create an issue in kubernetes/enhancements**
10+
When filing an enhancement tracking issue, please make sure to complete all
11+
fields in that template. One of the fields asks for a link to the KEP. You
12+
can leave that blank until this KEP is filed, and then go back to the
13+
enhancement and add the link.
14+
- [ ] **Make a copy of this template directory.**
15+
Copy this template into the owning SIG's directory and name it
16+
`NNNN-short-descriptive-title`, where `NNNN` is the issue number (with no
17+
leading-zero padding) assigned to your enhancement above.
18+
- [ ] **Fill out as much of the kep.yaml file as you can.**
19+
At minimum, you should fill in the "Title", "Authors", "Owning-sig",
20+
"Status", and date-related fields.
21+
- [ ] **Fill out this file as best you can.**
22+
At minimum, you should fill in the "Summary" and "Motivation" sections.
23+
These should be easy if you've preflighted the idea of the KEP with the
24+
appropriate SIG(s).
25+
- [ ] **Create a PR for this KEP.**
26+
Assign it to people in the SIG who are sponsoring this process.
27+
- [ ] **Merge early and iterate.**
28+
Avoid getting hung up on specific details and instead aim to get the goals of
29+
the KEP clarified and merged quickly. The best way to do this is to just
30+
start with the high-level sections and fill out details incrementally in
31+
subsequent PRs.
32+
33+
Just because a KEP is merged does not mean it is complete or approved. Any KEP
34+
marked as `provisional` is a working document and subject to change. You can
35+
denote sections that are under active debate as follows:
36+
37+
```
38+
<<[UNRESOLVED optional short context or usernames ]>>
39+
Stuff that is being argued.
40+
<<[/UNRESOLVED]>>
41+
```
42+
43+
When editing KEPS, aim for tightly-scoped, single-topic PRs to keep discussions
44+
focused. If you disagree with what is already in a document, open a new PR
45+
with suggested changes.
46+
47+
One KEP corresponds to one "feature" or "enhancement" for its whole lifecycle.
48+
You do not need a new KEP to move from beta to GA, for example. If
49+
new details emerge that belong in the KEP, edit the KEP. Once a feature has become
50+
"implemented", major changes should get new KEPs.
51+
52+
The canonical place for the latest set of instructions (and the likely source
53+
of this file) is [here](/keps/NNNN-kep-template/README.md).
54+
55+
**Note:** Any PRs to move a KEP to `implementable`, or significant changes once
56+
it is marked `implementable`, must be approved by each of the KEP approvers.
57+
If none of those approvers are still appropriate, then changes to that list
58+
should be approved by the remaining approvers and/or the owning SIG (or
59+
SIG Architecture for cross-cutting KEPs).
60+
-->
61+
# KEP-3136: Beta APIs Are Off by Default
62+
63+
<!--
64+
This is the title of your KEP. Keep it short, simple, and descriptive. A good
65+
title can help communicate what the KEP is and should be considered as part of
66+
any review.
67+
-->
68+
69+
<!--
70+
A table of contents is helpful for quickly jumping to sections of a KEP and for
71+
highlighting any additional information provided beyond the standard KEP
72+
template.
73+
74+
Ensure the TOC is wrapped with
75+
<code>&lt;!-- toc --&rt;&lt;!-- /toc --&rt;</code>
76+
tags, and then generate with `hack/update-toc.sh`.
77+
-->
78+
79+
<!-- toc -->
80+
- [Release Signoff Checklist](#release-signoff-checklist)
81+
- [Summary](#summary)
82+
- [Motivation](#motivation)
83+
- [Goals](#goals)
84+
- [Non-Goals](#non-goals)
85+
- [Proposal](#proposal)
86+
- [User Stories (Optional)](#user-stories-optional)
87+
- [Story 1](#story-1)
88+
- [Story 2](#story-2)
89+
- [Notes/Constraints/Caveats (Optional)](#notesconstraintscaveats-optional)
90+
- [Risks and Mitigations](#risks-and-mitigations)
91+
- [Design Details](#design-details)
92+
- [Test Plan](#test-plan)
93+
- [Graduation Criteria](#graduation-criteria)
94+
- [GA](#ga)
95+
- [Upgrade / Downgrade Strategy](#upgrade--downgrade-strategy)
96+
- [Version Skew Strategy](#version-skew-strategy)
97+
- [Production Readiness Review Questionnaire](#production-readiness-review-questionnaire)
98+
- [Implementation History](#implementation-history)
99+
- [Drawbacks](#drawbacks)
100+
- [Alternatives](#alternatives)
101+
- [Infrastructure Needed (Optional)](#infrastructure-needed-optional)
102+
<!-- /toc -->
103+
104+
## Release Signoff Checklist
105+
106+
<!--
107+
**ACTION REQUIRED:** In order to merge code into a release, there must be an
108+
issue in [kubernetes/enhancements] referencing this KEP and targeting a release
109+
milestone **before the [Enhancement Freeze](https://git.k8s.io/sig-release/releases)
110+
of the targeted release**.
111+
112+
For enhancements that make changes to code or processes/procedures in core
113+
Kubernetes—i.e., [kubernetes/kubernetes], we require the following Release
114+
Signoff checklist to be completed.
115+
116+
Check these off as they are completed for the Release Team to track. These
117+
checklist items _must_ be updated for the enhancement to be released.
118+
-->
119+
120+
Items marked with (R) are required *prior to targeting to a milestone / release*.
121+
122+
- [ ] (R) Enhancement issue in release milestone, which links to KEP dir in [kubernetes/enhancements] (not the initial KEP PR)
123+
- [ ] (R) KEP approvers have approved the KEP status as `implementable`
124+
- [ ] (R) Design details are appropriately documented
125+
- [ ] (R) Test plan is in place, giving consideration to SIG Architecture and SIG Testing input (including test refactors)
126+
- [ ] e2e Tests for all Beta API Operations (endpoints)
127+
- [ ] (R) Ensure GA e2e tests for meet requirements for [Conformance Tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/conformance-tests.md)
128+
- [ ] (R) Minimum Two Week Window for GA e2e tests to prove flake free
129+
- [ ] (R) Graduation criteria is in place
130+
- [ ] (R) [all GA Endpoints](https://github.com/kubernetes/community/pull/1806) must be hit by [Conformance Tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/conformance-tests.md)
131+
- [ ] (R) Production readiness review completed
132+
- [ ] (R) Production readiness review approved
133+
- [ ] "Implementation History" section is up-to-date for milestone
134+
- [ ] User-facing documentation has been created in [kubernetes/website], for publication to [kubernetes.io]
135+
- [ ] Supporting documentation—e.g., additional design documents, links to mailing list discussions/SIG meetings, relevant PRs/issues, release notes
136+
137+
<!--
138+
**Note:** This checklist is iterative and should be reviewed and updated every time this enhancement is being considered for a milestone.
139+
-->
140+
141+
[kubernetes.io]: https://kubernetes.io/
142+
[kubernetes/enhancements]: https://git.k8s.io/enhancements
143+
[kubernetes/kubernetes]: https://git.k8s.io/kubernetes
144+
[kubernetes/website]: https://git.k8s.io/website
145+
146+
## Summary
147+
148+
New beta APIs will not be enabled in clusters by default.
149+
Existing beta APIs and new versions of existing beta APIs, will continue to be enabled by default:
150+
if v1beta.some.group is currently enabled by default and we create v1beta2.some.group, v1beta2.some.group will still be enabled by default.
151+
152+
## Motivation
153+
154+
Beta APIs are not considered stable and reliance upon APIs in this state leads to exposure to bugs,
155+
guaranteed migration pain for users when the APIs move to stable, and the risk that dependencies will
156+
grow around unfinished APIs.
157+
Enabling beta APIs by default, exacerbates these problems by making them on in nearly every cluster.
158+
We observed these problems as we removed long-standing beta APIs and the PRR survey tells us that over
159+
90% of production clusters leave these APIs enabled.
160+
Unsuitability for production use is documented at https://kubernetes.io/docs/reference/using-api/#api-versioning
161+
("The software is not recommended for production uses"), but defaulting on means they are present in nearly every
162+
production cluster.
163+
By disabling beta APIs by default, a cluster-admin can opt-in for specific APIs without having every
164+
incomplete API present in the cluster.
165+
166+
### Goals
167+
168+
1. Disable new beta APIs by default.
169+
2. Continue enabling existing beta APIs and new version of existing beta APIs by default:
170+
if v1beta.some.group is currently enabled by default and we create v1beta2.some.group, v1beta2.some.group will still be enabled by default.
171+
3. Allow enabling specific resources in beta. Enable coolnewjobtype.v1beta1.batch.k8s.io without enabling other-neat-job.v1beta1.batch.k8s.io
172+
173+
### Non-Goals
174+
175+
1. Change featuregate defaults.
176+
177+
## Proposal
178+
179+
New beta APIs will be placed into the `DisableVersions` stanza instead of the `EnableVersions` stanza (see [DefaultAPIResourceConfigSource](https://github.com/kubernetes/kubernetes/blob/0669da445fa8c1ae07c15c0827f0e83da11cbe58/pkg/controlplane/instance.go#L643)).
180+
The `--runtime-config` flag will be extended to allow `group/version/resource=true`, to enable specific resources.
181+
To enable a beta API, a cluster-admin will have to add the appropriate `--runtime-config` flags.
182+
183+
### User Stories (Optional)
184+
185+
#### Story 1
186+
187+
As a cluster-admin I want to enable the coolnewjobtype.v1beta1.batch.k8s.io API in my cluster.
188+
189+
To do this I call `kube-apiserver --runtime-config=batch.k8s.io/v1beta1/coolnewjobtype`.
190+
191+
#### Story 2
192+
193+
As a cluster-admin I want to enable all beta APIs as in past releases.
194+
195+
To do this I call `kube-apiserver --runtime-config=api/beta=true`.
196+
This already exists and will continue to function.
197+
198+
199+
### Notes/Constraints/Caveats (Optional)
200+
201+
### Risks and Mitigations
202+
203+
Adoption of beta features will slow.
204+
Given how kubernetes is now treated, this is a good thing, not a bad thing.
205+
Those users that want to move quickly and get new features can do so by enabling all beta feature
206+
or just enabling those that are important for their workload.
207+
The [PRR survey](https://datastudio.google.com/reporting/2e9c7439-202b-48a9-8c57-4459e0d69c8d/page/Cv5HB) shows that
208+
over 30% of production clusters have alpha features enabled, so clsuter-admins are willing and able to enable features
209+
that are not on by default when they are desired.
210+
211+
## Design Details
212+
213+
<!--
214+
This section should contain enough information that the specifics of your
215+
change are understandable. This may include API specs (though not always
216+
required) or even code snippets. If there's any ambiguity about HOW your
217+
proposal will be implemented, this is the place to discuss them.
218+
-->
219+
220+
### Test Plan
221+
222+
Integration tests will be written to ensure that no new beta APIs are enabled in the kube-apiserver by default.
223+
Unit tests will be written to ensure that the new flag functionality works as expected.
224+
225+
### Graduation Criteria
226+
227+
This KEP is a policy KEP, not a feature KEP. It will start as GA.
228+
229+
#### GA
230+
231+
- Integration and unit tests from above.
232+
- updating the enablement docs for beta
233+
- https://kubernetes.io/docs/reference/using-api/#api-versioning
234+
- https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/#using-a-feature
235+
Even though that is talking about feature gates, it is likely worth calling out there that new beta REST APIs are no
236+
longer enabled by default)
237+
238+
### Upgrade / Downgrade Strategy
239+
240+
The additional command line flag format for `--runtime-config` will not be recognized on older levels of kubernetes.
241+
This means that when downgrading, cluster-admins will have to adjust their CLI arguments if they opted into a new beta API.
242+
This is congruent to flag handling for new features today.
243+
Because this only impacts new beta APIs, there is no behavior change for existing APIs on upgrade.
244+
245+
### Version Skew Strategy
246+
247+
Because this only impacts new beta APIs, there is no novel skew risk.
248+
249+
## Production Readiness Review Questionnaire
250+
251+
Not applicable because this is a policy KEP.
252+
253+
## Implementation History
254+
255+
<!--
256+
Major milestones in the lifecycle of a KEP should be tracked in this section.
257+
Major milestones might include:
258+
- the `Summary` and `Motivation` sections being merged, signaling SIG acceptance
259+
- the `Proposal` section being merged, signaling agreement on a proposed design
260+
- the date implementation started
261+
- the first Kubernetes release where an initial version of the KEP was available
262+
- the version of Kubernetes where the KEP graduated to general availability
263+
- when the KEP was retired or superseded
264+
-->
265+
266+
## Drawbacks
267+
268+
<!--
269+
Why should this KEP _not_ be implemented?
270+
-->
271+
272+
## Alternatives
273+
274+
<!--
275+
What other approaches did you consider, and why did you rule them out? These do
276+
not need to be as detailed as the proposal, but should include enough
277+
information to express the idea and why it was not acceptable.
278+
-->
279+
280+
## Infrastructure Needed (Optional)
281+
282+
<!--
283+
Use this section if you need things from the project/SIG. Examples include a
284+
new subproject, repos requested, or GitHub details. Listing these here allows a
285+
SIG to get the process for these resources started right away.
286+
-->

0 commit comments

Comments
 (0)