Renew kubernetes pki after expired

前端 未结 8 1608
星月不相逢
星月不相逢 2020-12-02 23:48

My kubernetes PKI expired (API server to be exact) and I can\'t find a way to renew it. The error I get is

May 27 08:43:51 node1 kubelet[8751]: I0527 08:43:5         


        
相关标签:
8条回答
  • 2020-12-03 00:34

    So the solution was to (first a backup)

    $ cd /etc/kubernetes/pki/
    $ mv {apiserver.crt,apiserver-etcd-client.key,apiserver-kubelet-client.crt,front-proxy-ca.crt,front-proxy-client.crt,front-proxy-client.key,front-proxy-ca.key,apiserver-kubelet-client.key,apiserver.key,apiserver-etcd-client.crt} ~/
    $ kubeadm init phase certs all --apiserver-advertise-address <IP>
    $ cd /etc/kubernetes/
    $ mv {admin.conf,controller-manager.conf,kubelet.conf,scheduler.conf} ~/
    $ kubeadm init phase kubeconfig all
    $ reboot
    

    then

    $ cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
    

    that did the job for me and thanks for your hints :)

    0 讨论(0)
  • 2020-12-03 00:35

    To help anyone else with Multi-Master setup as I was searching for the answer after the first master has been updated on the second master I did this I found this from another question:

    kubeadm only upgrades if the cluster upgrade was done with certificate-renewal=true. So I manually had to delete the /etc/kubernetes/kubelet.conf and regenerated it with kubeadm init phase kubeconfig kubelet which finally fixed my problem.

    0 讨论(0)
提交回复
热议问题