Skip to content

Instantly share code, notes, and snippets.

View YLcoding's full-sized avatar
💻
Coding

Ye Lin YLcoding

💻
Coding
View GitHub Profile
@juliohm1978
juliohm1978 / k8s-drain.sh
Last active March 13, 2024 14:12
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.