OC(1)
β¨ NAME β¨
hey bestie, welcome to the OC(1) page β this is oc wait, and it's literally the "wait for a specific condition on one or many resources" command. no cap, that's the whole vibe. π
π SYNOPSIS π
oc wait [OPTIONS]
π DESCRIPTION π
okay so picture this: you've got a bunch of resources and you're just waiting for something specific to happen. that's the whole gig. oc wait takes multiple resources and waits until the specified condition is seen in the Status field of every single one. every. single. one. periodt. π
alternatively β and this is lowkey iconic β the command can wait for the given set of resources to be created or deleted by providing the "create" or "delete" keyword as the value to the --for flag. slay.
when the condition is met, a successful message will be printed to stdout indicating exactly when the specified condition was met. and if you want to change where that goes, you can use the -o option to change the output destination. main character energy tbqh. β¨
π¦ OPTIONS π¦
okay bestie, here's the full menu β every flag, every default, nothing skipped, iykyk.
--all=falseβ select all resources in the namespace of the specified resource types. all of 'em. π-A,--all-namespaces=falseβ if present, list the requested object(s) across all namespaces. the namespace in current context is ignored even if you specified it with--namespace. it's giving "no faves" energy. π--allow-missing-template-keys=trueβ iftrue, ignore any errors in templates when a field or map key is missing in the template. only applies togolangandjsonpathoutput formats. (so don't come for me when it ignores missing keys, that's literally the point.) π«Ά--field-selector=""β selector (field query) to filter on, supports'=','==', and'!='(e.g.--field-selector key1=value1,key2=value2). heads up tho: the server only supports a limited number of field queries per type. π-f,--filename=[]β identifying the resource. that's the whole description bestie, take it or leave it. π--for=""β the condition to wait on:[create|delete|condition=condition-name[=condition-value]|jsonpath='{JSONPath expression}'=[JSONPath value]]. the default condition-value istrue. condition values are compared after Unicode simple case folding, which is a more general form of case-insensitivity. lowkey fancy fr fr. π₯--local=falseβ iftrue, annotation will NOT contactapi-serverbut run locally. it's giving introvert. π-o,--output=""β output format. one of:(json, yaml, kyaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file). pick your fighter. β¨-R,--recursive=trueβ process the directory used in-f,--filenamerecursively. useful when you want to manage related manifests organized within the same directory. it's giving "organized queen". π-l,--selector=""β selector (label query) to filter on, supports'=','==', and'!='(e.g.-l key1=value1,key2=value2). bestie, use it to filter, it's right there. πΈ--show-managed-fields=falseβ iftrue, keep themanagedFieldswhen printing objects in JSON or YAML format. that's it. that's the flag. π--template=""β template 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β©]. go off king. π¦--timeout=0β the length of time to wait before giving up. zero means check once and don't wait, negative means wait for a week. so if you're feeling dramatic, go negative. π
π OPTIONS INHERITED FROM PARENT COMMANDS π
these are the flags you didn't ask for but got anyway β inherited from the parent command. they're still iconic, just not your faves. π
--as=""β username to impersonate for the operation. user could be a regular user or a service account in a namespace. it's giving identity crisis but make it authorized. π--as-group=[]β group to impersonate for the operation. this flag can be repeated to specify multiple groups. collect 'em all. π--as-uid=""β UID to impersonate for the operation. yes bestie, UID, not username. stay woke. β¨--as-user-extra=[]β user extras to impersonate for the operation. this flag can be repeated to specify multiple values for the same key. stacking them like a true collector. π¦--cache-dir="/homeless-shelter/.kube/cache"β default cache directory. the path is literally/homeless-shelter/.kube/cacheand yes that's a mood. π--certificate-authority=""β path to a cert file for the certificate authority. secure the bag. π₯--client-certificate=""β path to a client certificate file for TLS. mutual auth energy. π«Ά--client-key=""β path to a client key file for TLS. keep it secret, keep it safe. π--cluster=""β the name of the kubeconfig cluster to use. pick your cluster bestie. π--context=""β the name of the kubeconfig context to use. it's giving "which universe am i in". π--disable-compression=falseβ iftrue, opt-out of response compression for all requests to the server. uncompressed and unbothered. β¨--insecure-skip-tls-verify=falseβ iftrue, the server's certificate will not be checked for validity. warning: this will make your HTTPS connections insecure. so like, do it if you must, but it's not the flex you think it is. π--kubeconfig=""β path to the kubeconfig file to use for CLI requests. where's your config at. π--kuberc=""β path to the kuberc file to use for preferences. this can be disabled by exportingKUBECTL_KUBERC=falsefeature gate or turning off the featureKUBERC=off. very demure, very mindful. π--match-server-version=falseβ require server version to match client version. no version mismatches allowed, periodt. π₯-n,--namespace=""β if present, the namespace scope for this CLI request. scope it out. π¦--profile="none"β name of profile to capture. one of(none|cpu|heap|goroutine|threadcreate|block|mutex). profile like a pro. π--profile-output="profile.pprof"β name of the file to write the profile to. it defaults toprofile.pprof, which is giving "main character file name". β¨--request-timeout="0"β the length of time to wait before giving up on a single server request. non-zero values should contain a corresponding time unit (e.g.1s,2m,3h). a value of zero means don't timeout requests. zero = no timeout, live your life. π-s,--server=""β the address and port of the Kubernetes API server. where the magic happens. πΈ--tls-server-name=""β server name to use for server certificate validation. if it is not provided, the hostname used to contact the server is used. default behavior but make it fashion. π--token=""β bearer token for authentication to the API server. it's giving VIP pass. π--user=""β the name of the kubeconfig user to use. who dis. π--warnings-as-errors=falseβ treat warnings received from the server as errors and exit with a non-zero exit code. bestie, warnings go in the bin and you're leaving with a non-zero status. π«Ά
πΈ EXAMPLE πΈ
okay here are the actual examples, copied exactly, no cap. use them, love them.
# Wait for the pod "busybox1" to contain the status condition of type "Ready"
oc wait --for=condition=Ready pod/busybox1
# The default value of status condition is true; you can wait for other targets after an equal delimiter (compared after Unicode simple case folding, which is a more general form of case-insensitivity)
oc wait --for=condition=Ready=false pod/busybox1
# Wait for the pod "busybox1" to contain the status phase to be "Running"
oc wait --for=jsonpath='{.status.phase}'=Running pod/busybox1
# Wait for pod "busybox1" to be Ready
oc wait --for='jsonpath={.status.conditions[?(@.type=="Ready")].status}=True' pod/busybox1
# Wait for the service "loadbalancer" to have ingress
oc wait --for=jsonpath='{.status.loadBalancer.ingress}' service/loadbalancer
# Wait for the secret "busybox1" to be created, with a timeout of 30s
oc create secret generic busybox1
oc wait --for=create secret/busybox1 --timeout=30s
# Wait for the pod "busybox1" to be deleted, with a timeout of 60s, after having issued the "delete" command
oc delete pod/busybox1
oc wait --for=delete pod/busybox1 --timeout=60s
π SEE ALSO π
π HISTORY π
- June 2016 β ported from the Kubernetes man-doc generator. it's giving "legacy but still slaying". β¨
okay bestie, that's the whole page. now go wait on those resources like the main character you are. π β¨
opΓ©nshift β openshift CLI user manuals β OC(1) β june 2016 ππ¦π
π¦ where this page comes from
- nixpkgs unstable: openshift 4.22.0-202605222050
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms