podman: Add an option to run podman play kube in the foreground. Stop pod when process is terminated.

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind feature

Description

Requesting a command line option to run podman play kube in the foreground. All containers are started normally, and when the podman process is terminated, all pods are stopped. This is so I don’t have to remember to run podman play kube --down every time.

The goal is to have a similar behaviour as docker-compose up, which runs all services and stops them when the process is stopped, unless --detach is passed.

The use case is for local development. I would like to start my dev pods, and for them to be stopped automatically if I close the terminal. With the current behaviour, more than one time I’ve forgot to call podman play kube --down and I had my dev containers consuming resources in the background.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 17 (9 by maintainers)

Commits related to this issue

Most upvoted comments

@1player for testing, you could ./bin/podman system service -t0. That will work around the issue in #15071.

Makes sense to me. but we may need to default to --detach=true, since we would not wan to break existing scripts.