I have a number of deployment objects in my namespace. I'd like to run kubectl rollout status
for all of them at the same time. So, I'd like the command to exit, only when all rollouts are complete, or an error has occurred. How can I achieve that?
The only thing I got with so far is:
kubectl get deploy -o name | xargs -n1 -t kubectl rollout status
But I hope there's something smarter.
You can use this simple check:
#!/bin/bash
deploy=$(kubectl get deploy -o name)
for i in $deploy; do kubectl rollout status $i -w --timeout=30s; done
You can also build more advanced script using clues in this post.
So I guess what I came up is the best there is.
kubectl get deploy --output name | \
timeout -t 300 \
xargs -n1 -t \
kubectl rollout status