k8s-wait-for icon indicating copy to clipboard operation
k8s-wait-for copied to clipboard

kubectl wait command

Open gimler opened this issue 3 years ago • 5 comments

What is the difference between the wait_for.sh shell script and the kubectl wait command https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#wait

gimler avatar May 19 '21 20:05 gimler

To be honest, I just heard of it from you, but after quickly playing with it, for example, it does not allow to wait for a job to complete. On the other hand, it allows waiting for the resource to be deleted. I would say it's a bit lower level than wait_for.sh, where there is a bit more logic coded to provide useful scenarios.

wait_for.sh could use it internally. It does not, because it was created before kubectl wait existed :-)

groundnuty avatar May 19 '21 22:05 groundnuty

thanks for clarification. I would be nice if the readme has a small notice about it.

gimler avatar May 20 '21 07:05 gimler

@groundnuty job wait for complete example https://hackernoon.com/kubectl-tip-of-the-day-wait-like-a-boss-40a818c423ac

gimler avatar May 26 '21 05:05 gimler

kubectl wait --for=condition=complete --timeout=30s job/myjob should work as an alternative, though I've yet to try.

It seems experimental though.

TarekAS avatar Nov 27 '22 20:11 TarekAS

@TarekAS please feel welcome to come back with comments if you happen to test it k8s-wait script compensates for the shortcomings of kubectl, It would be great to replace parts of it with native kubectl commands!

groundnuty avatar Nov 28 '22 14:11 groundnuty