https://pulumi.com logo
#kubernetes
Title
# kubernetes
n

nutritious-petabyte-61303

11/15/2021, 3:49 PM
does pulumi wait for k8s jobs to finish instead of just launching them?
b

brave-ambulance-98491

11/15/2021, 6:39 PM
I believe it's wait for it to complete. We have Deployment updates block on database migration Jobs in our Pulumi program, and it works great.
g

gorgeous-egg-16927

11/15/2021, 7:00 PM
Yes, the default behavior is to wait for readiness. You can see details of any readiness checks for a resource in the API docs: https://www.pulumi.com/registry/packages/kubernetes/api-docs/batch/v1/job/#job You can disable the wait behavior by setting the
<http://pulumi.com/skipAwait|pulumi.com/skipAwait>
annotation on the resource.
n

nice-pharmacist-5320

01/16/2022, 10:42 AM
I have a question, how do you block the deployment? Do I have to keep the job at the start of
index
file and then keep everything else in an
if
condition like this
Copy code
if (dbMigrationJob.status.conditions[0].type.apply(t => t === 'Complete')) {
    // run everything else like creating new image, pushing to ecr, creating deployment,etc
}
g

gorgeous-egg-16927

01/18/2022, 5:07 PM
how do you block the deployment?
If I understand your question correctly, you need to specify the Job as a resource dependency. https://www.pulumi.com/docs/intro/concepts/resources/options/dependson/ has more information on this.
4 Views