/kubernetes-platform-skills:kubernetes-node-maintenance-and-troubleshootingfrom kubernetes-platform-skills
Guides safe Kubernetes node maintenance (cordon/drain/uncordon) with PodDisruptionBudget awareness, and diagnoses NotReady nodes by checking kubelet, runtime, network, disk causes.
Ships in kubernetes-platform-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Taking a node out of service — for an OS patch, a hardware swap, a
kubelet upgrade, or decommissioning — is routine, but doing it wrong is
one of the most common self-inflicted causes of a Kubernetes outage: a
drain evicts every non-DaemonSet pod on the node, and if the workload
running there doesn't have enough replicas elsewhere (and no
PodDisruptionBudget to make that constraint explicit), the eviction
itself becomes the incident. Separately, a node that goes NotReady
unexpectedly needs its own diagnosis — kubelet/runtime/network/disk
causes each look similar from kubectl get nodes but require different
fixes. This skill covers the safe cordon/drain/uncordon sequence with
PodDisruptionBudget awareness, and diagnosing an unexpectedly
NotReady node.
NotReady in kubectl get nodes and needs root-cause
diagnosis before deciding whether to wait, intervene, or replace it.kubectl drain is hanging or timing out and it's unclear whether
that's expected (a PodDisruptionBudget correctly blocking it) or a
different problem.kubectl uncordon after
maintenance completes.kubeadm upgrade — see
kubernetes-cluster-provisioning-with-kubeadm-and-cluster-api
for the upgrade sequence this fits into.kubectl access with permission to cordon/drain/uncordon nodes and to
evict pods across the namespaces scheduled on that node (nodes/drain
and pods/eviction RBAC verbs, in addition to general node read
access).PodDisruptionBudget (PDB) covering workloads on
the target node — a drain that respects PDBs (the default,
eviction-based behavior) will block rather than violate one, which is
correct behavior, not a bug to work around.NotReady (kubelet logs, disk usage, container runtime status)
— kubectl alone often can't explain why a node stopped reporting
Ready.kubectl drain does not evict DaemonSet-managed
pods by default (--ignore-daemonsets is required and expected for
any node running DaemonSets, which is nearly every real cluster) and
does not delete emptyDir-backed pod data by default either
(--delete-emptydir-data is required to proceed past pods using
local ephemeral storage).Diagnose a NotReady node before doing anything else, if that's
why you're here rather than planned maintenance:
kubectl describe node <node>
Check the Conditions block: Ready=False/Unknown,
MemoryPressure, DiskPressure, PIDPressure each point to a
different cause. Ready=Unknown typically means the node stopped
reporting to the API server at all (network partition, kubelet
crashed) rather than reporting an explicit failure.
Check kubelet and runtime health directly on the node — the API server's view is downstream of both:
# on the node itself
systemctl status kubelet
journalctl -u kubelet -n 200 --no-pager
systemctl status containerd # or the configured CRI runtime
df -h # DiskPressure candidate
Common causes: kubelet or the container runtime crashed/stopped, the
node's disk filled up (triggering DiskPressure and image/container
garbage collection, or blocking new pod starts entirely), or a
network issue prevents the node reaching the API server (unrelated
to the CNI's pod-to-pod data path — see
cni-networking-calico-flannel
for that separate failure class).
Before draining for planned maintenance, check what's actually running there and which PDBs apply:
kubectl get pods -A -o wide --field-selector spec.nodeName=<node>
kubectl get pdb -A
For any workload on the node with a PodDisruptionBudget, compare
its minAvailable/maxUnavailable against its current replica
count and health — a PDB that leaves zero disruption budget with the
node's pods included means an eviction-respecting drain will
correctly refuse to proceed until that changes.
Cordon the node to stop new pods from being scheduled onto it (existing pods are untouched by cordon alone):
kubectl cordon <node>
Drain the node, letting kubectl drain respect
PodDisruptionBudgets by default:
kubectl drain <node> \
--ignore-daemonsets \
--delete-emptydir-data \
--timeout=300s
kubectl drain cordons the node automatically as part of this
command if not already cordoned — running cordon first (step 4) is
still good practice for visibility, but not strictly required before
drain.
If the drain hangs or times out, diagnose before forcing anything:
kubectl get pdb -A -o wide
kubectl describe pdb <pdb-name> -n <namespace>
A drain blocked by a PDB is the mechanism working as intended — it
is protecting the workload's own stated availability requirement.
The correct response is to address that constraint (temporarily
scale up replicas so eviction no longer violates minAvailable,
coordinate a maintenance window with the owning team, or wait for
capacity elsewhere), not to bypass the protection.
Perform the actual maintenance (OS patch, reboot, hardware swap, kubelet/runtime upgrade) once the node has no non-DaemonSet pods remaining.
Uncordon the node to make it schedulable again:
kubectl uncordon <node>
This only marks the node schedulable for future pods — it does not move any already-rescheduled workloads back. That's expected behavior: the scheduler will naturally place new/rescheduled pods on the node going forward based on normal scheduling, not as an automatic rebalancing action triggered by uncordon itself.
Verify the node and its workloads are healthy before considering the maintenance complete:
kubectl get nodes
kubectl get pods -A -o wide --field-selector spec.nodeName=<node>
Confirm the node reports Ready, and that any workload scaled up
temporarily to satisfy a PDB during the drain (step 6) is scaled back
down once maintenance across the fleet is complete.
For multi-node maintenance, proceed one node at a time, verifying cluster and workload health between each — draining several nodes simultaneously multiplies the chance of exhausting a PDB's disruption budget across more of a workload's replicas at once than intended.
PodDisruptionBudget for every workload that has an actual
availability requirement before a maintenance window needs one, not
reactively when a drain unexpectedly hangs — a workload with no PDB
at all can be evicted down to zero replicas by a drain with no warning
whatsoever, which is a worse outcome than a drain that pauses to ask.--force only for pods that are genuinely unmanaged (no
controller) or stuck because their node is already gone/unreachable —
not as a default response to a slow or blocked drain.kubectl drain a --grace-period (or trust the pod's own
configured terminationGracePeriodSeconds) long enough for the
workload to actually shut down cleanly — a long-running request or
connection-draining load balancer needs more than the default grace
period to avoid cutting off in-flight work.Conditions (MemoryPressure, DiskPressure,
Ready) proactively via node-exporter/kube-state-metrics alerting,
not only when someone happens to notice a node in a bad state during
kubectl get nodes.NotReady repeatedly (not just once) as a
signal to investigate the underlying hardware/OS/network rather than
uncordoning and moving on each time it recovers — a flapping node is a
reliability risk even between episodes.Symptom: kubectl drain hangs indefinitely or times out.
Fix: Check kubectl get pdb -A for a PodDisruptionBudget
covering pods on that node whose minAvailable/maxUnavailable
the eviction would violate. This is the drain correctly refusing to
cause an outage — address the underlying capacity constraint
(temporarily scale up, coordinate with the owning team, or wait)
rather than reaching for --force --grace-period=0 as the first
response, which bypasses the protection instead of resolving what it
was protecting against.
Symptom: A node is drained for routine maintenance and a service
with only one or two replicas — and no PodDisruptionBudget at all —
goes fully unavailable during the drain.
Fix: With no PDB, eviction-respecting drain has nothing to check
against and will happily evict every replica if they're all scheduled
on (or migrate through) the node being drained. Define a PDB for every
workload with a real availability requirement ahead of any
maintenance window, and check kubectl get pods -o wide --field-selector spec.nodeName=<node> plus kubectl get pdb -A
together before draining, not just PDB existence in isolation.
Symptom: Pods stuck Terminating are cleared with
kubectl delete pod --force --grace-period=0 to unblock a drain.
Fix:
Warning: this skips graceful shutdown entirely — no pre-stop hook runs, no clean connection drain, no confirmation the process actually stopped on the node. For a stateful workload this can leave on-disk state inconsistent or a volume attached to a pod that no longer logically exists (check
kubectl get volumeattachmentsafterward). It "masks" a stuck termination instead of diagnosing why the pod won't terminate cleanly (frequently a hung process or a container runtime issue on the node itself) — reserve this for pods whose node is confirmed gone/unreachable, not as a default unblock tactic.
Symptom: A node goes NotReady after a transient network blip,
and workloads on it are evicted and rescheduled elsewhere even though
the node recovers shortly after.
Fix: The default pod-eviction-timeout (5 minutes) passed before
the node reported healthy again, so the control plane started
evicting its pods as if the node were permanently gone. For workloads
that shouldn't churn on a brief blip, add an explicit, bounded
toleration for node.kubernetes.io/not-ready/node.kubernetes.io/ unreachable — but don't disable eviction entirely, since that risks
two copies of a stateful workload's pod running simultaneously if the
node is truly gone (a split-brain risk, not just an inconvenience).
Symptom: kubectl uncordon is run, but expected workloads don't
come back to the node.
Fix: This is expected — uncordon only makes the node eligible
for future scheduling decisions, it does not proactively move
already-rescheduled pods back. If rebalancing onto the node is
actually desired, that requires a separate action (e.g. scaling the
workload, or deleting a pod elsewhere to let the scheduler place a
new one), not an assumption that uncordon itself triggers it.
Symptom: kubectl delete node <node> is run directly to remove a
problem node, without draining it first.
Fix: This immediately removes the node object from the API
without evicting or rescheduling its pods first —
Warning: this is a destructive shortcut that can leave workloads orphaned or delayed in rescheduling compared to a normal cordon-then-drain-then-remove sequence; drain the node first whenever it's still reachable, and reserve direct deletion for nodes truly gone from the infrastructure layer already.
Scenario: node-3 needs a kernel patch requiring a reboot.
payments-api runs on it with a PodDisruptionBudget of
minAvailable: 2 but only 2 total replicas cluster-wide.
kubectl get pods -n payments -o wide --field-selector spec.nodeName=node-3
# payments-api-7d9f6-abc12 1/1 Running node-3
kubectl get pdb -n payments
# NAME MIN AVAILABLE MAX UNAVAILABLE ALLOWED DISRUPTIONS
# payments-api-pdb 2 N/A 0
ALLOWED DISRUPTIONS: 0 means draining node-3 right now would
violate the PDB — evicting this pod would drop payments-api below its
required 2 available replicas.
kubectl scale deployment payments-api -n payments --replicas=3
kubectl get pdb payments-api-pdb -n payments
# ALLOWED DISRUPTIONS: 1
kubectl cordon node-3
kubectl drain node-3 --ignore-daemonsets --delete-emptydir-data --timeout=300s
# node/node-3 drained
The drain now succeeds because the temporary third replica gives the PDB one disruption to allow. After the kernel patch and reboot:
kubectl uncordon node-3
kubectl get nodes
# node-3 Ready
kubectl scale deployment payments-api -n payments --replicas=2
The service stayed at or above its required 2 available replicas throughout the entire maintenance window, and the temporary scale-up was reverted once the node was back in service — no outage, no bypassed PDB.
kubeadm upgrade.NotReady that isn't kubelet/runtime/disk related.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub selvarajmurugesan90/ops-engineering-skills --plugin kubernetes-platform-skills35 skills in this plugin
/cert-manager-tls-automationGuides installing and configuring cert-manager for automated TLS certificate issuance and renewal — Issuers vs. ClusterIssuers, ACME/ Let's Encrypt HTTP-01 and DNS-01 challenges, private-CA issuance, and integration with Ingress-nginx and Istio gateways. Use when a user asks to "automate TLS certificates on Kubernetes," "set up cert-manager with Let's Encrypt," "fix a stuck Certificate that won't become Ready," "use DNS-01 for a wildcard cert," "rotate mTLS certs automatically," or "issue certs from an internal CA."
/cni-networking-calico-flannelGuides choosing and installing a Kubernetes CNI plugin — Calico vs. Flannel — including NetworkPolicy enforcement capability differences, BGP vs. VXLAN/overlay data paths, and IP address management (IPAM) tradeoffs. Use when a user asks to "choose a CNI plugin for Kubernetes," "enable NetworkPolicy enforcement," "set up Calico with BGP peering," "install Flannel," "debug pod-to-pod connectivity across nodes," or "migrate from Flannel to Calico."
/complete-kubernetes-deployment-on-aks-from-scratchSequences a complete, end-to-end AKS deployment from a bare Azure subscription to a production-ready cluster serving a first workload — Azure landing zone prerequisites, AKS cluster and node pool provisioning, Azure CNI (with the Calico/Cilium alternative noted), ingress (Application Gateway Ingress Controller vs. ingress-nginx), cert-manager with Azure DNS, conformance validation, a Helm-deployed workload, and a node/cluster health baseline. This is an integration/orchestration skill that sequences several existing tool-specific skills in the correct order and flags the handoff points between them — it does not restate their internals. Use when a user asks to "deploy a Kubernetes cluster on AKS from scratch," "set up a new AKS environment end to end," "build a production AKS cluster from a fresh Azure subscription," or "give me the full sequence to go from nothing to a working AKS cluster."
/complete-kubernetes-deployment-on-eks-from-scratchSequences a complete, end-to-end EKS deployment from a bare AWS account to a production-ready cluster serving a first workload — landing zone/IAM prerequisites, EKS cluster and node group provisioning, VPC CNI (with the Calico/Cilium alternative noted), ingress (ALB vs. ingress-nginx), cert- manager with Route 53 DNS-01, conformance validation, a Helm-deployed workload, and a node/cluster health baseline. This is an integration/ orchestration skill that sequences several existing tool-specific skills in the correct order and flags the handoff points between them — it does not restate their internals. Use when a user asks to "deploy a Kubernetes cluster on EKS from scratch," "stand up a new EKS environment end to end," "build a production EKS cluster from a fresh AWS account," or "give me the full sequence to go from nothing to a working EKS cluster."
/complete-kubernetes-deployment-on-gke-from-scratchSequences a complete, end-to-end GKE deployment from a bare GCP project to a production-ready cluster serving a first workload — GCP landing zone prerequisites, GKE cluster and node pool provisioning, VPC-native/ Dataplane V2 CNI (with the Calico alternative noted), ingress (GKE Ingress/Gateway API vs. ingress-nginx), cert-manager with Cloud DNS, conformance validation, a Helm-deployed workload, and a node/cluster health baseline. This is an integration/orchestration skill that sequences several existing tool-specific skills in the correct order and flags the handoff points between them — it does not restate their internals. Use when a user asks to "deploy a Kubernetes cluster on GKE from scratch," "set up a new GKE environment end to end," "build a production GKE cluster from a fresh GCP project," or "give me the full sequence to go from nothing to a working GKE cluster."
/complete-kubernetes-deployment-on-oke-oci-from-scratchSequences a complete, end-to-end OKE (Oracle Container Engine for Kubernetes) deployment from a bare OCI tenancy to a production-ready cluster serving a first workload — OCI landing zone prerequisites (Compartments, Dynamic Groups), OKE Enhanced cluster and node pool provisioning, VCN-Native pod networking (with the Calico NetworkPolicy add-on noted), ingress (Native Ingress Controller vs. ingress-nginx), cert-manager with OCI DNS via a community webhook solver, conformance validation, a Helm-deployed workload, and a node/cluster health baseline. This is an integration/orchestration skill sequencing several existing tool-specific skills in the correct order and flagging the handoff points between them — it does not restate their internals. Use when a user asks to "deploy a Kubernetes cluster on OKE from scratch," "set up OKE on OCI end to end," "build a production OKE cluster from a fresh OCI tenancy," or "give me the full sequence to go from nothing to a working OKE cluster."
Other plugins' skills for the same job