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

cni-protocol: new package #20515

Merged
merged 1 commit into from
Mar 9, 2023
Merged

Conversation

oskarirauta
Copy link
Contributor

simple protocol support script for netifd.

netifd protocol support for cni networks makes
defining network for podman and other similar
systems using cni networking much easier and simpler.

with cni protocol support, on a cni network, where firewall and portmapper is disabled, you may control firewalling with openwrt's standard firewall configuration.

for example, create a container that hosts web content on port 80 with static ip on your cni network, if your network is 10.88.0.0/16, use for eg. 10.88.0.101 as your containers static ip address. Create a zone, cni to your firewall and add your interface to it. You could manage all this without protocol support, but this makes it a bit easier, especially when this is requirement for my upcoming luci protocol support for same thing- so no tinkering necessary if someone feels more comfortable on LuCi, or just wants to see his interfaces page without warning about unsupported protocol extension.

Now you can easily set up redirectiong to 10.88.0.101:80 to expose it's port 80 to wan for serving your website.
Protocol has only one setting: device, on podman this often is cni-podman0.

Maintainer: me / @oskarirauta
Compile tested: x86_64, recent git
Run tested: x86_64, recent git

@oskarirauta
Copy link
Contributor Author

oskarirauta commented Feb 23, 2023

@1715173329

This a no-go? It has been pending here now for some time.

@1715173329
Copy link
Member

I think this can be added into the existing cni-plugins package directly.

@oskarirauta
Copy link
Contributor Author

@1715173329 I could do that. Personally, I don't use it with cni anymore, as I have moved to netavark (podman moving away from cni...) - but for the moment rust-lang support is still making it's way to openwrt, so I haven't made a PR on netavark package, as it requires language support that doesn't exist yet.

Maybe I should put it on cni for now and later when rust-lang is ready, separate it..?

@1715173329
Copy link
Member

if you gonna reuse it with netavark, then I agree to keep this separated.

@oskarirauta
Copy link
Contributor Author

oskarirauta commented Mar 4, 2023

@1715173329

Yes, I do. My package is here. But as I said, it requires rust-lang support to build. And here's my feature request on firewall driver support for podman. And here's my PR for letting system manage firewall on netavark. That's already merged to netavark. I am trying to participate on the early train in favour of openwrt to keep up the pace. Docker (and lxc and others?) likely will stay with cni.

Since podman v4.4.0, netavark is recommended and cni deprecation has begun, like it saids on release notes of v4.4.0.

And I don't think we should need identical protocol for netavark, or any other other similar equillavent and I think it's not a real world problem if protocol is named as cni; it sounds more universal than "netavark", when it works for any solution like this. Though naming suggestions are welcome, if something sounds better.

Suggestion

My private version though for this reason isn't depending on cni-plugins as there's no reason to install it when I use alternative (podman preferred) solution. Should I then remove depency on this PR too, already now?

@1715173329
Copy link
Member

My private version though for this reason isn't depending on cni-plugins as there's no reason to install it when I use alternative (podman preferred) solution. Should I then remove depency on this PR too, already now?

How about adding cni-protocol to cni-plugins's dependencies list? This script is tiny and does not take many bytes.
I think it could be easier than resolve dependeny issue in the cni-protocol itself.

@oskarirauta
Copy link
Contributor Author

oskarirauta commented Mar 4, 2023

@1715173329

What a splendid idea! I removed cni-plugins depency from this.
I also added mention about netavark (and others if there are any others, for example for other container managers..) to commit message.

net/cni-protocol/Makefile Outdated Show resolved Hide resolved
simple protocol support script for netifd.

netifd protocol support for cni networks makes
defining network for podman and other similar
systems using cni networking much easier and simpler.

with cni protocol support, on a cni network, where firewall
and portmapper is disabled, you may control firewalling
with openwrt's standard firewall configuration.

for example, create a container that hosts web content on
port 80 with static ip on your cni network, if your
network is 10.88.0.0/16, use for eg. 10.88.0.101 as
your containers static ip address. Create a zone, cni
to your firewall and add your interface to it.

Now you can easily set up redirectiong to 10.88.0.101:80
to expose it's port 80 to wan for serving your website.

Protocol has only one setting: device, on podman this
often is cni-podman0. This protocol may also be used
on other equillavents, such as netavark (cni replacement
in podman), where device as default is podman0.

Signed-off-by: Oskari Rauta <[email protected]>
@1715173329 1715173329 merged commit 278a661 into openwrt:master Mar 9, 2023
@oskarirauta oskarirauta deleted the cni-protocol branch March 12, 2023 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants