After a power outage,
kubectl may report that the Kubernetes API server connection was refused. This indicates the endpoint could not accept a connection; it does not by itself identify the cause.Check the endpoint and node
Verify the kubeconfig endpoint, DNS resolution, network routing, and the control-plane host. Check that firewalls allow the required traffic rather than disabling the firewall globally.
On the affected node:
bash_snippet
Bash · 2 lines|
| sudo systemctl status kubelet |
| sudo journalctl -u kubelet -b --no-pager |
Inspect disk space, runtime health, and control-plane container logs using the container runtime's tools. In kubeadm installations, control-plane components are normally static Pods whose manifests are under
/etc/kubernetes/manifests.Check swap and configuration
Determine whether swap behavior is supported and configured for your Kubernetes version. Compare kubelet and runtime settings with the cluster's intended configuration. Address errors shown in the logs rather than assuming an exit code points to a particular cause.
Do not delete kubelet state files as a generic repair. CPU manager state in particular may require a specific documented recovery procedure and workload planning.
Verify recovery
Once the API server is reachable, check the cluster:
bash_snippet
Bash · 2 lines|
| kubectl get nodes |
| kubectl get pods -A |
Investigate any remaining unhealthy control-plane components or workloads before returning the cluster to service.
✦ 卷终 · 柯航存卷 ✦