<p>Unfortunately I lost my local </p>

<blockquote>
  <p>~/.kube/config</p>
</blockquote>

<p>where I had configuration for my namespace.</p>

<p>Is there a way to get this config if I have access to master nodes?</p>

<p>Thanks in advance</p>

kpazik
<p>I believe you're using kubeadm to start your kubernetes cluster, you can generate the new kubeconfig file using following command:</p>

<pre><code>kubeadm alpha phase kubeconfig admin --kubeconfig-dir /etc/kubernetes --cert-dir /etc/kubernetes/pki
</code></pre>

<p>This will generate a new config file in <code>/etc/kubernetes/admin.conf</code>. Then you can copy the file in following way:</p>

<pre><code>mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
</code></pre>
