Skip to content

Commit 30720cf

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

File tree

3 files changed

+66
-36
lines changed

3 files changed

+66
-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: 61 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ tags, and then generate with `hack/update-toc.sh`.
8888
- [Story 2](#story-2)
8989
- [Story 3](#story-3)
9090
- [Story 4](#story-4)
91+
- [Story 5](#story-5)
9192
- [Notes/Constraints/Caveats (Optional)](#notesconstraintscaveats-optional)
9293
- [Open Questions](#open-questions)
9394
- [Risks and Mitigations](#risks-and-mitigations)
@@ -137,17 +138,17 @@ Items marked with (R) are required *prior to targeting to a milestone / release*
137138
- [x] (R) Enhancement issue in release milestone, which links to KEP dir in [kubernetes/enhancements] (not the initial KEP PR)
138139
- [x] (R) KEP approvers have approved the KEP status as `implementable`
139140
- [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)
141+
- [x] (R) Test plan is in place, giving consideration to SIG Architecture and SIG Testing input (including test refactors)
142+
- [x] e2e Tests for all Beta API Operations (endpoints)
142143
- [ ] (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)
143144
- [ ] (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)
145+
- [x] (R) Graduation criteria is in place
146+
- [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)
146147
- [x] (R) Production readiness review completed
147148
- [x] (R) Production readiness review approved
148149
- [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
150+
- [x] User-facing documentation has been created in [kubernetes/website], for publication to [kubernetes.io]
151+
- [x] Supporting documentation—e.g., additional design documents, links to mailing list discussions/SIG meetings, relevant PRs/issues, release notes
151152

152153
<!--
153154
**Note:** This checklist is iterative and should be reviewed and updated every time this enhancement is being considered for a milestone.
@@ -261,6 +262,12 @@ As a user I would like to be able to opt out of deprecation warnings.
261262

262263
https://github.com/kubernetes/kubectl/issues/1317
263264

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

266273
<!--
@@ -295,6 +302,7 @@ Consider including folks who also work outside the SIG or subproject.
295302
| Risk | Impact | Mitigation |
296303
| --- | --- | --- |
297304
| Confusing users with a new config file | Low | Documentation and education |
305+
| Users trust the kuberc is being used | High | Provide mechanism warning users default kuberc is not being picked up |
298306

299307
## Design Details
300308

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

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

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

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

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

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

321340
```
322-
apiVersion: kubectl.config.k8s.io/v1alpha1
341+
apiVersion: kubectl.config.k8s.io/v1beta1
323342
kind: Preference
324343
325344
aliases:
@@ -369,7 +388,11 @@ Based on reviewers feedback describe what additional tests need to be added prio
369388
implementing this enhancement to ensure the enhancements have also solid foundations.
370389
-->
371390

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

374397
##### Unit tests
375398

@@ -395,10 +418,9 @@ extending the production code to implement this enhancement.
395418
396419
-->
397420

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

403425
##### Integration tests
404426

@@ -413,9 +435,7 @@ https://storage.googleapis.com/k8s-triage/index.html
413435
414436
-->
415437

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

420440
##### e2e tests
421441

@@ -540,6 +560,12 @@ enhancement:
540560

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

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

545571
<!--
@@ -747,13 +773,6 @@ Not applicable.
747773
Pick one more of these and delete the rest.
748774
-->
749775

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

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

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

927+
`kubectl` is not resilient to API server unavailability.
928+
908929
###### What are other known failure modes?
909930

910931
<!--
@@ -920,8 +941,12 @@ For each of them, fill in the following information by copying the below templat
920941
- Testing: Are there any tests for failure mode? If not, describe why.
921942
-->
922943

944+
Not applicable.
945+
923946
###### What steps should be taken if SLOs are not being met to determine the problem?
924947

948+
Not applicable.
949+
925950
## Implementation History
926951

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

942968
## Drawbacks
943969

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

948972
## Alternatives
949973

@@ -953,10 +977,14 @@ not need to be as detailed as the proposal, but should include enough
953977
information to express the idea and why it was not acceptable.
954978
-->
955979

980+
None considered.
981+
956982
## Infrastructure Needed (Optional)
957983

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