Skip to content

Commit bbcd302

Browse files
authored
Merge pull request #4705 from soltysh/update_preferences
KEP-3104: Introduce kuberc - update for 1.31
2 parents 808e248 + 0773162 commit bbcd302

File tree

2 files changed

+67
-28
lines changed

2 files changed

+67
-28
lines changed

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

Lines changed: 54 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,13 @@ Items marked with (R) are required *prior to targeting to a milestone / release*
139139
- [x] (R) Design details are appropriately documented
140140
- [ ] (R) Test plan is in place, giving consideration to SIG Architecture and SIG Testing input (including test refactors)
141141
- [ ] e2e Tests for all Beta API Operations (endpoints)
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)
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)
143143
- [ ] (R) Minimum Two Week Window for GA e2e tests to prove flake free
144144
- [ ] (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)
146-
- [ ] (R) Production readiness review completed
147-
- [ ] (R) Production readiness review approved
148-
- [ ] "Implementation History" section is up-to-date for milestone
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)
146+
- [x] (R) Production readiness review completed
147+
- [x] (R) Production readiness review approved
148+
- [x] "Implementation History" section is up-to-date for milestone
149149
- [ ] User-facing documentation has been created in [kubernetes/website], for publication to [kubernetes.io]
150150
- [ ] Supporting documentation—e.g., additional design documents, links to mailing list discussions/SIG meetings, relevant PRs/issues, release notes
151151

@@ -179,7 +179,7 @@ updates.
179179
[documentation style guide]: https://github.com/kubernetes/community/blob/master/contributors/guide/style-guide.md
180180
-->
181181

182-
This proposal introduces an optional `kuberc` file that is used to separate cluster credentials and server configuration from user preferences.
182+
This proposal introduces an optional `kuberc` file that is used to separate cluster credentials and server configuration from user preferences.
183183

184184
## Motivation
185185

@@ -191,9 +191,11 @@ demonstrate the interest in a KEP within the wider Kubernetes community.
191191
192192
[experience reports]: https://github.com/golang/go/wiki/ExperienceReports
193193
-->
194-
kubectl is one of the oldest parts of the Kubernetes project and has a strong guarantee on backwards compatibility. We want users to be able to opt in to new behaviors (like delete confirmation) that may be considered breaking changes for existing CI jobs and scripts.
194+
kubectl is one of the oldest parts of the Kubernetes project and has a strong guarantee on backwards compatibility. We want users to be able to opt in to new behaviors (like delete confirmation) that may be considered breaking changes for existing CI jobs and scripts.
195195

196-
[kubeconfigs already have a field for preferences](https://github.com/kubernetes/kubernetes/blob/474fd40e38bc4e7f968f7f6dbb741b7783b0740b/staging/src/k8s.io/client-go/tools/clientcmd/api/types.go#L43) that is currently underutilized. The reason for not using this existing field is that creating a new cluster generally yields a new kubeconfig file which contains credentials and host information. While kubeconfigs can be merged and specified by path, we feel there should be a clear separation between server configuration and user preferences.
196+
[kubeconfig already has a field for preferences](https://github.com/kubernetes/kubernetes/blob/474fd40e38bc4e7f968f7f6dbb741b7783b0740b/staging/src/k8s.io/client-go/tools/clientcmd/api/types.go#L43) that is currently underutilized. The reason for not using this existing field is that creating a new cluster generally yields a new kubeconfig file which contains credentials and host information. While kubeconfigs can be merged and specified by path, we feel there should be a clear separation between server configuration and user preferences.
197+
198+
Additionally, users can split kubeconfig files into various locations, while maintaining a single preference file that will apply no matter which `--kubeconfig` flag or `$KUBECONFIG` env var is pointing to.
197199

198200
### Goals
199201

@@ -303,7 +305,7 @@ required) or even code snippets. If there's any ambiguity about HOW your
303305
proposal will be implemented, this is the place to discuss them.
304306
-->
305307

306-
During alpha this feature will be enabled through the `ENABLE_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+
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`.
307309

308310
Three initial top level keys are proposed.
309311

@@ -324,16 +326,21 @@ kind: Preferences
324326
command:
325327
aliases:
326328
- alias: getdbprod
327-
command: get pods -l what=database --namespace us-2-production
328-
329+
command: get pods
330+
flags:
331+
- name: labels
332+
default: what=database
333+
- name: namespace
334+
default: us-2-production
335+
329336
overrides:
330337
- command: apply
331338
flags:
332339
- name: server-side
333340
default: "true"
334341
- command: delete
335342
flags:
336-
- name: confirm
343+
- name: interactive
337344
default: "true"
338345
- command: "*"
339346
flags:
@@ -387,10 +394,16 @@ https://testgrid.k8s.io/sig-testing-canaries#ci-kubernetes-coverage-unit
387394
388395
This can inform certain test coverage improvements that we want to do before
389396
extending the production code to implement this enhancement.
390-
-->
391397
392398
- `<package>`: `<date>` - `<test coverage>`
393399
400+
-->
401+
402+
We're planning unit tests covering:
403+
- basic functionality
404+
- config API fuzzy tests
405+
- input validation and correctness
406+
394407
##### Integration tests
395408

396409
<!--
@@ -399,10 +412,15 @@ For Alpha, describe what tests will be added to ensure proper quality of the enh
399412
400413
For Beta and GA, add links to added tests together with links to k8s-triage for those tests:
401414
https://storage.googleapis.com/k8s-triage/index.html
402-
-->
403415
404416
- <test>: <link to test coverage>
405417
418+
-->
419+
420+
We're planning at least the following integration tests:
421+
- `KUBECTL_KUBERC` enablement and disablement
422+
- basic functionality
423+
406424
##### e2e tests
407425

408426
<!--
@@ -483,7 +501,7 @@ in back-to-back releases.
483501

484502
#### Alpha
485503

486-
- Initial implementation behind environment variable.
504+
- Initial implementation behind `KUBECTL_KUBERC` environment variable.
487505

488506
#### Beta
489507

@@ -492,7 +510,7 @@ in back-to-back releases.
492510

493511
#### GA
494512

495-
- Allowing time for feedback.
513+
- Address feedback.
496514

497515

498516
### Upgrade / Downgrade Strategy
@@ -572,7 +590,7 @@ well as the [existing list] of feature gates.
572590
- Feature gate name:
573591
- Components depending on the feature gate:
574592
- [x] Other
575-
- Describe the mechanism: The environment variable `ENABLE_KUBERC=true`.
593+
- Describe the mechanism: The environment variable `KUBECTL_KUBERC=true`.
576594
- Will enabling / disabling the feature require downtime of the control
577595
plane? No.
578596
- Will enabling / disabling the feature require downtime or reprovisioning
@@ -701,10 +719,10 @@ Recall that end users cannot usually observe component logs or access metrics.
701719
-->
702720

703721
- [ ] Events
704-
- Event Reason:
722+
- Event Reason:
705723
- [ ] API .status
706-
- Condition name:
707-
- Other field:
724+
- Condition name:
725+
- Other field:
708726
- [x] Other (treat as last resort)
709727
- Details: The command will be logged with kubectl -v 2
710728

@@ -739,7 +757,7 @@ Pick one more of these and delete the rest.
739757
- Components exposing the metric:
740758
- [ ] Other (treat as last resort)
741759
- Details:
742-
-
760+
-
743761
Not applicable.
744762

745763
###### Are there any missing metrics that would be useful to have to improve observability of this feature?
@@ -862,6 +880,20 @@ This through this both in small and large cases, again with respect to the
862880

863881
No.
864882

883+
###### Can enabling / using this feature result in resource exhaustion of some node resources (PIDs, sockets, inodes, etc.)?
884+
885+
<!--
886+
Focus not just on happy cases, but primarily on more pathological cases
887+
(e.g. probes taking a minute instead of milliseconds, failed pods consuming resources, etc.).
888+
If any of the resources can be exhausted, how this is mitigated with the existing limits
889+
(e.g. pods per node) or new limits added by this KEP?
890+
891+
Are there any tests that were run/should be run to understand performance characteristics better
892+
and validate the declared limits?
893+
-->
894+
895+
No.
896+
865897
### Troubleshooting
866898

867899
<!--
@@ -909,6 +941,7 @@ Major milestones might include:
909941

910942
* 2021-06-02: [Proposal to add delete confirmation](https://github.com/kubernetes/enhancements/issues/2775)
911943
* 2022-06-13: This KEP created.
944+
* 2024-06-07: Update KEP with new env var name and template.
912945

913946
## Drawbacks
914947

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

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,19 @@ title: Introduce kuberc
22
kep-number: 3104
33
authors:
44
- "@eddiezane"
5+
- "@soltysh"
56
owning-sig: sig-cli
67
participating-sigs:
78
- sig-cli
89
status: implementable
910
creation-date: 2022-06-13
1011
reviewers:
11-
- "@soltysh"
1212
- "@liggitt"
13-
approvers:
13+
- "@eddiezane"
1414
- "@soltysh"
15+
- "@mpuckett159"
16+
approvers:
17+
- "@ardaguclu"
1518

1619
see-also:
1720
- https://github.com/kubernetes/enhancements/issues/2775
@@ -23,17 +26,20 @@ stage: alpha
2326
# The most recent milestone for which work toward delivery of this KEP has been
2427
# done. This can be the current (upcoming) milestone, if it is being actively
2528
# worked on.
26-
latest-milestone: "v1.25"
29+
latest-milestone: "v1.31"
2730

2831
# The milestone at which this feature was, or is targeted to be, at each stage.
2932
milestone:
30-
alpha: "v1.25"
31-
beta: "v1.27"
32-
stable: "v1.28"
33+
alpha: "v1.31"
34+
beta: ""
35+
stable: ""
3336

3437
# The following PRR answers are required at alpha release
3538
# List the feature gate name and the components for which it must be enabled
36-
feature-gates: []
39+
feature-gates:
40+
- name: KUBECTL_KUBERC
41+
components:
42+
- kubectl
3743
disable-supported: true
3844

3945
# The following PRR answers are required at beta release

0 commit comments

Comments
 (0)