Update network docs

This commit is contained in:
Alex Dadgar
2015-11-30 14:18:31 -08:00
parent 87bd702c0a
commit fcd170c023
2 changed files with 26 additions and 14 deletions

View File

@@ -220,17 +220,17 @@ The `resources` object supports the following keys:
The `network` object supports the following keys:
* `dynamic_ports` - List of port labels which may contain letters,
numbers and underscores (`^[a-zA-Z0-9_]+$`). Each label will be assigned a
dynamic port when the task starts. Ports are passed to the task environment as
`NOMAD_PORT_{LABEL}`. Drivers may infer additional semantics from the label.
See the relevant driver docs for details.
* `mbits` - The number of MBits in bandwidth required.
* `reserved_ports` - This is a list of specific ports required.
For applications that cannot use a dynamic port, they can
request a specific port.
* `port` - `port` is a repeatable object that can be used to specify both
dynamic ports and reserved ports. It has the following format:
```
port "label" {
// If the `static` field is omitted, a dynamic port will be assigned.
static = 6539
}
```
### Restart Policy

View File

@@ -43,8 +43,14 @@ startup.
```
task "webservice" {
port "http" {}
port "https" {}
...
resources {
...
network {
port "http" {}
port "https" {}
}
}
}
```
@@ -56,9 +62,15 @@ place your task.
```
task "dnsservice" {
port "dns" {
static = 53
}
...
resources {
...
network {
port "dns" {
static = 53
}
}
}
}
```