<p>I have a CentOS 7 VM, which has minikube running with <code>--vm-driver=none</code>. On the VM itself, I can run kubectl commands to interact with the minikube cluster.</p>
<p>As I am new to k8s, I am not sure how to generate all the necessary values to put in the <code>~/.kube/config</code> file. My end goal is to interact with minikube cluster like my other AWS EKS clusters by using kubectl on my local machine.</p>

<p>To understand what you need in your local machine's <code>~/.kube/config</code> file, checkout the <code>~/.kube/config</code> file on the remote VM itself.</p>
<p>You'll find that you need to add these 3 items in your local machine's <code>~/.kube/config</code> file:</p>
<ol>
<li>A cluster under clusters</li>
<li>A context under contexts</li>
<li>A user under users</li>
</ol>
<p>To add these 3 items, first you need to copy these 3 files from remote VM to your local machine:</p>
<ol>
<li>ca.crt (usually found at <code>~/.minikube/profiles/minikube/ca.crt</code>)</li>
<li>client.crt (usually found at <code>~/.minikube/profiles/minikube/client.crt</code>)</li>
<li>client.key (usually found at <code>~/.minikube/profiles/minikube/client.key</code>)</li>
</ol>
<p>Now, you need to base64 encode these 3 files. For example, if you're on macOS, you can use this command:</p>
<pre><code>base64 -i &lt;input_file&gt; -o &lt;output_file&gt;
</code></pre>
<p>Now you're ready to update your local machine's <code>~/.kube/config</code> file.</p>
<ol>
<li>Add this cluster under clusters:</li>
</ol>
<pre><code>- cluster:
    certificate-authority-data: &lt;base64 of ca.crt file&gt;
    server: &lt;same ip as remote VM's kubeconfig file, since you've used vm-driver=none&gt;
  name: minikube
</code></pre>
<ol start="2">
<li>Add this context under contexts (same values as remote VM)</li>
</ol>
<pre><code>- context:
    cluster: minikube
    user: minikube
  name: minikube
</code></pre>
<ol start="3">
<li>Add this user under users</li>
</ol>
<pre><code>- name: minikube
  user:
    client-certificate-data: &lt;base64 of client.crt file&gt;
    client-key-data: &lt;base64 of client.key file&gt;
</code></pre>
