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

docs: warn not to set network_mode for Connect-enabled Docker task #10724

Merged
merged 1 commit into from
Jun 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions website/content/docs/drivers/docker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,11 @@ config {
configuration on the host (which is outside the scope of Nomad). Valid values
pre-docker 1.9 are `default`, `bridge`, `host`, `none`, or `container:name`.

The default `network_mode` for tasks that use [Connect] will be
`container:<name>`, where the name is the container name of the parent
container used to share network namespaces between tasks. You should not set
`network_mode` for Connect-enabled tasks.
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens now when it's set? Should we add some validation/warning logic in the docker driver too?

Copy link
Member Author

Choose a reason for hiding this comment

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

Your task can't reach the Envoy proxy and can't be reached over the Envoy proxy. I do want to add a warning but it's one of those annoying scenarios where the enforcement will be all client-side because it's in the driver config. In any case, I want to do any code changes to improve that in a separate PR. Also, I do worry that I haven't considered some weird corner case where you'd want to do that?

Copy link
Member Author

Choose a reason for hiding this comment

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

I've opened #10725 for the driver change, just in case I don't get to it right away.


- `pid_mode` - (Optional) `host` or not set (default). Set to `host` to share
the PID namespace with the host. Note that this also requires the Nomad agent
to be configured to allow privileged containers.
Expand Down Expand Up @@ -1143,3 +1148,4 @@ Windows is relatively new and rapidly evolving you may want to consult the
[no_net_raw]: /docs/upgrade/upgrade-specific#nomad-1-1-0-rc1-1-0-5-0-12-12
[docker_caps]: https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities
[allow_caps]: /docs/drivers/docker#allow_caps
[Connect]: /docs/job-specification/connect