kubectl wait

The kubectl command that blocks until a named condition on an object becomes true, or until a timeout expires.

In more detail

It turns the question is it ready yet into one command with a clear pass or fail, which makes scripts and smoke tests reliable. Common conditions are ready for pods and available for Deployments. A timeout is a failure you should investigate, not a reason to wait longer.

Example

kubectl wait --for=condition=ready pod/web --timeout=2m

Related terms

Taught in

References

Certification courses