I'm running a K8S job, with the following flags:
apiVersion: batch/v1
kind: Job
metadata:
name: my-EP
spec:
template:
metadata:
labels:
app: EP
spec:
restartPolicy: "Never"
containers:
- name: EP
image: myImage
The Job starts, runs my script that runs some application that sends me an email and then terminates. The application returns the exit code to the bash script. when I run the command: kubectl get pods, I get the following:
NAME READY STATUS RESTARTS AGE
my-EP-94rh8 0/1 Completed 0 2m2s
Sometimes there are issues, and the network not connected or no license available. I would like that to be visible to the pod user. My question is, can I propagate the script exit code to be seen when I run the above get pods command? I.E instead of the "Completed" status, I would like to see my application exit code - 0, 1, 2, 3.... or maybe there is a way to see it in the Pods Statuses, in the describe command? currently I see:
Pods Statuses: 0 Running / 1 Succeeded / 0 Failed
Is this possible?