Unable to get kubelet config by alpha phase

11/6/2018

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.

-- gabriel
kubeadm
kubernetes

1 Answer

11/6/2018

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
-- Rico
Source: StackOverflow