drain-node

Cordon a Kubernetes node and evict pods while respecting disruption budgets.

3|Updated Dec 2, 2025
One-click install
npx skills add https://github.com/X-McKay/kubani --skill drain-node
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: drain-node
Source: https://github.com/X-McKay/kubani/tree/main/kubani/skills/k8s/remediation/drain-node
Command: npx skills add https://github.com/X-McKay/kubani --skill drain-node

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill safely removes all running pods from a Kubernetes node, preparing it for maintenance or decommissioning without disrupting critical services.

Core Features & Use Cases

  • Node Cordoning: Prevents new pods from being scheduled onto the node.
  • Pod Eviction: Gracefully evicts existing pods, allowing them to be rescheduled on other nodes.
  • DaemonSet Awareness: Ignores DaemonSet pods that are designed to run on every node.
  • Use Case: Before performing hardware upgrades or patching on a Kubernetes worker node, use this skill to ensure all application pods are safely moved off before the node goes offline.

Quick Start

Use the drain-node skill to safely evict pods from the node named 'worker-node-3'.

Frequently Asked Questions about drain-node

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely drain a Kubernetes node for maintenance without disrupting critical services?

Safely draining a Kubernetes node involves cordoning the node to prevent new scheduling and gracefully evicting existing pods, allowing them to reschedule elsewhere while respecting pod disruption budgets and ignoring DaemonSet pods.

What does cordoning a Kubernetes node do before pod eviction?

Cordoning a node marks it as unschedulable, preventing the Kubernetes scheduler from placing any new pods onto the target node while existing pods are being gracefully evicted.

Do I need an MCP server to evict pods from a k8s node?

Yes, an MCP server integration is required for Kubernetes API interactions to safely cordon the target node and evict pods through the automated remediation process.

Does draining a node remove DaemonSet pods during the eviction process?

No, the pod eviction process ignores DaemonSet pods. DaemonSets are designed to run on every node, so they are intentionally left untouched during the node draining process.

Why does pod eviction respect pod disruption budgets when draining a node?

Pod eviction respects pod disruption budgets to guarantee a minimum number of available pod replicas remain running during the node drain, preventing critical application outages during maintenance.