<p>I need to use now multiple cluster, currently what I did is simple put all the kubeconfig
under <code>.kube</code> folder and any time update the config file with the cluster which I need , e.g.</p>
<p><code>mv config cluserone</code>
<code>vi config</code>
insert new kubeconfig to the <code>config</code> file and start working with the new cluster,
Let say inside the <code>/Users/i033346/.kube</code> I've all the kubeconfig file one by one.</p>
<p>is there a way to use them as contexts without creating a new file which contain all of them.</p>
<p>I try to use also <a href="https://github.com/ahmetb/kubectx" rel="nofollow noreferrer">kubectx</a> however when I use:</p>
<pre><code>export KUBECONFIG=/Users/i033346/.kube/trial
</code></pre>
<p>and</p>
<pre><code>export KUBECONFIG=/Users/i033346/.kube/prod
</code></pre>
<p>and use <code>kubectx</code> I always get the last one and doenst get list of the defined contexts,any idea?</p>

DavM
<p>KUBECONFIG env var supports multiple files, comma-separated:</p>
<pre><code>export KUBECONFIG=&quot;/Users/i033346/.kube/trial,/Users/i033346/.kube/prod&quot;
</code></pre>
<p>This should be enough to see all of them in <code>kubectx</code>.</p>
<p>You can even merge all configs to 1 file:</p>
<pre><code>export KUBECONFIG=&quot;/Users/i033346/.kube/trial,/Users/i033346/.kube/prod&quot;
kubectl config view --flatten &gt; ~/.kube/config
</code></pre>
