Last active
May 16, 2024 08:22
-
-
Save keyan1603/5cad0b8bf5d6ed8f942cab233cde9598 to your computer and use it in GitHub Desktop.
Kubectl commands to gracefully rollout nodes in EKS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Cordon all nodes: | |
kubectl get nodes | ForEach-Object{($_.Split(""))[0]} | where {$_ -ne " NAME"} | ForEach-Object{(kubectl cordon $_)} | |
Rollout Master node: | |
kubectl get deployments -n kube-system| ForEach-Object{($_.Split(""))[0]} | where {$_ -ne " NAME"} | ForEach-Object{(kubectl -n kube-system rollout restart deployment $_)} | |
kubectl get daemonsets -n kube-system| ForEach-Object{($_.Split(""))[0]} | where {$_ -ne " NAME"} | ForEach-Object{(kubectl -n kube-system rollout restart daemonset $_)} | |
Rollout Worker nodes: | |
kubectl get deployments | ForEach-Object{($_.Split(""))[0]} | where {$_ -ne " NAME"} | ForEach-Object{(kubectl rollout restart deployment $_)} | |
kubectl get daemonsets | ForEach-Object{($_.Split(""))[0]} | where {$_ -ne " NAME"} | ForEach-Object{(kubectl rollout restart daemonset $_)} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment