-
Notifications
You must be signed in to change notification settings - Fork 15k
[KEP-3104] Kuberc beta #51351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[KEP-3104] Kuberc beta #51351
Conversation
👷 Deploy Preview for kubernetes-io-vnext-staging processing.
|
✅ Pull request preview available for checkingBuilt without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
/lgtm |
LGTM label has been added. Git tree hash: e21e1f494afc538904a4497edafc7c914d93f0bb
|
content/en/docs/reference/_index.md
Outdated
@@ -89,7 +90,7 @@ operator to use or manage a cluster. | |||
* [kube-controller-manager configuration (v1alpha1)](/docs/reference/config-api/kube-controller-manager-config.v1alpha1/) | |||
* [kube-proxy configuration (v1alpha1)](/docs/reference/config-api/kube-proxy-config.v1alpha1/) | |||
* [`audit.k8s.io/v1` API](/docs/reference/config-api/apiserver-audit.v1/) | |||
* [Client authentication API (v1beta1)](/docs/reference/config-api/client-authentication.v1beta1/) and | |||
* [Client authentication API (v1beta1)](/docs/reference/config-api/client-authentication.v1beta1/) and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Avoid changing this line
## Disable kuberc | ||
|
||
To temporarily disable the kuberc functionality, simply export the environment variable `KUBERC` with the value `off`: | ||
To temporarily disable the kuberc functionality, simply export the environment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To temporarily disable the kuberc functionality, simply export the environment | |
To temporarily disable the kuberc functionality, set (and export) the environment |
## Disable kuberc | ||
|
||
To temporarily disable the kuberc functionality, simply export the environment variable `KUBERC` with the value `off`: | ||
To temporarily disable the kuberc functionality, simply export the environment | ||
variable `KUBERC` with the value `off`: | ||
|
||
```shell | ||
export KUBERC=off |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this assume that the path off
is invalid?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, value off is strictly for disabling kuberc functionality, especially once we graduate fully to stable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's document that mini snag: you can't name your kuberc off
compiled-in default value. | ||
{{< /note >}} | ||
|
||
#### Example |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why delete this line?
|
||
Append arbitrary arguments to the end of the kubectl command. | ||
|
||
#### Example {#appendArgs-example} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why delete this line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a reference document, this should retain the terse style of the existing reference (with, of course, the appropriate factual updates).
Please amend it to align more with the existing approach.
|
||
Alias name must not collide with the built-in commands. | ||
Within a `kuberc` configuration, _aliases_ section allows you to define custom |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Within a `kuberc` configuration, _aliases_ section allows you to define custom | |
Within a `kuberc` configuration, the _aliases_ section allows you to define custom |
|
||
## aliases | ||
Currently, this file allows you to define two types of user preferences: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, this file allows you to define two types of user preferences: | |
A kuberc using the v1beta1 format allows you to define two types of user preferences: |
|
||
### name | ||
## Aliases |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## Aliases | |
## aliases |
|
||
### command | ||
## Defaults |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## Defaults | |
## defaults |
This includes support for subcommands like `create role`. | ||
1. `options` - Specify default values for options. If you explicitly specify an option | ||
when you run `kubectl`, the value you provide takes precedence over the default | ||
one defined in `kuberc`. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why delete this line?
- command: delete | ||
flags: | ||
options: | ||
- name: interactive | ||
default: "true" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optionally, use a comment to explain why the value is quoted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@soltysh is a multi one type command better here?
apiVersion: kubectl.config.k8s.io/v1beta1
kind: Preference
aliases:
- name: rolloutwatch
command: rollout status
options:
- name: watch
default: "true"
With this alias, running kubectl rolloutwatch deployments/nginx
will be translated to kubectl rollout status deployments/nginx --watch
. This demonstrates how aliases can work with multi-word commands like rollout status
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we'll unnecessarily muddy the picture. That's why I went with the simplest possible example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure! I'll defer to you if you think it's not required. I think there can be a section about the non-simple stuff as well. Maybe in the later versions..🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can always expand examples towards promoting this feature to GA.
|
||
#### Example | ||
This next example makes the interactive removal the default mode for invoking | ||
`kubectl delete` command: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`kubectl delete` command: | |
`kubectl delete`: |
|
||
A Kubernetes `kuberc` configuration file allows you to define preferences for kubectl, such as default options and command aliases. | ||
Unlike the kubeconfig file, a `kuberc` configuration file does **not** contain cluster details, usernames or passwords. | ||
A Kubernetes `kuberc` configuration file allows you to define preferences for kubectl, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even better: make kubectl a hyperlink or a glossary tooltip.
|
||
#### Example {#flags-example} | ||
This next example defines `kubectl getn` alias for `kubectl get` command, additionally | ||
setting output flag `--output=json`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setting output flag `--output=json`. | |
specifying JSON output format: `--output=json`. |
If you explicitly specify a command line argument when you run kubectl, the value you provide takes precedence over the default one defined in kuberc. | ||
|
||
#### Example {#flags-example} | ||
This next example defines `kubectl getn` alias for `kubectl get` command, additionally |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This next example defines `kubectl getn` alias for `kubectl get` command, additionally | |
This next example defines a `kubectl getn` alias for the `kubectl get` subcommand, additionally |
I've addressed the comments, not quite sure what @lmktfy you mean with:
but I hope the new version addresses your concern. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't update this file in this PR. Leave that update for the v1.34 docs team.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can drop the entire Add generated files
commit, most likely. Since that should be performed by the docs team, I believe. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes please; that's what we recommend in general.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dropped the 2nd commit with generated changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@soltysh this looks good! I minor since there isnt an example with multiple words for the command.
- command: delete | ||
flags: | ||
options: | ||
- name: interactive | ||
default: "true" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@soltysh is a multi one type command better here?
apiVersion: kubectl.config.k8s.io/v1beta1
kind: Preference
aliases:
- name: rolloutwatch
command: rollout status
options:
- name: watch
default: "true"
With this alias, running kubectl rolloutwatch deployments/nginx
will be translated to kubectl rollout status deployments/nginx --watch
. This demonstrates how aliases can work with multi-word commands like rollout status
.
Signed-off-by: Maciej Szulik <[email protected]>
/lgtm |
LGTM label has been added. Git tree hash: 8398f59848451b2122020fd8fccd374864f33511
|
Hello @soltysh 👋! I'm reaching out from the Docs team. Just checking in as we approach Docs Freeze on Wednesday August 6, 2025 18:00 PDT. This documentation appears to still be under review. To meet the Docs Freeze, this PR must have a technical review as well as lgtm and approve labels applied, without any unaddressed comments or concerns from SIG Docs. Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dipesh-rawat The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Description
Promote kuberc to beta
Issue
KEP: kubernetes/enhancements#3104
/assign @ardaguclu
for sig-cli review
The generated changes are coming from kubernetes-sigs/reference-docs#396