Skip to content

Commit f91e440

Browse files
authored
Update docker-swarm-introduction.md
1 parent e9a7600 commit f91e440

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

admin-training/containers/docker-swarm-introduction.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ snow deploy swarm03
6262
-->
6363
## Swarm Interaction
6464

65-
1. Check the status of the Docker Swarm cluster
65+
### 1. Check the status of the Docker Swarm cluster
6666
```
6767
snow@swarm01:~$ docker node ls
6868
ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS ENGINE VERSION
@@ -71,7 +71,7 @@ t3z5ru9ssu20b7a9i9bj4p5sl swarm02 Ready Active
7171
o4vbamp797i2yrvo7anqlgd8y swarm03 Ready Active 18.03.1-ce
7272
```
7373

74-
2. Deploy the first application component as Docker service
74+
### 2. Deploy the first application component as Docker service
7575
The following example will create a very simple container running one hour sleep as a service.
7676
```
7777
snow@swarm01:~$ docker service create --name sleep_app alpine sleep 3600
@@ -82,15 +82,15 @@ verify: Service converged
8282
```
8383
This will pull the ubuntu image and run 'sleep 3600' in one container.
8484

85-
3. Verify that the service has been created in the Swarm cluster.
85+
### 3. Verify that the service has been created in the Swarm cluster.
8686
```
8787
snow@swarm01:~$ docker service ls
8888
ID NAME MODE REPLICAS IMAGE PORTS
8989
8o9bicf4mkcp sleep_app replicated 1/1 alpine:latest
9090
```
9191
If you have previous experiences with Docker, it may not seem that we have done anything very differently than just running a docker run. The key difference is that the container has been scheduled on a swarm cluster.
9292

93-
4. Scale the application
93+
### 4. Scale the application
9494
Imagine a situation were this particular application is under high demand. Docker Swarm allows to re-scale and re-balance the service across the three swarm nodes.
9595
In the following example we will create 9 replicas of the example application.
9696
```
@@ -123,7 +123,7 @@ rtmfau8n152p sleep_app.8 alpine:latest swarm02
123123
3o9nev8wwtu6 sleep_app.9 alpine:latest swarm01 Running Running 36 seconds ago
124124
```
125125

126-
5. Shrink the service
126+
### 5. Shrink the service
127127
Docker Swarm also allows running the inverse operation. The following example will reduce the number of replicas to 3.
128128
```
129129
snow@swarm01:~$ docker service update --replicas 3 sleep_app
@@ -136,7 +136,7 @@ zgmceedsgj3l sleep_app.1 alpine:latest swarm03
136136
n1f8t2scpaqo sleep_app.3 alpine:latest swarm02 Running Running 6 minutes ago
137137
f0leytx1fj3i sleep_app.4 alpine:latest swarm01 Running Running 6 minutes ago
138138
```
139-
6. Reschedule the containers after a node failure or node draining.
139+
### 6. Reschedule the containers after a node failure or node draining.
140140
The following section will illustrate what happen when a node is drained or faulty.
141141
Take a look at the status of your nodes again by running ``docker node ls``.
142142
```
@@ -187,8 +187,7 @@ n1f8t2scpaqo \_ sleep_app.3 alpine:latest swarm02
187187
wu8hj9j9e9uh sleep_app.4 alpine:latest swarm03 Running Running 2 minutes ago
188188
f0leytx1fj3i \_ sleep_app.4 alpine:latest swarm01 Shutdown Shutdown 2 minutes ago
189189
```
190-
191-
7. Cleaning Up
190+
### 7. Cleaning Up
192191
The following example will remove the service.
193192
```
194193
docker service rm sleep_app

0 commit comments

Comments
 (0)