`kubectl get pods` fails with `The connection to the server 10.0.0.10:6443 was refused - did you specify the right host or port?`.
BeginnerTroubleshootingControl plane, RBAC, webhooks and autoscaling
Answer
Likely causes → The API server is not listening: its static Pod crashed (bad flag, expired cert, etcd unreachable), the control-plane node is down, or your kubeconfig points to the wrong address. On a laptop, often a stale context to a deleted cluster.
Diagnose →
kubectl config current-context
# On the control-plane node
sudo crictl ps -a | grep kube-apiserver
sudo crictl logs $(sudo crictl ps -a --name kube-apiserver -q | head -1) 2>&1 | tail -30
sudo ss -lntp | grep 6443
Fix → Fix what the logs show: revert a bad edit in /etc/kubernetes/manifests/kube-apiserver.yaml, renew certificates, or restore etcd connectivity. The kubelet restarts the static Pod automatically.
Prevent → HA control plane behind a load balancer; back up manifests before editing; test flag changes on a non-prod cluster.
More on Control plane, RBAC, webhooks and autoscaling
A developer gets `Error from server (Forbidden): pods is forbidden: User "[email protected]" cannot list resource "pods" in API group "" in the namespace "payments"`.BeginnerA CI pipeline fails with `deployments.apps "api" is forbidden: User "system:serviceaccount:ci:deployer" cannot patch resource "deployments" in API group "apps" in the namespace "prod"`.BeginnerA user can `get pods` but `kubectl logs` fails with `cannot get resource "pods/log"` and `kubectl exec` fails with `cannot create resource "pods/exec"`.BeginnerCreating a RoleBinding fails with `is attempting to grant RBAC permissions not currently held`.IntermediateEvery `kubectl apply` fails with `Internal error occurred: failed calling webhook "validate.kyverno.svc-fail": failed to call webhook: Post "https://kyverno-svc.kyverno.svc:443/validate/fail?timeout=10s": context deadline exceeded`.AdvancedCreating a Certificate fails with `failed calling webhook "webhook.cert-manager.io": ... no endpoints available for service "cert-manager-webhook"`.Intermediate