Forrest logo
back to the kubens tool

kubens:tldr:3e073

kubens: List the namespaces.
$ kubens
try on your machine

The command "kubens" is a shorthand for "kubectl config use-context" command in Kubernetes.

In Kubernetes, a "context" is a cluster, user, and namespace combination. It defines the cluster that kubectl configures and interacts with. The "kubectl config" command is used to manage these contexts.

The "kubens" command allows users to quickly switch between namespaces within a context without specifying the entire context every time. When you run "kubens", it provides a list of available namespaces and prompts you to select the one you want to switch to. Once you make your selection, "kubens" internally runs "kubectl config use-context --namespace=" to switch to the desired namespace within the current context.

This command is helpful when you are working with multiple namespaces and want to easily switch back and forth without explicitly typing the entire "kubectl config use-context" command each time.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the kubens tool