<p>I am working on kubernetes cluster. In my cluster i am having 3 namespaces.</p>

<ul>
<li><p>Default</p></li>
<li><p>Staging</p></li>
<li><p>Production</p></li>
</ul>

<p>At a time when i want to work on staging namespace. </p>

<p>In every kubectl command i have to pass namespace</p>

<pre><code>kubectl get pods -n staging

kubectl get deployment -n staging
</code></pre>

<p>Is there any way to set active namespace at a time?</p>

<pre><code>kubectl config set-context --current --namespace=&lt;insert-namespace-name-here&gt;
# Validate it
kubectl config view --minify | grep namespace:
</code></pre>

<p>Ref: <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/#setting-the-namespace-preference" rel="noreferrer">https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/#setting-the-namespace-preference</a></p>
