<p>My Docker for Windows <code>~/.kube/config</code> file was replaced when setting up access to cloud based K8s cluster.</p>

<p>Is there a way to re-create it without having to restart Docker for Windows Kubernetes?</p>

<p><em>Update</em>
My current <code>~/.kube/config</code> file is now set to a GKE cluster. I don't want to reset Docker for Kubernetes and clobber it. Instead I want to create a separate kubeconfig file for Docker for Windows i.e. place it in some other location rather than <code>~/.kube/config</code>.</p>

DarVar
<p>You probably want to back up your <code>~/.kube/config</code> for GKE and then disable/reenable Kubernetes on Docker for Windows. Pull up a Windows command prompt:</p>

<pre><code>copy \&lt;where-your-.kube-is\config \&lt;where-your-.kube-is\config.bak
</code></pre>

<p>Then follow <a href="https://blog.docker.com/2018/01/docker-windows-desktop-now-kubernetes/" rel="noreferrer">this</a>. In essence, uncheck the box, wait for a few minutes and check it again.</p>

<p><a href="https://i.stack.imgur.com/87shb.png" rel="noreferrer"><img src="https://i.stack.imgur.com/87shb.png" alt="docker for windows"></a></p>

<p>You can re-recreate without disabling/reenabling Kubernetes on Docker but you will have to know exactly where your API server and credentials (certificates, etc):</p>

<pre><code> kubectl config set-context ...
 kubectl config use-context ...
</code></pre>

<p>What's odd is that you are specifying <code>~/.kube/config</code> where the <code>~</code> (tilde) thingy is unix/linux thing, but maybe what you mean is <code>$HOME</code></p>
