Skip to content

Commit 64f5167

Browse files
committed
KEP-3104: promote kuberc to beta
Signed-off-by: Maciej Szulik <[email protected]>
1 parent fe070e6 commit 64f5167

File tree

3 files changed

+76
-41
lines changed

3 files changed

+76
-41
lines changed

keps/prod-readiness/sig-cli/3104.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
kep-number: 3104
22
alpha:
33
approver: "@johnbelamaric"
4+
beta:
5+
approver: "@johnbelamaric"

keps/sig-cli/3104-introduce-kuberc/README.md

Lines changed: 71 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -137,17 +137,17 @@ Items marked with (R) are required *prior to targeting to a milestone / release*
137137
- [x] (R) Enhancement issue in release milestone, which links to KEP dir in [kubernetes/enhancements] (not the initial KEP PR)
138138
- [x] (R) KEP approvers have approved the KEP status as `implementable`
139139
- [x] (R) Design details are appropriately documented
140-
- [ ] (R) Test plan is in place, giving consideration to SIG Architecture and SIG Testing input (including test refactors)
141-
- [ ] e2e Tests for all Beta API Operations (endpoints)
140+
- [x] (R) Test plan is in place, giving consideration to SIG Architecture and SIG Testing input (including test refactors)
141+
- [x] e2e Tests for all Beta API Operations (endpoints)
142142
- [ ] (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)
143143
- [ ] (R) Minimum Two Week Window for GA e2e tests to prove flake free
144-
- [ ] (R) Graduation criteria is in place
145-
- [ ] (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)
144+
- [x] (R) Graduation criteria is in place
145+
- [x] (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)
146146
- [x] (R) Production readiness review completed
147147
- [x] (R) Production readiness review approved
148148
- [x] "Implementation History" section is up-to-date for milestone
149-
- [ ] User-facing documentation has been created in [kubernetes/website], for publication to [kubernetes.io]
150-
- [ ] Supporting documentation—e.g., additional design documents, links to mailing list discussions/SIG meetings, relevant PRs/issues, release notes
149+
- [x] User-facing documentation has been created in [kubernetes/website], for publication to [kubernetes.io]
150+
- [x] Supporting documentation—e.g., additional design documents, links to mailing list discussions/SIG meetings, relevant PRs/issues, release notes
151151

152152
<!--
153153
**Note:** This checklist is iterative and should be reviewed and updated every time this enhancement is being considered for a milestone.
@@ -207,7 +207,7 @@ know that this has succeeded?
207207
* Introduce a `kuberc` file as a place for client preferences.
208208
* Version and structure this file in a way that makes it easy to introduce new behaviors and settings for users.
209209
* Enable users to define kubectl command aliases.
210-
* Enable users to define kubectl default flags.
210+
* Enable users to define kubectl default options.
211211
* Deprecate [kubeconfig `Preferences` field](https://github.com/kubernetes/kubernetes/blob/4b024fc4eeb4a3eeb831e7fddec52b83d0b072df/staging/src/k8s.io/client-go/tools/clientcmd/api/v1/types.go#L40).
212212

213213
### Non-Goals
@@ -305,41 +305,54 @@ required) or even code snippets. If there's any ambiguity about HOW your
305305
proposal will be implemented, this is the place to discuss them.
306306
-->
307307

308-
During alpha this feature will be enabled through the `KUBECTL_KUBERC=true` environment variable. The file will default to being located in `~/.kube/kuberc`. A flag will allow overriding this default location with a path i.e. `kubectl --kuberc /var/kube/rc`.
308+
For beta this feature will be enabled by default. However, users can disable it
309+
by setting the `KUBECTL_KUBERC` environment variable to `false`. Additionally,
310+
users can always set the `KUBERC` environment variable to `off`, which disables
311+
the preference mechanism at any point in time.
309312

310-
Three initial top level keys are proposed.
313+
By default, the configuration file will be located in `~/.kube/kuberc`. A flag
314+
will allow overriding this default location with a specific path, for example:
315+
`kubectl --kuberc /var/kube/rc`.
311316

312-
* `apiVersion` to determine the version of the config.
313-
* `kind` to keep consistency with Kubernetes resources.
314-
* `aliases` for users to declare their own aliases for commands with flags and values.
315-
* `overrides` for users to set default flags to apply to commands.
317+
The following top-level keys are proposed, alongside the kubernetes `metav1.TypeMeta`
318+
fields (`apiVersion`, `kind`):
316319

317-
`aliases` will not be allowed to override builtins but take precedence of plugins i.e. builtins -> aliases -> plugins. Additional flags and values will be appended to the end of the aliased command. It is the responsibility of the user to define aliases with this in mind.
320+
* `aliases` Allows users to declare their own command aliases, including options and values.
321+
* `defaults` Enables users to set default options to be applied to commands.
318322

319-
`overrides` is modeled after all configurable behavior being implemented as flags first. This is a design decision that was made after modeling out the intended behavior and realizing that targeting flags filled the use cases. A merge will be done in the execution of the command for flags with inline overrides taking precedence.
323+
`aliases` will not be permitted to override built-in commands but will take
324+
precedence over plugins (builtins -> aliases -> plugins). Any additional options
325+
and values will be appended to the end of the aliased command. Users are
326+
responsible for defining aliases with this behavior in mind.
327+
328+
`defaults` is designed based on the principle that all configurable behavior is
329+
initially implemented as options. This design decision was made after analyzing the
330+
intended behavior and realizing that targeting options effectively addresses the
331+
use cases. During command execution, a merge will be occur, with inline overrides
332+
taking precedence over the defaults.
320333

321334
```
322-
apiVersion: kubectl.config.k8s.io/v1alpha1
335+
apiVersion: kubectl.config.k8s.io/v1beta1
323336
kind: Preference
324337
325338
aliases:
326339
- name: getdbprod
327340
command: get
328341
prependArgs:
329342
- pods
330-
flags:
343+
options:
331344
- name: labels
332345
default: what=database
333346
- name: namespace
334347
default: us-2-production
335348
336-
overrides:
349+
defaults:
337350
- command: apply
338-
flags:
351+
options:
339352
- name: server-side
340353
default: "true"
341354
- command: delete
342-
flags:
355+
options:
343356
- name: interactive
344357
default: "true"
345358
@@ -369,7 +382,11 @@ Based on reviewers feedback describe what additional tests need to be added prio
369382
implementing this enhancement to ensure the enhancements have also solid foundations.
370383
-->
371384

372-
Aside from standard testing we will also be skew testing.
385+
We're planning to expand tests adding:
386+
- config API fuzzy tests
387+
- cross API config loading
388+
- input validation and correctness
389+
- simple e2e using kuberc
373390

374391
##### Unit tests
375392

@@ -395,10 +412,9 @@ extending the production code to implement this enhancement.
395412
396413
-->
397414

398-
We're planning unit tests covering:
399-
- basic functionality
400-
- config API fuzzy tests
401-
- input validation and correctness
415+
- `k8s.io/kubectl/pkg/cmd/`: `2025-05-13` - `57.0%`
416+
- `k8s.io/kubectl/pkg/config/`: `2025-05-13` - `0.0%`
417+
- `k8s.io/kubectl/pkg/kuberc/`: `2025-05-13` - `64.5%`
402418

403419
##### Integration tests
404420

@@ -413,9 +429,7 @@ https://storage.googleapis.com/k8s-triage/index.html
413429
414430
-->
415431

416-
We're planning at least the following integration tests:
417-
- `KUBECTL_KUBERC` enablement and disablement
418-
- basic functionality
432+
- [test-cmd.run_kuberc_tests](https://github.com/kubernetes/kubernetes/blob/fd15e3fd5566fb0a65ded1883fbf51ce7a68fe28/test/cmd/kuberc.sh): [integration cmd-master](https://testgrid.k8s.io/sig-release-master-blocking#cmd-master)
419433

420434
##### e2e tests
421435

@@ -470,13 +484,24 @@ Below are some examples to consider, in addition to the aforementioned [maturity
470484
- Gather feedback from developers and surveys
471485
- Complete features A, B, C
472486
- Additional tests are in Testgrid and linked in KEP
487+
- More rigorous forms of testing—e.g., downgrade tests and scalability tests
488+
- All functionality completed
489+
- All security enforcement completed
490+
- All monitoring requirements completed
491+
- All testing requirements completed
492+
- All known pre-release issues and gaps resolved
493+
494+
**Note:** Beta criteria must include all functional, security, monitoring, and testing requirements along with resolving all issues and gaps identified
473495
474496
#### GA
475497
476498
- N examples of real-world usage
477499
- N installs
478500
- More rigorous forms of testing—e.g., downgrade tests and scalability tests
479501
- Allowing time for feedback
502+
- All issues and gaps identified as feedback during beta are resolved
503+
504+
**Note:** GA criteria must not include any functional, security, monitoring, or testing requirements. Those must be beta requirements.
480505
481506
**Note:** Generally we also wait at least two releases between beta and
482507
GA/stable, because there's no opportunity for user feedback, or even bug reports,
@@ -540,6 +565,12 @@ enhancement:
540565

541566
This feature will follow the [version skew policy of kubectl](https://kubernetes.io/releases/version-skew-policy/#kubectl).
542567

568+
Furthermore, kubectl will be equipped with a mechanism which will allow it to
569+
read all past versions of the kuberc file, and pick the latest known one.
570+
This mechanism will ensure that users can continue using whatever version of
571+
kuberc they started with, unless they are interested in newer feature available
572+
only in newer releases.
573+
543574
## Production Readiness Review Questionnaire
544575

545576
<!--
@@ -747,13 +778,6 @@ Not applicable.
747778
Pick one more of these and delete the rest.
748779
-->
749780

750-
- [ ] Metrics
751-
- Metric name:
752-
- [Optional] Aggregation method:
753-
- Components exposing the metric:
754-
- [ ] Other (treat as last resort)
755-
- Details:
756-
-
757781
Not applicable.
758782

759783
###### Are there any missing metrics that would be useful to have to improve observability of this feature?
@@ -905,6 +929,8 @@ details). For now, we leave it here.
905929

906930
###### How does this feature react if the API server and/or etcd is unavailable?
907931

932+
`kubectl` is not resilient to API server unavailability.
933+
908934
###### What are other known failure modes?
909935

910936
<!--
@@ -920,8 +946,12 @@ For each of them, fill in the following information by copying the below templat
920946
- Testing: Are there any tests for failure mode? If not, describe why.
921947
-->
922948

949+
Not applicable.
950+
923951
###### What steps should be taken if SLOs are not being met to determine the problem?
924952

953+
Not applicable.
954+
925955
## Implementation History
926956

927957
<!--
@@ -938,12 +968,11 @@ Major milestones might include:
938968
* 2021-06-02: [Proposal to add delete confirmation](https://github.com/kubernetes/enhancements/issues/2775)
939969
* 2022-06-13: This KEP created.
940970
* 2024-06-07: Update KEP with new env var name and template.
971+
* 2025-05-13: Update KEP for beta promotion.
941972

942973
## Drawbacks
943974

944-
<!--
945-
Why should this KEP _not_ be implemented?
946-
-->
975+
None considered.
947976

948977
## Alternatives
949978

@@ -953,10 +982,14 @@ not need to be as detailed as the proposal, but should include enough
953982
information to express the idea and why it was not acceptable.
954983
-->
955984

985+
None considered.
986+
956987
## Infrastructure Needed (Optional)
957988

958989
<!--
959990
Use this section if you need things from the project/SIG. Examples include a
960991
new subproject, repos requested, or GitHub details. Listing these here allows a
961992
SIG to get the process for these resources started right away.
962993
-->
994+
995+
Not applicable.

keps/sig-cli/3104-introduce-kuberc/kep.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ see-also:
2121
replaces: []
2222

2323
# The target maturity stage in the current dev cycle for this KEP.
24-
stage: alpha
24+
stage: beta
2525

2626
# The most recent milestone for which work toward delivery of this KEP has been
2727
# done. This can be the current (upcoming) milestone, if it is being actively
2828
# worked on.
29-
latest-milestone: "v1.33"
29+
latest-milestone: "v1.34"
3030

3131
# The milestone at which this feature was, or is targeted to be, at each stage.
3232
milestone:
3333
alpha: "v1.33"
34-
beta: ""
34+
beta: "1.34"
3535
stable: ""
3636

3737
# The following PRR answers are required at alpha release

0 commit comments

Comments
 (0)