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

Container with container-network gets assigned bogus port mappings after VCH restart #6091

Closed
corrieb opened this issue Aug 23, 2017 · 7 comments · Fixed by #6150
Closed
Assignees
Labels
component/portlayer/network kind/defect Behavior that is inconsistent with what's intended priority/p2

Comments

@corrieb
Copy link
Contributor

corrieb commented Aug 23, 2017

User Statement:

As a VIC user, I need docker ps to show me correct information after a VCH upgrade or reconfigure.

Details:

I'm not yet sure of the severity of this issue. It may be as minor as docker ps reporting wrong information, or as major as the networking being misconfigured on the containerVM leading to other issues.

Found using the most recent build 13393. Easy to reproduce:

$ docker run -d --net=ExternalNetwork -p 80 nginx
$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS               NAMES
d27e4651c267        nginx               "nginx -g daemon off;"   20 seconds ago      Up 18 seconds                           pedantic_hugle

now restart the VCH, either by doing an upgrade, reconfigure or a literal power cycle.

$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED              STATUS              PORTS                         NAMES
d27e4651c267        nginx               "nginx -g daemon off;"   About a minute ago   Up About a minute   10.118.69.115:32768->80/tcp   pedantic_hugle

Note that this container VM now has port mappings, which it shouldn't have, given that it's connected to a container network.

Acceptance Criteria:

I would like someone who understands the code to at least offer an opinion as to the severity of this issue.

@corrieb corrieb added component/portlayer/network kind/defect Behavior that is inconsistent with what's intended priority/p2 and removed priority/p2 labels Aug 23, 2017
@hmahmood
Copy link
Contributor

hmahmood commented Aug 23, 2017

Since the port is being mapped to a random port on the VCH, there is a sort of security breach I suppose, since the container is now exposed through the VCH. But I think this should be easy to fix: we just need to add another condition (to check if the endpoint is for a container network) to https://github.com/vmware/vic/blob/master/lib/apiservers/engine/backends/backends.go#L324 .

@anchal-agrawal
Copy link
Contributor

@corrieb @hmahmood Assigning medium priority, please re-assess if needed.

@hickeng
Copy link
Member

hickeng commented Aug 28, 2017

@hmahmood agree that we should be checking if the endpoint is for a container network.
@corrieb Is the port mapping even functional? Looks like the container would not be connected to the bridge network.

On a different note - would be nice if we could provide the container network IP for published ports ;)

@corrieb
Copy link
Contributor Author

corrieb commented Aug 28, 2017

@hickeng I didn't think it was functional, but this is why I asked @hasan to look at it. He seems to suggest above that it is - "now being exposed through the VCH"

@corrieb
Copy link
Contributor Author

corrieb commented Aug 28, 2017

+100 to displaying the container IP in docker ps :)

@hmahmood
Copy link
Contributor

@hickeng good point ... looking at the MapPorts function implementation, we add an iptables rule for the bridge interface, so the mapping is there, but not functional. There is an open port now on the VCH, although it goes nowhere; this mitigates the issue for me.

@corrieb
Copy link
Contributor Author

corrieb commented Aug 28, 2017

Good to know. Remains a highly visible UX issue though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/portlayer/network kind/defect Behavior that is inconsistent with what's intended priority/p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants