cockpit-podman icon indicating copy to clipboard operation
cockpit-podman copied to clipboard

feat: Network options for run images

Open david50407 opened this issue 4 years ago • 8 comments

Add network options in "Run image" dialog, as screenshot: image

Add two options:

  • Network Namespace Mode: for selecting --network option in podman CLI/netns.nsmode in podman API, which allows bridge/none/host and slirp4netns (if detected in podman info) in rootful mode (system flag), or none/slirp4netns (if detected in podman info) in rootless mode
  • CNI Networks: for selecting CNI networks using in bridge mode, which will listing CNI networks from /libpod/networks/json (podman network ls in CLI). Without choosing this option, podman will use default network.

also solved #176

More TODOs for the network feature:

  • support more ns modes and options, like container:id, ns:path, etc.
  • support shows IP infos from multiple networks (from NetworkSettings.Networks)

david50407 avatar Dec 23 '20 20:12 david50407

@marusak

support more ns modes and options, like container:id, ns:path, etc.

Do you plan to do this in this PR? Or should this be a follow up?

support shows IP infos from multiple networks (from NetworkSettings.Networks)

This is for followup, right?

both these TODOs will be in follow up PRs. because these ns modes may be too complicated on current UI, we may need to design the UI first

david50407 avatar Jan 04 '21 13:01 david50407

edit: I found that we can use dual list selector^1 to perform better CNI selection, I'm going to move to that component

--

@marusak ~~maybe we can borrow the select listview from machine's boot order selection to select CNIs, as screenshot below:~~

image

and provide another network mode option CNIs (or network-ids) for --network=id,id,... and keep bridge option to --network=bridge?

david50407 avatar Jan 04 '21 15:01 david50407

I have a few ideas, but if @garrett would have time to take a look and create some design that would be awesome.

But in general I would go more in the direction of what cli is doing and not what API is providing. So I would have select that would have preselected the default value (it knows if we are going to run root or rootless container so can pick the appropriate) and the select would then contain rest of the options (like none, host, bridge). network-id (CNI network) would be presented somewhat as Use defined networks... and when that one would be selected it would show that multiselect that you have there now. Very similarly it would work for other container network, just it would just show some simple select with list of available containers.

marusak avatar Jan 07 '21 11:01 marusak

Hey! Stumbled upon this open PR as I'm trying to run a container in host mode using cockpit-podman, is it still scheduled to be added in an upcoming release of the application?

gjorando avatar Aug 31 '21 01:08 gjorando

is it still scheduled to be added in an upcoming release of the application?

Hopefully one day :) Also there is redesign happening, so this would fit a bit more now, but we still need to find a good way of doing this.

https://github.com/cockpit-project/cockpit/discussions/16059

marusak avatar Aug 31 '21 07:08 marusak

@marusak That design is awesome! Feel free to close this PR if you want to wait releasing new design.

david50407 avatar Aug 31 '21 13:08 david50407

I hope to improve this module as soon as possible

mmm8955405 avatar Oct 18 '21 01:10 mmm8955405

Just a quick note: We've implemented the redesign of the create container modal dialog. It now has tabs. This feature would probably also go into integration with the rest of the optional settings, some of which are also network-related.

garrett avatar Apr 21 '22 13:04 garrett

Podman's networking stack changed quite a bit and CNI plugins are now deprecated. Closing this, feel free to re-open when you have found time to work on it.

jelly avatar Nov 10 '23 08:11 jelly