0

I am currently struggling with pods which were spawned from a cronjob. I have a cronjob which spawns a pod every minute and runs a kotlin application. I am using exitProcess(1) inside the application to return the exit code 1 to the pod upon application failure. The pod also shows me the exit code but terminates with the reason "Error". For the cronjob to properly work and cleanup those pods, I'd have to have the pods exit with reason "Failed".

Is there a way to change the termination reason for a pod from inside the application or via cronjob definition? I am using a distroless image inside the pod, so I can't run bash or sh if that's something that would help.

Here's the relevant part of the pod description: Termination reason: Error instead of Failed

Nigel-Lee
  • 145
  • 1
  • 13

0 Answers0