apiVersion: batch/v1
kind: Job
metadata:
name: my-cronjob
spec:
template:
spec:
containers:
- name: main-container
image: chentex/random-logger:latest
command: ["./entrypoint.sh"]
args:
- "100"
- "400"
- "60"
- name: side-container
image: ubuntu:latest
command:
- sleep
args:
- 300s
restartPolicy: Never
For this example job the main container exists after 60 seconds means it goes to completed state its task is done.
but consider the side car is never ending process.
I am looking for a soluction to terminate the job after main container exists.