Created
April 30, 2021 13:51
-
-
Save pizycki/b01489c98ff853e45bee4263003db95e to your computer and use it in GitHub Desktop.
Restart all unhealthy k8s deployments
This file contains hidden or 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
kubectl get deployments -n app-team -o json ` | |
| ConvertFrom-Json ` | |
| % { $_.items } ` | |
| ? { ($_.status.conditions | ? { $_.type -eq "Available" }).Status -eq "False" } | |
| % { $_.metadata.name } | |
| % { kubectl rollout restart deployments/$_ -n app-team } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment