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
Unable to create pod with specific CNI network #4718
Comments
Since github's jump-to-definition is working these days I poked around a bit, looks like the desync is that creating an infra container always uses a zero-length network list: https://github.com/containers/libpod/blob/b2f05e0e84411f985fea66e9edff1fec8f26d28d/libpod/runtime_pod_infra_linux.go#L96-L104 While creating a normal container supports adding one or more userNetworks to the list: https://github.com/containers/libpod/blob/b2f05e0e84411f985fea66e9edff1fec8f26d28d/pkg/spec/namespaces.go#L31-L64 |
Yeah, this just needs to be wired up in the command line, though @haircommander and I were discussing moving infra container creation logic such that we wouldn't also need to pass all infra config through the pod configuration, which would make it easier to allow more container configuration options for pods. |
That would be a good refactor, I don't really want to submit a PR that just copy/pastes the split code.. Would it be more practical, short term at least, to defer the infra container creation, and allow following up with some sort of |
I think that would be an end-goal of our refactor - allowing |
Ah, I initially read it as somehow inheriting all the In the case of allowing a followup command, I'm not sure what actual refactoring is needed. Given that the infra pod is already opt-out-able at least. Sounds like creating an With no further patches, it would definitely be up the caller to properly configure that pause container (image, name, readonly fs, etc) via the existing |
We'd need the ability to set |
I went ahead with patching a --network flag into Given the work described to properly allow full flexibility with infra containers, and the fact that I only have pretty crappy podman environments available I don't think I'd manage a proper attempt at that larger refactor before EOY, if I'm even the right person to attempt it. |
A friendly reminder that this issue had no activity for 30 days. |
Why does the infra container need a network connectivity at all? Currently the infra container's networking is hard-coded to "bridge": runtime_pod_infra_linux.go#L98. Couldn't it simply be "none"? Hmm. Maybe this comment should've been over there: #4908 Infra containers receive IP addresses implicitly from unused network |
@gima Actually, the purpose of the infra pod is to hold one consistent namespaces including networking, so that the pod's containers can depend on the network etc. namespace existing at all times and automatically reuse them. From #4908
That usecase sounds backwards to how a pod is supposed to work - you'd want to set up the pod's intended network profile on the pod itself (aka the infra container), and then whatever containers you add to the pod will automatically inherit that networking, IP address, etc. If you specify networking when adding a container to a pod, you are opting-out of some of the intended functionality of pods - in particular, containers in a pod are intended to have a common 'localhost' by default. This ticket #4718 is to track the lack of pod networking options. If there were more options, like 'none' or 'this other specific network' then #4908 might not be a problem to begin with - you'd set the network when creating the pod, and stop specifying network options for containers within the pod. |
Ahhh, I missed a thing. |
If someone were to open a PR on this, I am sure we would consider it. |
There is one open, but abandoned. I'm going to see if I can push it the
last bit over the finish line
…On Fri, Jan 24, 2020, 06:00 Daniel J Walsh ***@***.***> wrote:
If someone were to open a PR on this, I am sure we would consider it.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#4718>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB3AOCF7JGEEGSABAJEQJB3Q7JYYPANCNFSM4J3OITVQ>
.
|
@mheon Any progress? |
Enables most of the network-related functionality from `podman run` in `podman pod create`. Custom CNI networks can be specified, host networking is supported, DNS options can be configured. Fixes containers#4718 Fixes containers#4770 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
#5241 to fix - a lot of other options got mixed in to the PR. |
Enables most of the network-related functionality from `podman run` in `podman pod create`. Custom CNI networks can be specified, host networking is supported, DNS options can be configured. Fixes containers#3837 Fixes containers#4718 Fixes containers#4770 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Good let's get that PR Merged... |
Enables most of the network-related functionality from `podman run` in `podman pod create`. Custom CNI networks can be specified, host networking is supported, DNS options can be configured. Fixes containers#2808 Fixes containers#3837 Fixes containers#4718 Fixes containers#4770 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Enables most of the network-related functionality from `podman run` in `podman pod create`. Custom CNI networks can be specified, host networking is supported, DNS options can be configured. Also enables host networking in `podman play kube`. Fixes containers#2808 Fixes containers#3837 Fixes containers#4718 Fixes containers#4770 Fixes containers#5240 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Enables most of the network-related functionality from `podman run` in `podman pod create`. Custom CNI networks can be specified, host networking is supported, DNS options can be configured. Also enables host networking in `podman play kube`. Fixes containers#2808 Fixes containers#3837 Fixes containers#4432 Fixes containers#4718 Fixes containers#4770 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Enables most of the network-related functionality from `podman run` in `podman pod create`. Custom CNI networks can be specified, host networking is supported, DNS options can be configured. Also enables host networking in `podman play kube`. Fixes containers#2808 Fixes containers#3837 Fixes containers#4432 Fixes containers#4718 Fixes containers#4770 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Enables most of the network-related functionality from `podman run` in `podman pod create`. Custom CNI networks can be specified, host networking is supported, DNS options can be configured. Also enables host networking in `podman play kube`. Fixes containers#2808 Fixes containers#3837 Fixes containers#4432 Fixes containers#4718 Fixes containers#4770 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Enables most of the network-related functionality from `podman run` in `podman pod create`. Custom CNI networks can be specified, host networking is supported, DNS options can be configured. Also enables host networking in `podman play kube`. Fixes containers#2808 Fixes containers#3837 Fixes containers#4432 Fixes containers#4718 Fixes containers#4770 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Enables most of the network-related functionality from `podman run` in `podman pod create`. Custom CNI networks can be specified, host networking is supported, DNS options can be configured. Also enables host networking in `podman play kube`. Fixes containers#2808 Fixes containers#3837 Fixes containers#4432 Fixes containers#4718 Fixes containers#4770 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Enables most of the network-related functionality from `podman run` in `podman pod create`. Custom CNI networks can be specified, host networking is supported, DNS options can be configured. Also enables host networking in `podman play kube`. Fixes containers#2808 Fixes containers#3837 Fixes containers#4432 Fixes containers#4718 Fixes containers#4770 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Enables most of the network-related functionality from `podman run` in `podman pod create`. Custom CNI networks can be specified, host networking is supported, DNS options can be configured. Also enables host networking in `podman play kube`. Fixes containers#2808 Fixes containers#3837 Fixes containers#4432 Fixes containers#4718 Fixes containers#4770 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Enables most of the network-related functionality from `podman run` in `podman pod create`. Custom CNI networks can be specified, host networking is supported, DNS options can be configured. Also enables host networking in `podman play kube`. Fixes containers#2808 Fixes containers#3837 Fixes containers#4432 Fixes containers#4718 Fixes containers#4770 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
/kind feature
Description
Hello, I have created multiple different CNI conflists. I don't seem able to specify which conflist a pod's infra container will use.
In this case conflist 87 is the default
podman
network, and 89 is a customdemo
network (10.89.0.0/24) which I intend to use for certain pods. I am able to use--net=demo
when creating containers but not when creating pods.Steps to reproduce the issue:
Create a second CNI with different IP range.
podman create pod
- a pod and infra container is created. Note that--net
argument is NOT valid here.Lookup infra container:
podman pod inspect -l | grep infraContainerID
and check its IP address:podman inspect 97...93 | grep IPAddress
Describe the results you received:
The infra container received an IP address from the first available CNI. In this case, 10.88.0.6 was selected.
Describe the results you expected:
I expected to be able to supply
--net=demo
at step 2 so that 10.89.0.0/24 would be used for the infra pod.Additional information you deem important (e.g. issue happens only occasionally):
I attempted to supply
--net=demo
when adding containers to the pod, figuring maybe the infra container would be moved to that network. However it only resulted in the containers getting their own individual IP addresses fromdemo
. This breaks the shared-localhost concept which is half of why pods are useful to begin with.Output of
podman version
:I know this is old!! CentOS Stream 8 doesn't have any way to upgrade. I've checked the latest
podman-pod-create.1.md
to ensure--network
is still not accepted inpod create
.Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Additional environment details (AWS, VirtualBox, physical, etc.):
Physical machine, blah blah.
My intention is to create a CNI network inside of a WireGuard VPN space so that individual pods can be issued VPN-routable IP addresses.
The text was updated successfully, but these errors were encountered: