Skip to content

Conversation

soltysh
Copy link
Contributor

@soltysh soltysh commented Jun 23, 2025

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

@k8s-ci-robot k8s-ci-robot added this to the 1.34 milestone Jun 23, 2025
Copy link

netlify bot commented Jun 23, 2025

👷 Deploy Preview for kubernetes-io-vnext-staging processing.

Name Link
🔨 Latest commit 134e80c
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-io-vnext-staging/deploys/6888b2d3a7ee230008f36dbe

@k8s-ci-robot k8s-ci-robot added language/en Issues or PRs related to English language cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jun 23, 2025
@k8s-ci-robot k8s-ci-robot added sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jun 23, 2025
Copy link

netlify bot commented Jun 23, 2025

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit 134e80c
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-io-main-staging/deploys/6888b2d3bc391900084d55b9
😎 Deploy Preview https://deploy-preview-51351--kubernetes-io-main-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@ardaguclu
Copy link
Member

/lgtm
from sig-cli POV

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 30, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: e21e1f494afc538904a4497edafc7c914d93f0bb

@@ -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
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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
Copy link
Contributor

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}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why delete this line?

Copy link
Contributor

@lmktfy lmktfy left a 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Aliases
## aliases


### command
## Defaults
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## 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`.

Copy link
Contributor

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"
Copy link
Contributor

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.

Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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..🙂

Copy link
Contributor Author

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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`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,
Copy link
Contributor

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`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 22, 2025
@k8s-ci-robot k8s-ci-robot requested a review from ardaguclu July 22, 2025 12:08
@soltysh
Copy link
Contributor Author

soltysh commented Jul 22, 2025

I've addressed the comments, not quite sure what @lmktfy you mean with:

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.

but I hope the new version addresses your concern.

Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Member

@rushmash91 rushmash91 left a 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"
Copy link
Member

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]>
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jul 29, 2025
@ardaguclu
Copy link
Member

/lgtm
from sig-cli POV

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 1, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 8398f59848451b2122020fd8fccd374864f33511

@michellengnx
Copy link
Contributor

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!

Copy link
Member

@dipesh-rawat dipesh-rawat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 1, 2025
@k8s-ci-robot k8s-ci-robot merged commit 276116d into kubernetes:dev-1.34 Aug 1, 2025
6 checks passed
@soltysh soltysh deleted the kuberc_beta branch August 6, 2025 05:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. language/en Issues or PRs related to English language lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants