Skip to content

Commit ebcd470

Browse files
Update README.md
1 parent c79c4e4 commit ebcd470

File tree

1 file changed

+56
-9
lines changed

1 file changed

+56
-9
lines changed

README.md

Lines changed: 56 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,62 @@ You need to install CNI plugins on Nomad client nodes under `/opt/cni/bin` befor
151151
$ sudo mkdir -p /opt/cni/bin
152152
$ sudo tar -C /opt/cni/bin -xzf cni-plugins.tgz
153153
```
154+
Also, ensure your Linux operating system distribution has been configured to allow container traffic through the bridge network to be routed via iptables. These tunables can be set as follows:
155+
156+
```
157+
$ echo 1 > /proc/sys/net/bridge/bridge-nf-call-arptables
158+
$ echo 1 > /proc/sys/net/bridge/bridge-nf-call-ip6tables
159+
$ echo 1 > /proc/sys/net/bridge/bridge-nf-call-iptables
160+
```
161+
To preserve these settings on startup of a nomad client node, add a file including the following to `/etc/sysctl.d/` or remove the file your Linux distribution puts in that directory.
162+
163+
```
164+
net.bridge.bridge-nf-call-arptables = 1
165+
net.bridge.bridge-nf-call-ip6tables = 1
166+
net.bridge.bridge-nf-call-iptables = 1
167+
```
168+
169+
## Port forwarding
170+
171+
nomad supports both **static** and **dynamic** port mapping.
172+
173+
1. **Static ports**
174+
175+
Static port mapping can be added in the `network` stanza.
176+
```
177+
network {
178+
mode = "bridge"
179+
port "lb" {
180+
static = 8889
181+
to = 8889
182+
}
183+
}
184+
```
185+
Here, `host` port `8889` is mapped to `container` port `8889`.<br/>
186+
**NOTE**: static ports are usually not recommended, except for `system` or specialized jobs like load balancers.
187+
188+
2. **Dynamic ports**
189+
190+
Dynamic port mapping is also enabled in the `network` stanza.
191+
```
192+
network {
193+
mode = "bridge"
194+
port "http" {
195+
to = 8080
196+
}
197+
}
198+
```
199+
Here, nomad will allocate a dynamic port on the `host` and that port will be mapped to `8080` in the container.
200+
201+
You can also read more about `network stanza` in the [`nomad official documentation`](https://www.nomadproject.io/docs/job-specification/network)
202+
203+
## Service discovery
204+
205+
Nomad schedules workloads of various types across a cluster of generic hosts. Because of this, placement is not known in advance and you will need to use service discovery to connect tasks to other services deployed across your cluster. Nomad integrates with Consul to provide service discovery and monitoring.
206+
207+
A [`service`](https://www.nomadproject.io/docs/job-specification/service) stanza can be added to your job spec, to enable service discovery.
208+
209+
The service stanza instructs Nomad to register a service with Consul.
154210

155211
## Tests
156212
```
@@ -174,15 +230,6 @@ This will destroy your vagrant VM.
174230
## Currently supported environments
175231
Ubuntu (>= 16.04)
176232

177-
## Limitations
178-
179-
`nomad-driver-containerd` [`v0.1`](https://github.com/Roblox/nomad-driver-containerd/releases/tag/v0.1) is **not** production ready.
180-
There are some open items which are currently being worked on.
181-
182-
1) **Port forwarding**: The ability to map a host port to a container port. This is currently not supported, but could be supported in future.
183-
184-
2) **Consul connect**: When a user launches a job in `nomad`, s/he can add a [`service stanza`](https://www.nomadproject.io/docs/job-specification/service) which will instruct `nomad` to register the service with `consul` for service discovery. This is currently not supported.
185-
186233
## License
187234

188235
Copyright 2020 Roblox Corporation

0 commit comments

Comments
 (0)