Search code examples
kubernetesnamespaceskubernetes-podbitbucket-pipelines

wait for the pod to be ready


I'm trying to add a step in the pipeline where a check is made if the PODS are ready before the pipeline moves forward. I've read on forums that the kubectl wait command can work, however, every time the pipeline is executed, the PODS are created again, so I can't put a default name on the kubectl wait command. Does anyone have any tips, please?


Solution

  • If your pods are part of a deployment:

    kubectl wait deployment <deployment-name> -n <deployment-namespace> --for condition=Available=True --timeout=120s