Skip to content

Commit c80dca7

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

File tree

3 files changed

+65
-36
lines changed

3 files changed

+65
-36
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: 60 additions & 33 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.
@@ -261,6 +261,12 @@ As a user I would like to be able to opt out of deprecation warnings.
261261

262262
https://github.com/kubernetes/kubectl/issues/1317
263263

264+
#### Story 5
265+
266+
As a user I'd like to be warned if my kuberc file is no longer being used after first use.
267+
268+
https://github.com/kubernetes/enhancements/issues/3104#issuecomment-2775086160
269+
264270
### Notes/Constraints/Caveats (Optional)
265271

266272
<!--
@@ -295,6 +301,7 @@ Consider including folks who also work outside the SIG or subproject.
295301
| Risk | Impact | Mitigation |
296302
| --- | --- | --- |
297303
| Confusing users with a new config file | Low | Documentation and education |
304+
| Users trust the kuberc is being used | High | Provide mechanism warning users default kuberc is not being picked up |
298305

299306
## Design Details
300307

@@ -305,21 +312,32 @@ required) or even code snippets. If there's any ambiguity about HOW your
305312
proposal will be implemented, this is the place to discuss them.
306313
-->
307314

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`.
315+
For beta this feature will be enabled by default. However users can disable it
316+
setting the `KUBECTL_KUBERC` environment variable to `false`.
309317

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

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.
322+
The following top-level keys are proposed, alongside the kubernetes `metav1.TypeMeta`
323+
fields (`apiVersion`, `kind`):
316324

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.
325+
* `aliases` Allows users to declare their own command aliases, including flags and values.
326+
* `overrides` Enables users to set default flags to be applied to commands.
318327

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.
328+
`aliases` will not be permitted to override built-in commands but will take
329+
precedence over plugins (builtins -> aliases -> plugins). Any additional flags
330+
and values will be appended to the end of the aliased command. Users are
331+
responsible for defining aliases with this behavior in mind.
332+
333+
`overrides` is designed based on the principle that all configurable behavior is
334+
initially implemented as flags. This design decision was made after analyzing the
335+
intended behavior and realizing that targeting flags effectively addresses the
336+
use cases. During command execution, a merge will be occur, with inline overrides
337+
taking precedence over the defaults.
320338

321339
```
322-
apiVersion: kubectl.config.k8s.io/v1alpha1
340+
apiVersion: kubectl.config.k8s.io/v1beta1
323341
kind: Preference
324342
325343
aliases:
@@ -369,7 +387,11 @@ Based on reviewers feedback describe what additional tests need to be added prio
369387
implementing this enhancement to ensure the enhancements have also solid foundations.
370388
-->
371389

372-
Aside from standard testing we will also be skew testing.
390+
We're planning to expand tests adding:
391+
- config API fuzzy tests
392+
- cross API config loading
393+
- input validation and correctness
394+
- simple e2e using kuberc
373395

374396
##### Unit tests
375397

@@ -395,10 +417,9 @@ extending the production code to implement this enhancement.
395417
396418
-->
397419

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

403424
##### Integration tests
404425

@@ -413,9 +434,7 @@ https://storage.googleapis.com/k8s-triage/index.html
413434
414435
-->
415436

416-
We're planning at least the following integration tests:
417-
- `KUBECTL_KUBERC` enablement and disablement
418-
- basic functionality
437+
- [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)
419438

420439
##### e2e tests
421440

@@ -540,6 +559,12 @@ enhancement:
540559

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

562+
Furthermore, kubectl will be equipped with a mechanism which will allow it to
563+
read all past versions of the kuberc file, and pick the latest known one.
564+
This mechanism will ensure that users can continue using whatever version of
565+
kuberc they started with, unless they are interested in newer feature available
566+
only in newer releases.
567+
543568
## Production Readiness Review Questionnaire
544569

545570
<!--
@@ -747,13 +772,6 @@ Not applicable.
747772
Pick one more of these and delete the rest.
748773
-->
749774

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

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

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

926+
`kubectl` is not resilient to API server unavailability.
927+
908928
###### What are other known failure modes?
909929

910930
<!--
@@ -920,8 +940,12 @@ For each of them, fill in the following information by copying the below templat
920940
- Testing: Are there any tests for failure mode? If not, describe why.
921941
-->
922942

943+
Not applicable.
944+
923945
###### What steps should be taken if SLOs are not being met to determine the problem?
924946

947+
Not applicable.
948+
925949
## Implementation History
926950

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

942967
## Drawbacks
943968

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

948971
## Alternatives
949972

@@ -953,10 +976,14 @@ not need to be as detailed as the proposal, but should include enough
953976
information to express the idea and why it was not acceptable.
954977
-->
955978

979+
None considered.
980+
956981
## Infrastructure Needed (Optional)
957982

958983
<!--
959984
Use this section if you need things from the project/SIG. Examples include a
960985
new subproject, repos requested, or GitHub details. Listing these here allows a
961986
SIG to get the process for these resources started right away.
962987
-->
988+
989+
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)