From 8ae2f61a67fc94e59cf0de0d8abe157157c54f5c Mon Sep 17 00:00:00 2001 From: Luiz Aoqui Date: Tue, 24 Aug 2021 13:44:39 -0400 Subject: [PATCH 1/2] docs: document Docker extra_hosts behaviour post v1.1.3 --- website/content/docs/drivers/docker.mdx | 5 ++++- website/content/docs/upgrade/upgrade-specific.mdx | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/website/content/docs/drivers/docker.mdx b/website/content/docs/drivers/docker.mdx index 6bdf5362993a..75c37d558da7 100644 --- a/website/content/docs/drivers/docker.mdx +++ b/website/content/docs/drivers/docker.mdx @@ -111,7 +111,9 @@ config { - `entrypoint` - (Optional) A string list overriding the image's entrypoint. - `extra_hosts` - (Optional) A list of hosts, given as host:IP, to be added to - `/etc/hosts`. + `/etc/hosts`. This option may not work as expected in `bridge` network mode + when there are more than one task within the same group. Refer to the + [upgrade guide][upgrade_guide_extra_hosts] for more information. - `force_pull` - (Optional) `true` or `false` (default). Always pull most recent image instead of using existing local image. Should be set to `true` if repository tags @@ -1149,6 +1151,7 @@ Windows is relatively new and rapidly evolving you may want to consult the [cap_add]: /docs/drivers/docker#cap_add [cap_drop]: /docs/drivers/docker#cap_drop [no_net_raw]: /docs/upgrade/upgrade-specific#nomad-1-1-0-rc1-1-0-5-0-12-12 +[upgrade_guide_extra_hosts]: /docs/upgrade/upgrade-specific#docker-driver [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 diff --git a/website/content/docs/upgrade/upgrade-specific.mdx b/website/content/docs/upgrade/upgrade-specific.mdx index c0dcd04c86e7..5c97865bde77 100644 --- a/website/content/docs/upgrade/upgrade-specific.mdx +++ b/website/content/docs/upgrade/upgrade-specific.mdx @@ -44,6 +44,11 @@ from the task directory to `/etc/hosts` within the task. In Nomad 1.1.3 the source for the bind mount was moved to the allocation directory so that it is shared between all tasks in an allocation. +Please note that this change may prevent [`extra_hosts`] values from being +properly set in each task when there are multiple tasks within the same group. +When using `extra_hosts` with Consul Connect in `bridge` network mode, you +should set the hosts values in the [`sidecar_task.config`] block instead. + ## Nomad 1.1.0 #### Enterprise licenses @@ -1160,6 +1165,7 @@ deleted and then Nomad 0.3.0 can be launched. [preemption-api]: /api-docs/operator#update-scheduler-configuration [preemption]: /docs/internals/scheduling/preemption [proxy_concurrency]: /docs/job-specification/sidecar_task#proxy_concurrency +[`sidecar_task.config`]: /docs/job-specification/sidecar_task#config [reserved]: /docs/configuration/client#reserved-parameters [task-config]: /docs/job-specification/task#config [tls-guide]: https://learn.hashicorp.com/tutorials/nomad/security-enable-tls @@ -1177,6 +1183,7 @@ deleted and then Nomad 0.3.0 can be launched. [`CAP_NET_RAW`]: https://security.stackexchange.com/a/128988 [`linux capabilities`]: https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities [`allow_caps`]: /docs/drivers/docker#allow_caps +[`extra_hosts`]: /docs/drivers/docker#extra_hosts [no_net_raw]: /docs/upgrade/upgrade-specific#nomad-1-1-0-rc1-1-0-5-0-12-12 [allow_caps_exec]: /docs/drivers/exec#allow_caps [allow_caps_java]: /docs/drivers/java#allow_caps From eb439d6dee0ba18160f74807362db23a83457049 Mon Sep 17 00:00:00 2001 From: Luiz Aoqui Date: Wed, 1 Sep 2021 12:35:33 -0400 Subject: [PATCH 2/2] Update website/content/docs/drivers/docker.mdx Co-authored-by: Derek Strickland <1111455+DerekStrickland@users.noreply.github.com> --- website/content/docs/drivers/docker.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/content/docs/drivers/docker.mdx b/website/content/docs/drivers/docker.mdx index 75c37d558da7..e85b79d23eed 100644 --- a/website/content/docs/drivers/docker.mdx +++ b/website/content/docs/drivers/docker.mdx @@ -112,7 +112,7 @@ config { - `extra_hosts` - (Optional) A list of hosts, given as host:IP, to be added to `/etc/hosts`. This option may not work as expected in `bridge` network mode - when there are more than one task within the same group. Refer to the + when there is more than one task within the same group. Refer to the [upgrade guide][upgrade_guide_extra_hosts] for more information. - `force_pull` - (Optional) `true` or `false` (default). Always pull most recent image