Closed
Description
Is this a request for help?
If yes, you should use our troubleshooting guide and community support channels, see http://kubernetes.io/docs/troubleshooting/.
If no, delete this section and continue on.
What keywords did you search in kubeadm issues before filing this one?
If you have found any duplicates, you should instead reply there and close this page.
If you have not found any duplicates, delete this section and continue on.
Is this a BUG REPORT or FEATURE REQUEST?
Choose one: BUG REPORT or FEATURE REQUEST
Versions
kubeadm version (use kubeadm version
):1.7.5
Environment:
- Kubernetes version (use
kubectl version
):1.7.5 - Cloud provider or hardware configuration:
- OS (e.g. from /etc/os-release):
- Kernel (e.g.
uname -a
): - Others:
Activity
errordeveloper commentedon Jan 22, 2018
Duplicate of #206.
kachkaev commentedon Aug 3, 2018
@zalmanzhao did you manage to solve this issue?
I created a kubeadm
v1.9.3
cluster just over a year ago and it was working fine all this time. I went to update one deployment today and realised I was locked out of the API because the cert got expired. I can't evenkubeadm alpha phase certs apiserver
, because I getfailure loading apiserver certificate: the certificate has expired
(kubeadm version is currently1.10.6
since I want to upgrade).Adding
insecure-skip-tls-verify: true
to~/.kube/config
→clusters[0].cluser
does not help too – I seeYou must be logged in to the server (Unauthorized)
when trying tokubectl get pods
(kubernetes/kubernetes#39767).The cluster is working, but it lives its own life until it self-destroys or until things get fixed 😅 Unfortunately, I could not find a solution for my situation in #206 and am wondering how to get out of it. The only relevant material I could dig out was a blog post called ‘How to change expired certificates in kubernetes cluster’, which looked promising at first glance. However, it did not fit in the end because my master machine did not have
/etc/kubernetes/ssl/
folder (only/etc/kubernetes/pki/
) – either I have a different k8s version or I simply deleted that folder without noticing.@errordeveloper could you please recommend something? I'd love to fix things without
kubeadm reset
and payload recreation.davidcomeyne commentedon Sep 6, 2018
@kachkaev Did you have any luck on renewing the certs without resetting the kubeadm?
If so, please share, I'm having the same issue here with k8s 1.7.4. And I can't seem to upgrade ($ kubeadm upgrade plan) because the error pops up again telling me the the certificate has expired and that it cannot list the masters in my cluster:
kachkaev commentedon Sep 6, 2018
Unfortunately, I gave up in the end. The solution was to create a new cluster, restore all the payload on it, switch DNS records and finally delete the original cluster 😭 At least there was no downtime because I was lucky enough to have healthy pods on the old k8s during the transition.
davidcomeyne commentedon Sep 6, 2018
Thanks @kachkaev for responding. I will nonetheless give it another try.
If I find something I will make sure to post it here...
danroliver commentedon Sep 14, 2018
If you are using a version of kubeadm prior to 1.8, where I understand certificate rotation #206 was put into place (as a beta feature) or your certs already expired, then you will need to manually update your certs (or recreate your cluster which it appears some (not just @kachkaev) end up resorting to).
You will need to SSH into your master node. If you are using kubeadm >= 1.8 skip to 2.
There is an important note here. If you are on AWS, you will need to explicitly pass the
--node-name
parameter in this request. Otherwise you will get an error like:Unable to register node "ip-10-0-8-141.ec2.internal" with API server: nodes "ip-10-0-8-141.ec2.internal" is forbidden: node ip-10-0-8-141 cannot modify node ip-10-0-8-141.ec2.internal
in your logssudo journalctl -u kubelet --all | tail
and the Master Node will report that it isNot Ready
when you runkubectl get nodes
.Please be certain to replace the values passed in
--apiserver-advertise-address
and--node-name
with the correct values for your environment.kubectl
is looking in the right place for your config files.If you do not have a valid token. You can create one with:
The token should look something like 6dihyb.d09sbgae8ph2atjw
Hopefully this gets you where you need to be @davidcomeyne.
davidcomeyne commentedon Sep 15, 2018
Thanks a bunch @danroliver !
I will definitely try that and post my findings here.
ivan4th commentedon Oct 22, 2018
@danroliver Thanks! Just tried it on an old single-node cluster, so did steps up to 7. It worked.
dmellstrom commentedon Oct 22, 2018
@danroliver Worked for me. Thank you.
davidcomeyne commentedon Oct 23, 2018
Did not work for me, had to set up a new cluster. But glad it helped others!
fovecifer commentedon Oct 30, 2018
thank you @danroliver . it works for me
and my kubeadm version is 1.8.5
kvchitrapu commentedon Nov 1, 2018
Thanks @danroliver putting together the steps. I had to make small additions to your steps. My cluster is running v1.9.3 and it is in a private datacenter off of the Internet.
On the Master
config.yml
.--config config.yml
like this:On the minions
I had to move
55 remaining items