Tell when Job is Complete

前端 未结 4 973
花落未央
花落未央 2020-11-27 16:51

I\'m looking for a way to tell (from within a script) when a Kubernetes Job has completed. I want to then get the logs out of the containers and perform cleanup.

Wh

4条回答
  •  悲哀的现实
    2020-11-27 17:38

    Since version 1.11, you can do:

    kubectl wait --for=condition=complete job/myjob
    

    and you can also set a timeout:

    kubectl wait --for=condition=complete --timeout=30s job/myjob
    

提交回复
热议问题