<p>I'm trying to get kubelet config.yaml file on my broken production cluster with no luck. The command I am using is:</p>

<pre><code>kubeadm alpha phase kubelet config write-to-disk --config=/var/lib/kubelet/config.yaml
</code></pre>

<p>This returns the following error:</p>

<pre><code>no InitConfiguration or ClusterConfiguration kind was found in the YAML file
</code></pre>

<p>Could somebody please help me resolve this? Thanks.</p>

gabriel
<p>You basically need to print the config prior (The one that contains the <code>InitConfiguration</code> and the <code>ClusterConfiguration</code>:</p>

<pre><code>$ kubeadm config print-default &gt; cluster.yaml
</code></pre>

<p>Then:</p>

<pre><code>$ kubeadm alpha phase kubelet config write-to-disk --config=cluster.yaml
</code></pre>
