<p>I'm having trouble understanding <code>helm</code>'s use of <code>helm --kube-context=microk8s install ...</code> should install into the context <code>microk8s</code> thus into my local microk8s cluster rather than the remote GKE cluster which I once connected to.</p>

<p>This however fails due to <code>Error: could not get Kubernetes config for context "microk8s": context "microk8s" does not exist</code> if I run e.g. <code>helm --kube-context=microk8s install --name mereet-kafka</code> after successfully running <code>helm init</code> and adding necessary repositories.</p>

<p>The context <code>microk8s</code> is present and enabled according to <code>kubectl config current-context</code>. I can even reproduce this by running <code>helm --kube-context=$(kubectl config current-context) install --name mereet-kafka</code> in order to avoid any typos.</p>

<p>Why can't <code>helm</code> use obviously present contexts?</p>

<p>This looks like a kubernetes configuration problem more than an issue with helm itself.</p>

<p>There are few things that might help:</p>

<ol>
<li><p>Check the config file in <code>~/.kube/config</code></p>

<ul>
<li><code>kubectl config view</code></li>
</ul></li>
</ol>

<p>Is <code>current-context</code> set to: microk8s?</p>

<ol start="2">
<li><p>Try to use: </p>

<ul>
<li><p><code>kubectl config get-contexts</code></p></li>
<li><p><code>kubectl config set-context</code> </p></li>
<li><p><code>kubectl config use-context</code></p></li>
</ul></li>
</ol>

<p>with proper arguments <code>--server</code> <code>--user</code> <code>--cluster</code></p>

<ol start="3">
<li><p>Check if you are refering to the config from <code>~/.kube/config</code> and not your own private config from somewhere else. </p></li>
<li><p>Check if you have a <code>KUBECONFIG</code> environment variable (<code>echo $KUBECONFIG</code>)</p></li>
</ol>

<p>I hope it helps.</p>
