On macOS (via Homebrew):
kubectl set namespace my-namespace
Worse, if you forget the flag, you might think a deployment is missing when it’s actually just hidden in another namespace. kubectl set namespace
Kubernetes doesn't have a standalone kubectl set namespace command. Instead, the namespace is a property of your . To change your default namespace, you use the set-context flag: On macOS (via Homebrew): kubectl set namespace my-namespace