<p>If I am using <a href="https://github.com/ahmetb/kubectx" rel="noreferrer"><code>kubectx</code></a> and switch kube config contexts into another cluster e.g. "Production" and run a <code>helm uninstall</code>, how does Helm know which cluster I am referring to?</p>

<p>If I run the <code>helm list</code> command is it only referring to what's installed on my local machine and not per Kubernetes cluster? </p>

Wunderbread
<p>Helm will default to using whatever your current Kubernetes context is, as specified in the <code>$HOME/.kube/config</code> file.</p>

<p>There is standard support in the Kubernetes API libraries to read data out of this file (or an alternative specified by a <code>$KUBECONFIG</code> environment variable).  If you're writing Go, see <a href="https://godoc.org/k8s.io/client-go/tools/clientcmd" rel="noreferrer">the documentation for the <code>k8s.io/client-go/tools/clientcmd</code> package</a>.  While <code>kubectx</code> does a bunch of things, <a href="https://github.com/ahmetb/kubectx/blob/master/cmd/kubectx/switch.go" rel="noreferrer">its core</a> uses that API to do essentially the same thing as running <code>kubectl config use-context ...</code>.</p>

<p>If you want Helm to use a non-default context, there is a <a href="https://docs.helm.sh/docs/helm/helm/" rel="noreferrer">global option</a> to specify it:</p>

<pre><code>kubectx production
helm list

kubectx development
helm --kube-context production list
</code></pre>
