CmdID

CmdID / Commands

kubectl-wait

Wait for resource(s) to reach a certain state. tldr-pages

On several platforms

Opens CmdID with your command. It is read in your browser and sent nowhere.

Several platforms

from tldr-pages, CC BY 4.0

Wait for a deployment to become available

kubectl wait --for condition=available deployment/deployment_nameIdentify
--forThe condition to wait on: [create|delete|condition=condition-name[=condition-value]|jsonpath='{JSONPath expression}'=[JSONPath value]]. kubectl reference

Wait for all pods with a certain label to be ready

kubectl wait --for condition=ready [po --selector label_key=label_valueIdentify
--forThe condition to wait on: [create|delete|condition=condition-name[=condition-value]|jsonpath='{JSONPath expression}'=[JSONPath value]]. kubectl reference
--selectorSelector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2) kubectl reference

Wait for a pod to be deleted

kubectl wait --for delete [po pod_nameIdentify
--forThe condition to wait on: [create|delete|condition=condition-name[=condition-value]|jsonpath='{JSONPath expression}'=[JSONPath value]]. kubectl reference

Wait for a job to complete, within 120 seconds (if the condition isn't met on time, the exit status will be unsuccessful)

kubectl wait --for condition=complete job/job_name --timeout 120sIdentify
--forThe condition to wait on: [create|delete|condition=condition-name[=condition-value]|jsonpath='{JSONPath expression}'=[JSONPath value]]. kubectl reference
--timeoutThe length of time to wait before giving up. kubectl reference