Skip to content

Commit

Permalink
Update website with network mbit deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahmood Ali authored and fredrikhgrelland committed Sep 28, 2020
1 parent 451d705 commit f63bfcc
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 33 deletions.
65 changes: 32 additions & 33 deletions website/pages/docs/job-specification/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,44 @@ 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.
group "webs" {
# 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" {
Expand All @@ -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 {
Expand All @@ -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
}
}
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions website/pages/docs/job-specification/network.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ job "docs" {

## `network` Parameters

- `mbits` <code>([*deprecated*](/docs/upgrade/upgrade-specific#nomad-0-12-0) int: 10)</code> - Specifies the bandwidth required in MBits.

- `port` <code>([Port](#port-parameters): nil)</code> - Specifies a TCP/UDP port
allocation and can be used to specify both dynamic ports and reserved ports.

Expand Down
14 changes: 14 additions & 0 deletions website/pages/docs/upgrade/upgrade-specific.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f63bfcc

Please sign in to comment.