I installed my own K8S cluster on a couple Linux VMs months (or maybe a year) ago.
I went to use the K8S cluster today and got an error
Unable to connect to the server: x509: certificate has expired or is not yet
valid: current time 2022-05-14T15:28:42-04:00 is after 2022-04-23T01:49:22Z
How do I update the K8S cluster certs?
Searching for an answer
Searching for an answer gave me this:
You can renew your certificates manually at any time with the kubeadm certs renew command. This command performs the renewal using CA (or front-proxy-CA) certificate and key stored in /etc/kubernetes/pki . After running the command you should restart the control plane Pods
But when I try that command I get an error:
kubeadm certs renew
missing subcommand; "renew" is not meant to be run on its own
To see the stack trace of this error execute with --v=5 or higher
I found this page https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-certs/ which explains the kubeadm certs renew
command.
Based on the sentence:
Note: certs renew uses the existing certificates as the authoritative source for attributes (Common Name, Organization, SAN, etc.) instead of the kubeadm-config ConfigMap. It is strongly recommended to keep them both in sync.
I’m guessing nothing will work because the current certs have already expired.
This was a play system so re-creating the k8s cluster is likely the easiest thing to do.