Kubectl wait command cannot be found

3/1/2019

I am trying to use the kubectl wait command as outlined in the kubernetes docs: https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#wait

When I run it, I am getting

Error: unknown command "wait" for "kubectl"

Docs do mention that the command is "experimental". Is there something I need to do to indicate I want to use experimental commands? All the other kubectl commands work fine.

I am using the kubectl command in windows, installed as a gcloud component. I have updated all components. kubectl version returns:

Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.11", GitCommit:"637c7e288581ee40ab4ca210618a89a555b6e7e9", GitTreeState:"clean", BuildDate:"2018-11-26T14:38:32Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"windows/amd64"}
Server Version: version.Info{Major:"1", Minor:"11+", GitVersion:"v1.11.7-gke.4", GitCommit:"618716cbb236fb7ca9cabd822b5947e298ad09f7", GitTreeState:"clean", BuildDate:"2019-02-05T19:22:29Z", GoVersion:"go1.10.7b4", Compiler:"gc", Platform:"linux/amd64"}
-- Kyle
google-cloud-platform
google-kubernetes-engine
kubectl
kubernetes

1 Answer

3/2/2019

I'm not sure in which version kubectl wait was introduced, but I have:

Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.3", GitCommit:"721bfa751924da8d1680787490c54b9179b1fed0", GitTreeState:"clean", BuildDate:"2019-02-01T20:08:12Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}

and it works for me:

~ kubectl wait --help
Experimental: Wait for a specific condition on one or many resources. 

Update to the latest version and you will have it

Edit: the command was introduced in version 1.11. Here is the relevant PR.

-- Amityo
Source: StackOverflow