From c320e9140764f3232cd06e321389df5a689c96d1 Mon Sep 17 00:00:00 2001 From: Mahmood Ali Date: Wed, 16 Sep 2020 11:06:35 -0400 Subject: [PATCH] Update website with network mbit deprecation --- .../pages/docs/job-specification/index.mdx | 65 +++++++++---------- .../pages/docs/job-specification/network.mdx | 2 + .../pages/docs/upgrade/upgrade-specific.mdx | 14 ++++ 3 files changed, 48 insertions(+), 33 deletions(-) diff --git a/website/pages/docs/job-specification/index.mdx b/website/pages/docs/job-specification/index.mdx index 37ac6ff1b..54fab1f31 100644 --- a/website/pages/docs/job-specification/index.mdx +++ b/website/pages/docs/job-specification/index.mdx @@ -58,6 +58,7 @@ job "docs" { max_parallel = 2 } + # A group defines a series of tasks that should be co-located # on the same client (host). All tasks within a group will be # placed on the same host. @@ -65,6 +66,36 @@ job "docs" { # Specify the number of these tasks we want. count = 5 + network { + # This requests a dynamic port named "http". This will + # be something like "46283", but we refer to it via the + # label "http". + port "http" {} + + # This requests a static port on 443 on the host. This + # will restrict this task to running once per host, since + # there is only one port 443 on each host. + port "https" { + static = 443 + } + } + + # The service block tells Nomad how to register this service + # with Consul for service discovery and monitoring. + service { + # This tells Consul to monitor the service on the port + # labelled "http". Since Nomad allocates high dynamic port + # numbers, we use labels to refer to them. + port = "http" + + check { + type = "http" + path = "/health" + interval = "10s" + timeout = "2s" + } + } + # Create an individual task (unit of work). This particular # task utilizes a Docker container to front a web application. task "frontend" { @@ -77,22 +108,6 @@ job "docs" { image = "hashicorp/web-frontend" } - # The service block tells Nomad how to register this service - # with Consul for service discovery and monitoring. - service { - # This tells Consul to monitor the service on the port - # labelled "http". Since Nomad allocates high dynamic port - # numbers, we use labels to refer to them. - port = "http" - - check { - type = "http" - path = "/health" - interval = "10s" - timeout = "2s" - } - } - # It is possible to set environment variables which will be # available to the task when it runs. env { @@ -102,26 +117,10 @@ job "docs" { } # Specify the maximum resources required to run the task, - # include CPU, memory, and bandwidth. + # include CPU and memory. resources { cpu = 500 # MHz memory = 128 # MB - - network { - mbits = 100 - - # This requests a dynamic port named "http". This will - # be something like "46283", but we refer to it via the - # label "http". - port "http" {} - - # This requests a static port on 443 on the host. This - # will restrict this task to running once per host, since - # there is only one port 443 on each host. - port "https" { - static = 443 - } - } } } } diff --git a/website/pages/docs/job-specification/network.mdx b/website/pages/docs/job-specification/network.mdx index 200c78a52..96162bcc1 100644 --- a/website/pages/docs/job-specification/network.mdx +++ b/website/pages/docs/job-specification/network.mdx @@ -50,6 +50,8 @@ job "docs" { ## `network` Parameters +- `mbits` ([*deprecated*](/docs/upgrade/upgrade-specific#nomad-0-12-0) int: 10) - Specifies the bandwidth required in MBits. + - `port` ([Port](#port-parameters): nil) - Specifies a TCP/UDP port allocation and can be used to specify both dynamic ports and reserved ports. diff --git a/website/pages/docs/upgrade/upgrade-specific.mdx b/website/pages/docs/upgrade/upgrade-specific.mdx index d26629a65..8807481f0 100644 --- a/website/pages/docs/upgrade/upgrade-specific.mdx +++ b/website/pages/docs/upgrade/upgrade-specific.mdx @@ -17,6 +17,20 @@ standard upgrade flow. ## Nomad 0.12.0 +### `mbits` and Task Network Resource deprecation + +Starting in Nomad 0.12.0 the `mbits` field of the network resource block has +been deprecated and is no longer considered when making scheduling decisions. +This is in part because we felt that `mbits` didn't accurately account network +bandwidth as a resource. + +Additionally the use of the `network` block inside of a task's `resource` block is +also deprecated. Users are advised to move their `network` block to the `group` +block. Recent networking features have only been added to group based network +configuration. If any usecase or feature which was available with task network +resource is not fulfilled with group network configuration, please open an issue +detailing the missing capability. + ### Enterprise Licensing Enterprise binaries for Nomad are now publicly available via