kubernetesrollout

kubectl rollout status for ALL deployments in a namespace


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.


Solution

  • 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