You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: keps/sig-cli/3104-introduce-kuberc/README.md
+71-38Lines changed: 71 additions & 38 deletions
Original file line number
Diff line number
Diff line change
@@ -137,17 +137,17 @@ Items marked with (R) are required *prior to targeting to a milestone / release*
137
137
-[x] (R) Enhancement issue in release milestone, which links to KEP dir in [kubernetes/enhancements] (not the initial KEP PR)
138
138
-[x] (R) KEP approvers have approved the KEP status as `implementable`
139
139
-[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)
142
142
-[ ] (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)
143
143
-[ ] (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)
146
146
-[x] (R) Production readiness review completed
147
147
-[x] (R) Production readiness review approved
148
148
-[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
151
151
152
152
<!--
153
153
**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?
207
207
* Introduce a `kuberc` file as a place for client preferences.
208
208
* Version and structure this file in a way that makes it easy to introduce new behaviors and settings for users.
@@ -305,41 +305,54 @@ required) or even code snippets. If there's any ambiguity about HOW your
305
305
proposal will be implemented, this is the place to discuss them.
306
306
-->
307
307
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.
309
312
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`.
311
316
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`):
316
319
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.
318
322
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.
320
333
321
334
```
322
-
apiVersion: kubectl.config.k8s.io/v1alpha1
335
+
apiVersion: kubectl.config.k8s.io/v1beta1
323
336
kind: Preference
324
337
325
338
aliases:
326
339
- name: getdbprod
327
340
command: get
328
341
prependArgs:
329
342
- pods
330
-
flags:
343
+
options:
331
344
- name: labels
332
345
default: what=database
333
346
- name: namespace
334
347
default: us-2-production
335
348
336
-
overrides:
349
+
defaults:
337
350
- command: apply
338
-
flags:
351
+
options:
339
352
- name: server-side
340
353
default: "true"
341
354
- command: delete
342
-
flags:
355
+
options:
343
356
- name: interactive
344
357
default: "true"
345
358
@@ -369,7 +382,11 @@ Based on reviewers feedback describe what additional tests need to be added prio
369
382
implementing this enhancement to ensure the enhancements have also solid foundations.
370
383
-->
371
384
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
373
390
374
391
##### Unit tests
375
392
@@ -395,10 +412,9 @@ extending the production code to implement this enhancement.
@@ -470,13 +484,24 @@ Below are some examples to consider, in addition to the aforementioned [maturity
470
484
- Gather feedback from developers and surveys
471
485
- Complete features A, B, C
472
486
- 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
473
495
474
496
#### GA
475
497
476
498
- N examples of real-world usage
477
499
- N installs
478
500
- More rigorous forms of testing—e.g., downgrade tests and scalability tests
479
501
- 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.
480
505
481
506
**Note:** Generally we also wait at least two releases between beta and
482
507
GA/stable, because there's no opportunity for user feedback, or even bug reports,
@@ -540,6 +565,12 @@ enhancement:
540
565
541
566
This feature will follow the [version skew policy of kubectl](https://kubernetes.io/releases/version-skew-policy/#kubectl).
542
567
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
+
543
574
## Production Readiness Review Questionnaire
544
575
545
576
<!--
@@ -747,13 +778,6 @@ Not applicable.
747
778
Pick one more of these and delete the rest.
748
779
-->
749
780
750
-
-[ ] Metrics
751
-
- Metric name:
752
-
-[Optional] Aggregation method:
753
-
- Components exposing the metric:
754
-
-[ ] Other (treat as last resort)
755
-
- Details:
756
-
-
757
781
Not applicable.
758
782
759
783
###### 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.
905
929
906
930
###### How does this feature react if the API server and/or etcd is unavailable?
907
931
932
+
`kubectl` is not resilient to API server unavailability.
933
+
908
934
###### What are other known failure modes?
909
935
910
936
<!--
@@ -920,8 +946,12 @@ For each of them, fill in the following information by copying the below templat
920
946
- Testing: Are there any tests for failure mode? If not, describe why.
921
947
-->
922
948
949
+
Not applicable.
950
+
923
951
###### What steps should be taken if SLOs are not being met to determine the problem?
924
952
953
+
Not applicable.
954
+
925
955
## Implementation History
926
956
927
957
<!--
@@ -938,12 +968,11 @@ Major milestones might include:
938
968
* 2021-06-02: [Proposal to add delete confirmation](https://github.com/kubernetes/enhancements/issues/2775)
939
969
* 2022-06-13: This KEP created.
940
970
* 2024-06-07: Update KEP with new env var name and template.
971
+
* 2025-05-13: Update KEP for beta promotion.
941
972
942
973
## Drawbacks
943
974
944
-
<!--
945
-
Why should this KEP _not_ be implemented?
946
-
-->
975
+
None considered.
947
976
948
977
## Alternatives
949
978
@@ -953,10 +982,14 @@ not need to be as detailed as the proposal, but should include enough
953
982
information to express the idea and why it was not acceptable.
954
983
-->
955
984
985
+
None considered.
986
+
956
987
## Infrastructure Needed (Optional)
957
988
958
989
<!--
959
990
Use this section if you need things from the project/SIG. Examples include a
960
991
new subproject, repos requested, or GitHub details. Listing these here allows a
961
992
SIG to get the process for these resources started right away.
0 commit comments