Editing
Renewing Kubernetes Cluster Certificates
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
Kubernetes is supposed to renew its own certificates before there is a problem ... this was implemented in 1.15.x (??) ... but it is possible for there to be a problem if the master node is rebooted '''on the exact one-year anniversary date''' of the cluster: after the certs have expired, but before the renewal process is triggered. What you get is a message in the system logs: Client rotation is on, will bootstrap in background failed to run Kubelet: unable to load bootstrap kubeconfig: stat /etc/kubernetes/bootstrap-kubelet.conf: no such file or directory Very informative (not). After poking around, I found this post in [https://stackoverflow.com/questions/56320930/renew-kubernetes-pki-after-expired/56334732#56334732 Stack Overflow] that had the answer -- summarized here ... So the solution was to (first a backup) -- all commands as root: mkdir ~/k8s 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} ~/k8s/ kubeadm init phase certs all --apiserver-advertise-address <IP> cd /etc/kubernetes/ mv {admin.conf,controller-manager.conf,kubelet.conf,scheduler.conf} ~/k8s/ kubeadm init phase kubeconfig all reboot Then copy the new certs to the default location so we can use kubectl: cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
Summary:
Please note that all contributions to WilliamsNet Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
WilliamsNet Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Navigation
Commons
Architecture
How-To
Systems
Hardware
SysAdmin
Kubernetes
OpenSearch
Special
Pages to create
All pages
Recent changes
Random page
Help about MediaWiki
Formatting Help
Tools
What links here
Related changes
Special pages
Page information