Unable to get kubelet config by alpha phase

542 Views Asked by At

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

kubeadm alpha phase kubelet config write-to-disk --config=/var/lib/kubelet/config.yaml

This returns the following error:

no InitConfiguration or ClusterConfiguration kind was found in the YAML file

Could somebody please help me resolve this? Thanks.

1

There are 1 best solutions below

0
On BEST ANSWER

You basically need to print the config prior (The one that contains the InitConfiguration and the ClusterConfiguration:

$ kubeadm config print-default > cluster.yaml

Then:

$ kubeadm alpha phase kubelet config write-to-disk --config=cluster.yaml