kubectl-wait
blocks until conditions are met
TLDR
Wait for pod ready
SYNOPSIS
kubectl wait [options] resource
DESCRIPTION
kubectl wait blocks execution until one or more Kubernetes resources reach a specified condition, making it an essential synchronization primitive for shell scripts, CI/CD pipelines, and automation workflows. Rather than polling with repeated `kubectl get` calls, it efficiently watches the resource and returns as soon as the condition is satisfied or the timeout expires.
The command supports built-in condition checks such as `condition=Ready` and `condition=Available`, resource deletion events via `--for=delete`, and arbitrary field matching through JSONPath expressions like `jsonpath='{.status.phase}'=Running`. It can target individual resources by name or groups of resources matched by label selectors, and always defaults to a 30-second timeout unless overridden with --timeout.
PARAMETERS
RESOURCE
Resource to wait for.--for CONDITION
Condition to wait for.--timeout DURATION
Wait timeout.-l SELECTOR
Label selector.-n NAMESPACE
Target namespace.--help
Display help information.
CAVEATS
Subcommand of kubectl. Blocks execution. Set reasonable timeouts.
HISTORY
kubectl wait provides synchronization for Kubernetes automation and scripting.
SEE ALSO
kubectl(1), kubectl-get(1)
