<p>I'm a perfect <strong>noob</strong> with K8s. I installed <a href="https://microk8s.io/" rel="noreferrer">microk8s</a> and <a href="https://helm.sh/" rel="noreferrer">Helm</a> using <code>snap</code> to experiment locally. I wonder whether my current issue comes from the use of <code>snap</code> (purpose of which is encapsulation, from what I understood)</p>
<h2>Environment</h2>
<p>Ubuntu 20.04LTS</p>
<pre class="lang-sh prettyprint-override"><code>helm version                                                                            
version.BuildInfo{Version:&quot;v3.2.4&quot;, GitCommit:&quot;0ad800ef43d3b826f31a5ad8dfbb4fe05d143688&quot;, GitTreeState:&quot;clean&quot;, GoVersion:&quot;go1.13.12&quot;}
kubectl version     
Client Version: version.Info{Major:&quot;1&quot;, Minor:&quot;18+&quot;, GitVersion:&quot;v1.18.4-1+6f17be3f1fd54a&quot;, GitCommit:&quot;6f17be3f1fd54a88681869d1cf8bedd5a2174504&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2020-06-23T21:16:24Z&quot;, GoVersion:&quot;go1.14.4&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}
Server Version: version.Info{Major:&quot;1&quot;, Minor:&quot;18+&quot;, GitVersion:&quot;v1.18.4-1+6f17be3f1fd54a&quot;, GitCommit:&quot;6f17be3f1fd54a88681869d1cf8bedd5a2174504&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2020-06-23T21:17:52Z&quot;, GoVersion:&quot;go1.14.4&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}
</code></pre>
<pre class="lang-sh prettyprint-override"><code>kubectl config get-contexts                                                             
CURRENT   NAME       CLUSTER            AUTHINFO   NAMESPACE
*         microk8s   microk8s-cluster   admin      
</code></pre>
<h2>Post install set up</h2>
<pre class="lang-sh prettyprint-override"><code>microk8s enable helm3
</code></pre>
<p>Kubernetes is up and running</p>
<pre class="lang-sh prettyprint-override"><code>kubectl cluster-info 
Kubernetes master is running at https://127.0.0.1:16443
CoreDNS is running at https://127.0.0.1:16443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
</code></pre>
<h2>Problem while connecting <code>helm</code> to <code>microk8s</code></h2>
<pre class="lang-sh prettyprint-override"><code>helm ls --kube-token ~/token --kube-apiserver https://127.0.0.1:16443
Error: Kubernetes cluster unreachable: Get https://127.0.0.1:16443/version?timeout=32s: x509: certificate signed by unknown authority
</code></pre>
<p>How can I tell <code>helm</code></p>
<ul>
<li>to trust <code>microk8s</code> certs or</li>
<li>to ignore this verification step</li>
</ul>
<p>From what I read, I may overcome this issue by pointing to kube's config using <code>--kubeconfig</code>.</p>
<pre class="lang-sh prettyprint-override"><code>helm ls --kube-token ~/token --kube-apiserver https://127.0.0.1:16443 --kubeconfig /path/to/kubernetes/config
</code></pre>
<p>In the context of <code>microk8s</code> installed with <code>snap</code>, I am not quite sure what this <em>conf file</em> is nor where to find it.</p>
<ul>
<li><code>/snap/microk8s/1503</code> ?</li>
<li><code>/var/snap/microk8s/1503</code> ?</li>
</ul>

<p>Helm looks for kubeconfig at this path $HOME/.kube/config.</p>
<p>Please run this command</p>
<blockquote>
<p>microk8s.kubectl config view --raw &gt; $HOME/.kube/config</p>
</blockquote>
<p>This will save the config at required path in your directory and shall work</p>
<p>Reference Link <a href="https://webcloudpower.com/use-kubernetics-locally-with-microk8s/" rel="noreferrer">here</a></p>
