Skip to content

Instantly share code, notes, and snippets.

@alexolinux
Created May 14, 2024 08:51
Show Gist options
  • Save alexolinux/2f90ea22717fd7d33c6d1355f7625b70 to your computer and use it in GitHub Desktop.
Save alexolinux/2f90ea22717fd7d33c6d1355f7625b70 to your computer and use it in GitHub Desktop.
K8s - Remove kubernetes node from cluster
#!/bin/bash
NODE="kube-node-02"
kubectl cordon $NODE
kubectl drain $NODE --ignore-daemonsets --delete-emptydir-data
kubectl delete node $NODE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment