# I lost my kubelet PKI certs on my controller -- recover from disaster?

**URL:** <https://forums.k8slens.dev/t/i-lost-my-kubelet-pki-certs-on-my-controller-recover-from-disaster/149>\
**Category:** All about k0s\
**Created:** [February 17, 2023, 6:17pm UTC](https://forums.k8slens.dev/t/i-lost-my-kubelet-pki-certs-on-my-controller-recover-from-disaster/149 "2023-02-17T18:17:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wizpresso-steve-cy-f](https://forums.k8slens.dev/letter_avatar_proxy/v4/letter/w/b19c9b/32.png) [@wizpresso-steve-cy-f](https://forums.k8slens.dev/u/wizpresso-steve-cy-f)\
**Post date:** [February 17, 2023, 6:17pm UTC](https://forums.k8slens.dev/t/i-lost-my-kubelet-pki-certs-on-my-controller-recover-from-disaster/149/1 "2023-02-17T18:17:16Z")

</div>

I have accidentally deleted `/var/lib/k0s/kubelet/pki` and now my controller is in a dead state. I can access the kube-api but the kubelet seems dead indeed. I have been able to recover the worker in some sense but the controller is not going to work. I wonder what should I do to recover a correct `/var/lib/k0s/kubelet/pki` without deleting the controller node because it runs Rook and Ceph and I cannot afford to lose it

---

<div class="post-metadata">

**Author:** ![jnummelin](https://forums.k8slens.dev/letter_avatar_proxy/v4/letter/j/c5a1d2/32.png) [@jnummelin](https://forums.k8slens.dev/u/jnummelin)\
**Post date:** [February 20, 2023, 9:30am UTC](https://forums.k8slens.dev/t/i-lost-my-kubelet-pki-certs-on-my-controller-recover-from-disaster/149/2 "2023-02-20T09:30:10Z")

</div>

Which k0s version are you running?

---

<div class="post-metadata">

**Author:** ![jnummelin](https://forums.k8slens.dev/letter_avatar_proxy/v4/letter/j/c5a1d2/32.png) [@jnummelin](https://forums.k8slens.dev/u/jnummelin)\
**Post date:** [February 20, 2023, 10:16am UTC](https://forums.k8slens.dev/t/i-lost-my-kubelet-pki-certs-on-my-controller-recover-from-disaster/149/3 "2023-02-20T10:16:15Z")

</div>

**Note:** We cannot fully replicate you env & current situation, thus the recommendations might not be 100% accurate

**Note2:** If possible, take backups on the data at Rook/Ceph storage before doing anythng else

Deleting `/var/lib/k0s/kubelet/pki` essentially deletes kubelet auth certs which it uses to connect to the API. In the logs you probably see kubelet trying to come up but fails to load the certs.

In my test env I was able to overcome this by deleting also `/var/lib/k0s/kubelet.conf` which references the certs in `.../pki/` dir. After I deleted the file kubelet came up properly and everything was running smoothly. Of course, I did not have Rook/Ceph running there but at least all the usual pods was kept running without restarts.
