Skip to content

Instantly share code, notes, and snippets.

@neu7ron2
neu7ron2 / k8s-drain.sh
Created September 20, 2024 07:50 — forked from juliohm1978/k8s-drain.sh
Drains a Kubernetes node using "rollout restart" instead "kubectl drain". See comments for motiviation and usage.
#!/bin/bash
NODE_NAME=$1
ROLLOUT_CMD=$2
if [[ "$NODE_NAME" == "" ]]; then
echo "
USAGE: ./drain.sh <NODE_NAME>
Drains a node from its Deployments/Stateful set pods.