Skip to content

zarf tools wait-for resource

Waits for a given Kubernetes resource to be fully reconciled

Waits for a given Kubernetes resource to be fully reconciled unless a condition is provided. Resource reconciliation is determined according to https://github.com/kubernetes-sigs/cli-utils/blob/master/pkg/kstatus/README.md#kstatus If a resource does not implement reconciliation statuses, then this command will wait for that resource to exist

zarf tools wait-for resource KIND [NAME | SELECTOR] [CONDITION] [flags]
$ zarf tools wait-for resource deployment my-deployment -n default # wait for deployment to be reconciled (default condition)
$ zarf tools wait-for resource po cool-pod-name -n cool # wait for pod (using po alias) cool-pod-name in namespace cool to be reconciled
$ zarf tools wait-for resource pod my-pod-name ready -n default # wait for pod my-pod-name in namespace default to have the ready condition
$ zarf tools wait-for resource pod app=podinfo -n podinfo # wait for pod(s) with label app=podinfo in namespace podinfo to be reconciled
$ zarf tools wait-for resource deployment zarf-docker-registry exists -n zarf # wait for deployment zarf-docker-registry in namespace zarf to exist
$ zarf tools wait-for resource svc zarf-docker-registry delete -n zarf # wait for service zarf-docker-registry in namespace zarf to not exist
$ zarf tools wait-for resource pvc -n zarf # wait for any pvc in namespace zarf to exist
$ zarf tools wait-for resource crd addons.k3s.cattle.io # wait for crd addons.k3s.cattle.io to exist
$ zarf tools wait-for resource sts test-sts '{.status.availableReplicas}'=23 # wait for statefulset test-sts to have 23 available replicas
-h, --help help for resource
-n, --namespace string Specify the namespace of the resources to wait for.
--timeout string Specify the timeout duration for the wait command. (default "5m")
-a, --architecture string Architecture for OCI images and Zarf packages
--features stringToString [ALPHA] Provide a comma-separated list of feature names to bools to enable or disable. Ex. --features "foo=true,bar=false,baz=true" (default [])
--insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture.
--log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console")
-l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info")
--no-color Disable terminal color codes in logging and stdout prints.
--plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture.
--tmpdir string Specify the temporary directory to use for intermediate files
--zarf-cache string Specify the location of the Zarf cache directory (default "~/.zarf-cache")