Skip to content

kx wait

Blocks until each indexed resource reaches its condition, then prints it. With no --for, the condition comes from the kind: a Pod or Node is Ready, a PersistentVolumeClaim Bound, a Job Complete — and a Job that fails ends the wait at once, with its reason, rather than running to the timeout — and a LoadBalancer Service has an address.

A Deployment, StatefulSet or DaemonSet is waited for with kx rollout status, which knows when a rollout has finished; any other kind needs --for.

--for replaces the default and goes to kubectl wait as written: --for=condition=Ready, --for=delete, --for=jsonpath=… . --timeout is 30s unless given, as it is for kubectl.

Several indexes are all resolved and checked before anything waits, then waited for in order; the first that fails or times out ends the command. --timeout covers them together, as it does for kubectl: each waits for what the ones before it left, not a timeout of its own.

A flag kx doesn’t know is refused; put it after -- to pass it through to kubectl.

Usage

kx wait [OPTIONS] <index>... [kubectl flags]

Arguments

ArgumentDescription
<index>...Row number from the current listing, or @name for a mark; kx state or kx mark shows them

Options

OptionDescription
--for stringsCondition to wait for instead of the kind’s default, as kubectl wait takes it; repeatable
-o, --output stringOutput format, as kubectl takes it; kubectl’s output is printed, and kx’s own lines go to stderr
--timeout durationHow long to wait for every index together (default 30s); 0 checks once

Passthrough options

OptionDescription
--allSelect all resources in the namespace of the specified resource types
-A, --all-namespacesIf present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.
--allow-missing-template-keysIf true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.
--field-selector stringSelector (field query) to filter on, supports ‘=’, ‘==’, and ‘!=’.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type.
-f, --filename stringsidentifying the resource.
--localIf true, annotation will NOT contact api-server but run locally.
-R, --recursiveProcess the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.
-l, --selector stringSelector (label query) to filter on, supports ‘=’, ‘==’, and ‘!=’.(e.g. -l key1=value1,key2=value2)
--show-managed-fieldsIf true, keep the managedFields when printing objects in JSON or YAML format.
--template stringTemplate string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].
…kubectl’s global flags too: --context, --kubeconfig, --as and the rest; kubectl options lists them

Global options

OptionDescription
--no-colorDisable styled output
-h, --helpShow this message and exit

Examples

kx wait 2
kx wait 1..4 --timeout=2m
kx wait @db-claim
kx wait 3 --for=delete
kx wait 5 --for=condition=Ready=false