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

Ability to map CNI networks to user-configurable interface names inside containers #11534

Closed
ettoredn opened this issue Sep 11, 2021 · 11 comments
Labels
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. network Networking related issue or feature

Comments

@ettoredn
Copy link

ettoredn commented Sep 11, 2021

/kind feature

Could you consider the ability to map networks to specific interface names inside the container? From what I can see right now every interface is simply named eth<id>.

A simple use case for this is running a DHCP client on an macvlan interface from inside the container. By mapping a network to a predictable interface name, there would be more assurance on which interface/network it is run. Moreover, this would also become handy when there is the need to bind certain services to specific networks only.

@openshift-ci openshift-ci bot added the kind/feature Categorizes issue or PR as related to a new feature. label Sep 11, 2021
@mheon
Copy link
Member

mheon commented Sep 12, 2021

Can you give an example of what you would like the interfaces to be named?

@Luap99
Copy link
Member

Luap99 commented Sep 12, 2021

That should be possible with CNI but how should the UI look like? I would prefer to not have an extra cli flag.

@Luap99 Luap99 added the network Networking related issue or feature label Sep 12, 2021
@ettoredn
Copy link
Author

ettoredn commented Sep 12, 2021

Had a quick look at CRI-O and there already is support for it (also look around for CNI_IFNAME env).

IMO the best design would be as simple as adding the ifname key to the network .conflist.

@mheon does it matter what name I'd like to set it to? In my setup the name I'd like to have is tcloud. To be more verbose: in this setup each container is expected to have a ptp (let's name it ptp!) for egress IPv4 traffic to the internet, and a macvlan interface connected to a private IPv6 virtual network to access various services and receive HTTP requests from HAProxy.

@mheon
Copy link
Member

mheon commented Sep 12, 2021

Ah, so the ask is for the interface name to be user-configurable.

@ettoredn ettoredn changed the title Ability to map CNI networks to predictable interface names inside containers Ability to map CNI networks to user-configurable interface names inside containers Sep 12, 2021
@Luap99
Copy link
Member

Luap99 commented Sep 13, 2021

The problem is we support n networks for a container, so CNI_IFNAME env does not work. Adding it to the conflist file is out of our control and I doubt that the CNI maintainers would like this.
I know that this is easy to set in the networking code. The problem is the frontend IMO. I just don't see a good UI at the moment.

@mheon
Copy link
Member

mheon commented Sep 13, 2021

We could do something similar to what we used to do for static IP and IPv6, where they're only supported with the CNI backend if you only join a single network - the user experience for that is bad, but not unusable.

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Oct 14, 2021

@mheon @Luap99 Should we mark this as being fixable in 4.0?

@Luap99
Copy link
Member

Luap99 commented Oct 14, 2021

Yes, the db changes must be done anyway. My only question is how the cli parts should look like.
Maybe we can use the same logic as slirp4netns options, e.g. --network mynet:interface_name=eth0

@mheon
Copy link
Member

mheon commented Oct 14, 2021

I think that's a good idea - we made them generic when we added them for this sort of eventuality.

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@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 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
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. network Networking related issue or feature
Projects
None yet
Development

No branches or pull requests

4 participants