When the Kubernetes certificates on the vSphere Kubernetes Cluster (also known as Guest Cluster) Control Plane VMs have expired:
This KB article is intended to be used only when the above certmgr script fails to rotate the certificates.
HH:MM:SS etcd_actions.go:66: etcd still not healthy result {"level":"warn","ts":YYYY-MM-DDTHH:MM:SS.sssZ","logger":"etcd-client","caller":"v#@v#.#.#/retry_interceptor.go:62","msg":"retrying of unary invokre failed","target":"etcd-endpoints://0xc#######/127.0.0.1:2379","attempt":0,"error":"rpc error: code = DeadlineExceeded desc = latest balancer error: last connection error: connection error: desc = \"transport: authentication handshake failed: x509: certificate has expired or is not yet valid: current time YYYY-MM-DDT:HH:MM:SSZ is after YYYY-MM-DDTHH:MM:SSZ\""}
Error: context deadline exceeded
time="YYYY-MM-DDTHH:MM:SSZ" level=fatal msg="execing command in container: command terminated with exit code 1"
kubectl
commands are failing with error "tls: failed to verify certificate: x509: certificate has expired or is not yet valid"
couldn't get current server API group list: Get "https://IP_Address:6443/api?timeout=32s": tls: failed to verify certificate: x509: certificate has expired or is not yet valid: current time YYYY-MM-DDTHH:MM:SS+00:00 is after YYYY-MM-DDTHH:MM:SSZ
vSphere 7.0 with Tanzu
vSphere 8.0 with Tanzu
Certificates expire regardless of whether or not this cluster is managed by TMC.
Kubernetes has a default certificate expiration time of 1 year.
VMware by Broadcom products adhere to this certificate expiration timeframe.
Certificates can be manually rotated from within the affected vSphere Kubernetes (also known as guest cluster) using kubeadm.
If you are looking for Supervisor Cluster certificate rotation, please see: Replace vSphere with Tanzu Supervisor Certificates
This manual certificate renewal KB article requires that the VMware by Broadcom Technical Support's breakglass system account user vmware-system-user is not expired for the cluster.
If this vmware-system-user account and guest cluster certificates are expired, please reach out to VMware by Broadcom Technical Support referencing this KB article.
kubeadm certs check-expiration
kubeadm certs renew all
kubeadm certs check-expiration
crictl ps | egrep "CONTAINER|sched|kube-controller|apiserver|etcd"
crictl stop <kube-scheduler container id>
crictl stop <kube-controller container id>
crictl stop <kube-apiserver container id>
crictl stop <etcd container id>
./certmgr tkc certificates list -n <affected cluster namespace> <affected cluster name>