We are scheduling Atlassian Bamboo jobs to ECS currently and looking into doing the same on kubernetes. We have the Bamboo agent container with 1-n side service containers based on what the job needs (database, docker daemon, selenium,...). In ECS we marked the main agent container as 'essential' and when the agent finished the work and exited, the entire ECS task collapsed, exiting all the other side containers.
How would we do the same thing in Kubernetes? It seems like the only option we have is to regularly poke the cluster and check pods with bamboo-agent container terminated and terminate the pods from outside. Is there a way to make the pod auto-collapse/terminate when one of the containers dies?