podman/pkg
Paul Holzinger 54b588c07d rootless cni without infra container
Instead of creating an extra container create a network and mount
namespace inside the podman user namespace. This ns is used to
for rootless cni operations.
This helps to align the rootless and rootful network code path.
If we run as rootless we just have to set up a extra net ns and
initialize slirp4netns in it. The ocicni lib will be called in
that net ns.

This design allows allows easier maintenance, no extra container
with pause processes, support for rootless cni with --uidmap
and possibly more.

The biggest problem is backwards compatibility. I don't think
live migration can be possible. If the user reboots or restart
all cni containers everything should work as expected again.
The user is left with the rootless-cni-infa container and image
but this can safely be removed.

To make the existing cni configs work we need execute the cni plugins
in a extra mount namespace. This ensures that we can safely mount over
/run and /var which have to be writeable for the cni plugins without
removing access to these files by the main podman process. One caveat
is that we need to keep the netns files at `XDG_RUNTIME_DIR/netns`
accessible.

`XDG_RUNTIME_DIR/rootless-cni/{run,var}` will be mounted to `/{run,var}`.
To ensure that we keep the netns directory we bind mount this relative
to the new root location, e.g. XDG_RUNTIME_DIR/rootless-cni/run/user/1000/netns
before we mount the run directory. The run directory is mounted recursive,
this makes the netns directory at the same path accessible as before.

This also allows iptables-legacy to work because /run/xtables.lock is
now writeable.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-04-01 17:27:03 +02:00
..
annotations Spelling 2020-12-22 13:34:31 -05:00
api Fix handling of remove --log-rusage param 2021-03-31 07:46:20 -04:00
auth Enable whitespace linter 2021-02-11 23:01:56 +01:00
autoupdate Do not leak libpod package into the remote client 2021-03-15 14:02:04 +01:00
bindings Fix bindings prune containers flaky test 2021-03-31 13:40:55 +02:00
cgroups Merge pull request #9464 from giuseppe/fix-cgroupv1-stats 2021-02-22 15:48:44 -05:00
channel fix closed the remote connection on pull causes service panic 2020-10-03 11:38:38 +08:00
checkpoint Use functions and defines from checkpointctl 2021-03-02 17:00:06 +00:00
copy podman cp: support copying on tmpfs mounts 2021-03-04 15:43:12 +01:00
criu Add helper function to read out CRIU version 2018-10-23 12:52:03 +02:00
ctime Re-add int64 casts for ctime 2019-07-23 15:43:40 -04:00
domain Merge pull request #9863 from jmguzik/fix-prune-filter-funcs 2021-03-30 20:51:00 +02:00
env Ensure DefaultEnvVariables is used in Specgen 2020-08-18 15:17:46 -04:00
errorhandling Reduce general binding binary size 2021-01-13 09:35:24 -06:00
hooks bump go module to v3 2021-02-22 09:03:51 +01:00
inspect bump go module to v3 2021-02-22 09:03:51 +01:00
kubeutils prune remotecommand dependency 2021-02-25 10:02:41 -06:00
lookup Enable whitespace linter 2021-02-11 23:01:56 +01:00
machine Remove --execute from podman machine ssh 2021-03-31 12:51:33 -05:00
namespaces [NO TESTS NEEDED] Shrink the size of podman-remote 2021-03-29 09:49:45 -04:00
netns rootless cni without infra container 2021-04-01 17:27:03 +02:00
network Split libpod/network package 2021-03-15 14:01:52 +01:00
parallel bump go module to v3 2021-02-22 09:03:51 +01:00
ps bump go module to v3 2021-02-22 09:03:51 +01:00
registrar bump go module to v3 2021-02-22 09:03:51 +01:00
registries Document CONTAINERS_CONF/CONTAINERS_STORAGE_CONF Env variables 2021-03-10 06:34:47 -05:00
resolvconf bump go module to v3 2021-02-22 09:03:51 +01:00
rootless Merge pull request #9855 from giuseppe/fix-service-race-condition 2021-03-29 17:40:21 +00:00
rootlessport Enable whitespace linter 2021-02-11 23:01:56 +01:00
seccomp Spelling 2020-12-22 13:34:31 -05:00
selinux Fix SELinux functions names to not be repetitive 2020-04-23 15:57:34 -04:00
signal Fix build for mips architecture follow-up 2021-01-07 15:04:22 +01:00
specgen Merge pull request #9516 from rhatdan/shrink 2021-03-29 17:14:26 +00:00
systemd podman generate systemd --new do not duplicate params 2021-03-28 20:01:17 +02:00
terminal pkg/terminal: use c/storage/pkg/homedir 2021-03-08 09:21:13 +01:00
timetype make lint: enable gocritic 2020-01-13 14:27:02 +01:00
trust Enable whitespace linter 2021-02-11 23:01:56 +01:00
util [NO TESTS NEEDED] Shrink the size of podman-remote 2021-03-29 09:49:45 -04:00