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

FreeBSD: CNI plugins #2429

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

akhramov
Copy link
Contributor

FreeBSD has the CNI plugins ported:
https://www.freshports.org/net/containernetworking-plugins/. This allows us to enable CNI networking for FreeBSD containers.

This change adapts the existing linux codebase to work on freebsd:

  • containerutil: use nullfs instead of bind mounts for resolv.conf, etc.
  • ocihook: freebsd's bridge plugin uses jail names in contrast to linux's network namespace usages

@akhramov
Copy link
Contributor Author

Depends on: samuelkarp/runj#46

@AkihiroSuda AkihiroSuda added this to the v1.5.1 (tentative) milestone Aug 11, 2023
@akhramov akhramov force-pushed the feature/CNI-jails branch 6 times, most recently from 7ae4ecb to 208fb83 Compare August 26, 2023 22:24
@akhramov
Copy link
Contributor Author

re: CI failures.
https://app.vagrantup.com/generic/boxes/freebsd13 is FreeBSD 13.1. We need at least 13.2. I'm looking into what can be done.

@AkihiroSuda
Copy link
Member

re: CI failures.
https://app.vagrantup.com/generic/boxes/freebsd13 is FreeBSD 13.1. We need at least 13.2. I'm looking into what can be done.

Does this work? (With installing vbox to CI)
https://app.vagrantup.com/freebsd/boxes/FreeBSD-13.2-RELEASE

@akhramov akhramov force-pushed the feature/CNI-jails branch 9 times, most recently from 443bd6d to 55a8b65 Compare September 4, 2023 19:52
@AkihiroSuda
Copy link
Member

CI failing

    default: Nerdctl is up and running.
    default: + /root/go/bin/nerdctl run --rm dougrabson/freebsd-small:13 nc -zw1 1.1.1.1 443
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
Error: Process completed with exit code 1.

https://github.com/containerd/nerdctl/actions/runs/6077164574/job/16486397831?pr=2429

@akhramov
Copy link
Contributor Author

akhramov commented Sep 6, 2023

Yes, I am trying to repro it locally. Looks like there's no internet connection within the container :)

@akhramov akhramov force-pushed the feature/CNI-jails branch 2 times, most recently from be5647b to 6cd21f3 Compare September 9, 2023 07:04
@AkihiroSuda AkihiroSuda modified the milestones: v1.5.1, v1.5.2 Sep 11, 2023
}
}
}
EOF
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe nerdctl should create this automatically to simplify the setup process

EOF

service pf onestart

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add this config to docs too?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be ocihook_linux.go, as the code is specific to Linux

FreeBSD has the CNI plugins ported:
https://www.freshports.org/net/containernetworking-plugins/. This
allows us to enable CNI networking for FreeBSD containers.

This change adapts the existing linux codebase to work on freebsd:

- containerutil: use nullfs instead of bind mounts for resolv.conf,
  etc.
- ocihook: freebsd's bridge plugin uses jail names in contrast to
  linux's network namespace usages
- container creation: configure runj runtime to create vnet jails by
  default

Signed-off-by: Artem Khramov <akhramov@pm.me>
@AkihiroSuda AkihiroSuda removed this from the v1.6.1 (tentative) milestone Oct 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants