Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

podman network create: add option to set custom network driver settings, eg like MTU #8454

Closed
pschiffe opened this issue Nov 23, 2020 · 8 comments
Assignees
Labels
Good First Issue This issue would be a good issue for a first time contributor to undertake. In Progress This issue is actively being worked by the assignee, please do not work on this at this time. kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@pschiffe
Copy link

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

/kind feature

Description

Docker command docker network create has the -o, --opt map Set driver specific options (default map[]) option.

With podman, one have to modify the config file in /etc/cni/ once the network is created to change its settings, which is not very automation friendly.

Related ansible collection RFE: containers/ansible-podman-collections#147

@rhatdan
Copy link
Member

rhatdan commented Nov 23, 2020

@pschiffe interested in opening a PR to fix this?

@rhatdan rhatdan added the Good First Issue This issue would be a good issue for a first time contributor to undertake. label Nov 23, 2020
@afbjorklund
Copy link
Contributor

This would be useful for minikube as well, I can probably do a PR for it

@rhatdan
Copy link
Member

rhatdan commented Nov 23, 2020

You got it.

@rhatdan rhatdan added the In Progress This issue is actively being worked by the assignee, please do not work on this at this time. label Nov 23, 2020
@afbjorklund
Copy link
Contributor

afbjorklund commented Nov 23, 2020

Most likely it will be a simple option to "network create", rather than -o com.docker.network.driver.mtu=1500

But I suppose it could eventually be some kind of passthrough to the CNI parameters, not current code though

@afbjorklund
Copy link
Contributor

afbjorklund commented Nov 23, 2020

Seems to be working:

$ sudo ./bin/podman network create podman1
/etc/cni/net.d/podman1.conflist
$ sudo ./bin/podman network create podman2 --mtu 5000
/etc/cni/net.d/podman2.conflist

27: cni-podman1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000

29: cni-podman2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 5000 qdisc noqueue state UP group default qlen 1000

@pschiffe
Copy link
Author

Looking great and good enough for me, thank you!

@afbjorklund
Copy link
Contributor

afbjorklund commented Nov 24, 2020

Syntax now changed to:

podman network create podman2 --opt mtu=5000

Resulting configuration diff:

@@ -1,12 +1,13 @@
 {
    "cniVersion": "0.4.0",
-   "name": "podman1",
+   "name": "podman2",
    "plugins": [
       {
          "type": "bridge",
-         "bridge": "cni-podman1",
+         "bridge": "cni-podman2",
          "isGateway": true,
          "ipMasq": true,
+         "mtu": 5000,
          "hairpinMode": true,
          "ipam": {
             "type": "host-local",
@@ -18,7 +19,7 @@
             "ranges": [
                [
                   {
-                     "subnet": "10.89.0.0/24"
+                     "subnet": "10.89.1.0/24"
                   }
                ]
             ]

@pschiffe
Copy link
Author

pschiffe commented Dec 2, 2020

Resolved via #8457

@pschiffe pschiffe closed this as completed Dec 2, 2020
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Good First Issue This issue would be a good issue for a first time contributor to undertake. In Progress This issue is actively being worked by the assignee, please do not work on this at this time. kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

No branches or pull requests

4 participants