I’m a little unclear as to how Pulumi Kubernetes J...
# kubernetes
m
I’m a little unclear as to how Pulumi Kubernetes Job works - does it register success after the Job is complete or after the Job is created? The docs mention “ready” status, but I’m not sure if “ready” means Job complete or Job created (i.e. started)?
b
In my experience when creating a job, it waits until the job is successful
m
Oh ok thanks. What’s the best practice for a long run job then? I have jobs that can run for days - that means the server that’s running Pulumi job (I’m using Automation API to run the job in Node endpoint) can’t be updated at all as it’ll interrupt the process?
Also - this is Pulumi specific - it looks like Jobs still hang around in Pulumi state after completion. I assume I need to remove them myself?
b
I'm not quite sure what you mean by Job here, so not sure on that one.
And typically you'd want graceful shutdown on things like upgrades so that you're not stopping something mid way.
m
OK thanks a lot! Do you have any particular resource I can look more into for graceful shutdown of Kubernetes processes for deployments? i.e. I change my code in my Express app and don’t want the node process to end in my production pod.
b
You can configure in Kubernetes a pre-stop hook, which can do something like send a signal to your node process, and then in the nodeprocess you can use that to handle any current requests (within some timeout)