Skip to content

Instantly share code, notes, and snippets.

@rubberduck203
Last active March 28, 2023 13:28
Show Gist options
  • Save rubberduck203/2869a0a38cbd0ed506db9bec880fb84d to your computer and use it in GitHub Desktop.
Save rubberduck203/2869a0a38cbd0ed506db9bec880fb84d to your computer and use it in GitHub Desktop.
Cordon all Kubernetes Nodes

Some bits and pieces of useful commands for working with k8s

kubectl get nodes | awk '{if (NR!=1) {print $1}}' | xargs -I {} kubectl cordon {}
kubectl -n $NAMESPACE get svc $SVC | awk 'NR > 1 {print $5}' | cut -f 2 -d ":" | cut -f 1 -d "/" | \
xargs -I {} echo http://$(minikube ip):{} | chrome
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment