mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
Update network docs
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user