Skip to content

Things I Keep Forgetting

Estimated time to read: 1 minute

  • Last Updated: October, 2026

Set/Change to a different Kubernetes or Openshift namespace

Running kubectl get pods will show you the pods running in the current namespace. By default this is the default namespace. You can see which namespace is current by running kubectl config get-context. If you want to see the pods in a different namespace you can append -n <namespace> such as kubectl get pods -n <namespace>.

Depending on what you're doing you might find it easier to change the current namespace. This means you don't have to type the -n <namespace> after each command.

You can use kubectl config set-context --current --namespace <namespace> to change it as it shown in this picture.

Comments