DEV Community

Florian Cartron for Zenika

Posted on

1 1 1 1

kuberc: an exciting new feature for kubectl

Kubernetes 1.33, scheduled for late April, introduces kuberc, a new feature that allows you to customize kubectl. This feature, described in KEP-3104, enables you to create aliases and enforce options for kubectl subcommands.

This customization is possible through a .kube/kuberc file in your home directory (the path can be modified with the --kuberc flag).

The example below demonstrates how to create an alias for creating a namespace with a predefined name, and how to force the interactive behavior of the kubectl delete command:

apiVersion: kubectl.config.k8s.io/v1alpha1
kind: Preference
# alias "kubectl crns" for "kubectl create namespace test-kuberc-ns"
aliases:
  - name: crns
    command: create namespace
    appendArgs:
      - test-kuberc-ns
# Force the --interactive=true flag for kubectl delete
overrides:
  - command: delete
    flags:
      - name: interactive
        default: "true"
Enter fullscreen mode Exit fullscreen mode

kuberc in action

Let’s take the example of the kubectl delete command. Kubernetes maintainers cannot enable confirmation before deletion by default, as it would disrupt many CI/CD processes. However, with kuberc’s customization options, you can enable this feature when needed, without affecting other users.

This feature will be available in alpha with Kubernetes 1.33 and can be activated using the environment variable KUBECTL_KUBERC=true. Note that, for now, kubectl’s auto-completion does not work with aliases defined by kuberc.

AWS Security LIVE! Stream

Streaming live from AWS re:Inforce

What’s next in cybersecurity? Find out live from re:Inforce on Security LIVE!

Learn More

Top comments (0)

ACI image

ACI.dev: Fully Open-source AI Agent Tool-Use Infra (Composio Alternative)

100% open-source tool-use platform (backend, dev portal, integration library, SDK/MCP) that connects your AI agents to 600+ tools with multi-tenant auth, granular permissions, and access through direct function calling or a unified MCP server.

Check out our GitHub!

👋 Kindness is contagious

Explore this insightful write-up, celebrated by our thriving DEV Community. Developers everywhere are invited to contribute and elevate our shared expertise.

A simple "thank you" can brighten someone’s day—leave your appreciation in the comments!

On DEV, knowledge-sharing fuels our progress and strengthens our community ties. Found this useful? A quick thank you to the author makes all the difference.

Okay