Kubernetes Blog
Follow
Kubernetes v1.34: User preferences (kuberc) are available for testing in kubectl 1.34
Kubectl user preferences are now reaching beta in Kubernetes v1.34, offering customization options. This functionality allows users to define custom settings for kubectl commands. A user preferences file, typically named kuberc, is located in the default kubeconfig directory, $HOME/.kube. This file uses an apiVersion and kind structure, similar to Kubernetes manifests. The defaults section enables setting default values for kubectl command options, such as always using interactive delete. These defaults can be overridden by explicitly providing different options during command execution. Another recommended default is enabling Server-Side Apply for kubectl apply commands. The aliases section allows users to create shortcuts for frequently used commands, saving time and effort. Aliases can be defined to map to specific kubectl commands with predefined arguments and options. The mechanism supports both prepending and appending arguments to the underlying kubectl command. Debugging information for this feature can be accessed with increased verbosity, such as using -v=5. User feedback is highly encouraged as the feature matures, and users can contribute through Slack, GitHub issues, or community meetings.