Skip to content

Commit eae07be

Browse files
author
Mano Marks
authored
Merge pull request docker#257 from iblancasa/patch-1
Fix headers
2 parents 229032f + 9b92c02 commit eae07be

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

networking/tutorials.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
###<a name="pets"></a>Tutorial Application: The Pets App
2+
### <a name="pets"></a>Tutorial Application: The Pets App
33

44
In the following example, we will use a fictional app called **[Pets](https://github.com/mark-church/pets)** to illustrate the __Network Deployment Models__. It serves up images of pets on a web page while counting the number of hits to the page in a backend database. It is configurable via two environment variables, `DB` and `ROLE`.
55

@@ -20,7 +20,7 @@ We will explore the following network deployment models in this section:
2020
- Overlay Driver
2121
- MACVLAN Bridge Mode Driver
2222

23-
###<a name="bridgemodel"></a>Tutorial App: Bridge Driver
23+
### <a name="bridgemodel"></a>Tutorial App: Bridge Driver
2424
This model is the default behavior of the built-in Docker `bridge` network driver. The `bridge` driver creates a private network internal to the host and provides an external port mapping on a host interface for external connectivity.
2525

2626
```bash
@@ -88,7 +88,7 @@ $ docker network inspect catnet
8888
```
8989
In this output, we can see that our two containers have automatically been given ip addresses from the `172.19.0.0/16` subnet. This is the subnet of the local `catnet` bridge, and it will provide all connected containers a subnet from this range unless they are statically configured.
9090

91-
###Tutorial App: Multi-Host Bridge Driver Deployment
91+
### Tutorial App: Multi-Host Bridge Driver Deployment
9292

9393
Deploying a multi-host application requires some additional configuration so that distributed components can connect with each other. In the following example we explicitly tell the `web` container the location of `redis` with the environment variable `DB=hostB:8001`. Another change is that we are port mapping port `6379` inside the`redis` container to port `8001` on the `hostB`. Without the port mapping, `redis` would only be accessible on its connected networks (the default `bridge` in this case).
9494

@@ -115,15 +115,15 @@ In the overlay driver example we will see that multi-host service discovery is p
115115

116116

117117

118-
####Bridge Driver Benefits and Use-Cases
118+
#### Bridge Driver Benefits and Use-Cases
119119

120120
- Very simple architecture promotes easy understanding and troubleshooting
121121
- Widely deployed in current production environments
122122
- Simple to deploy in any environment from developer laptops to production data center
123123

124124

125125

126-
###<a name="overlaymodel"></a>Tutorial App: Overlay Driver
126+
### <a name="overlaymodel"></a>Tutorial App: Overlay Driver
127127

128128
This model utilizes the built-in `overlay` driver to provide multi-host connectivity out of the box. The default settings of the overlay driver will provide external connectivity to the outside world as well as internal connectivity and service discovery within a container application. The [Overlay Driver Architecture](#overlayarch) section reviews the internals of the Overlay driver which you should review before reading this section.
129129

@@ -182,7 +182,7 @@ This example uses the following logical topology:
182182

183183

184184

185-
####Overlay Benefits and Use Cases
185+
#### Overlay Benefits and Use Cases
186186

187187
- Very simple multi-host connectivity for small and large deployments
188188
- Provides service discovery and load balancing with no extra configuration or components
@@ -191,7 +191,7 @@ This example uses the following logical topology:
191191

192192

193193

194-
###<a name="macvlanmodel"></a>Tutorial App: MACVLAN Bridge Mode
194+
### <a name="macvlanmodel"></a>Tutorial App: MACVLAN Bridge Mode
195195

196196
There may be cases where the application or network environment requires containers to have routable IP addresses that are a part of the underlay subnets. The MACVLAN driver provides an implementation that makes this possible. As described in the [MACVLAN Architecture section](#macvlan), a MACVLAN network binds itself to a host interface. This can be a physical interface, a logical sub-interface, or a bonded logical interface. It acts as a virtual switch and provides communication between containers on the same MACVLAN network. Each container receives a unique MAC address and an IP address of the physical network that the node is attached to.
197197

@@ -213,7 +213,7 @@ host-B $ docker run -it --net macvlan --ip 192.168.0.5 --name dog-db redis
213213

214214
When `dog-web` communicates with `dog-db`, the physical network will route or switch the packet using the source and destination addresses of the containers. This can simplify network visibility as the packet headers can be linked directly to specific containers. At the same time application portability is decreased as container IPAM is tied to the physical network. Container addressing must adhere to the physical location of container placement in addition to preventing overlapping address assignment. Because of this, care must be taken to manage IPAM externally to a MACVLAN network. Overlapping IP addressing or incorrect subnets can lead to loss of container connectivity.
215215

216-
####MACVLAN Benefits and Use Cases
216+
#### MACVLAN Benefits and Use Cases
217217

218218
- Very low latency applications can benefit from the `macvlan` driver because it does not utilize NAT.
219219
- MACVLAN can provide an IP per container, which may be a requirement in some environments.

0 commit comments

Comments
 (0)