hardkubectl

Set the default namespace for the current kubectl context so you don't need -n on every command

command

kubectl config set-context --current --namespace NAMESPACE_NAME

Command breakdown

Part of the Kubernetes CLI (kubectl) — Namespaces category.

kubectlconfigset-context--current--namespaceNAMESPACE_NAME
FlagPurpose
--currentBoolean flag
--namespaceBoolean flag

Test your recall — not just your reading.

Practice with interactive quiz →