Libpod now has the ability to create and manage pods. We'd like to expose this through the Podman CLI to allow the management of pods. Our proposed command line is described below
podman runpodman run --pod newpodman run --pod new=a_specific_namepodman run --pod pod:name_or_idpodman run --pod ctr:name_or_idpodman pod subcommand with several management commands under itpodman pod list (or perhaps podman pod ps?)podman pod start name_or_idpodman pod stop name_or_idpodman kill name_or_id signalpodman pod create command?My initial feedback:
I'm also having second thoughts on the pod subcommand. I think it would be cool if podman could take the responsibility of determining if it is a pod or container away from the user. What would you think if we did something like:
podman start pod_name|pod_id|container_name|container_id
but also added a --type pod|container for name collision?
And that abstraction would be applied to the rest of the pod commands?
Name collision shouldn't be an issue, names and IDs have to be globally unique - no pod and container can share a name or ID.
On reusing start/stop/kill: I wouldn't mind it. It has the advantage of simplicity.
Yes I like that idea. The tough one is run, but that could take a pod command
podman run --pod new -ti fedora sh
Would create a new pod with a container attached.
If we use --pod new --name test
Would we create a name for the pod as test_pod?
podman run --pod UUID -ti fedora sh
podman run --pod test_pod -ti fedora sh
Would join the new container to the existing POD
I think the arguement to the pod would be used like:
Does urfave/cli support flags with optional arguments? I can see things working like this:
--pod to make a new pod with a randomly-generated name--pod NAME to make a new pod with the given name, or join the given pod if it exists--pod-from CONTAINER to join the pod from another containerThe only potential issue would be not knowing for sure whether you created or joined a pod with --pod NAME -- maybe hvae a --pod-join ID flag that will only join and error if the pod doesn't exist?
I would rather have a keyword like "new" or "scratch" to give --pod to cause it to create a new pod.
I really don't want additional options. And I don't want pod to magically get created on a typo.
+1 to the scratch idea. I was looking for that the other day.
Bumping this up.
@haircommander PTAL
@haircommander Are there remaining open items for this issue or can we close it? I am under the impression that all desired functionality has been implemented but I may be totally wrong :)
@vrothburg pod top is the last one and should be done today! I'll close once it's upstream
Should be good to close via https://github.com/containers/libpod/pull/1298 !