Changes

Docker Swarm Mode

658 bytes added, 08:17, 29 July 2018
Swarm stack készítése
replicas: 5
placement:
constraints: [ - node.role == worker] - node.labels.loadbalancer != true
update_config:
delay: 2s
<pre>
# docker stack ps helloservice
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTShi98iuw4c46g ygigsppmqp1j helloservice_helloworld.1 tutum/hello-world:latest worker0 Running Running 3 minutes about a minute ago 1wv6qfznyhx4 kv5lvg2g79jn helloservice_helloworld.2 tutum/hello-world:latest worker0 worker1 Running Running 3 minutes 59 seconds ago ngzajs7ktp1z gc1yqgshnhw3 helloservice_helloworld.3 tutum/hello-world:latest worker1 worker2 Running Running 3 minutes 59 seconds ago uryp9wlz97t9 rgoc8uzt354v helloservice_helloworld.4 tutum/hello-world:latest worker2 worker1 Running Running 3 minutes 59 seconds ago gucdjewjagr2 sofw5w45qyco helloservice_helloworld.5 tutum/hello-world:latest loadbalancer worker2 Running Running 3 minutes 59 seconds ago
</pre>
Látható, hogy ahogy kértük, csak worker node-ra telepítette a szolgáltatást, és a loadbalancer nevű node-ra nem rakott egy konténert sem.
 
 
<pre>
# docker service ls
ID NAME MODE REPLICAS IMAGE PORTS
w31aon1cwm34 helloservice_helloworld replicated 5/5 tutum/hello-world:latest *:30004->80/tcp
04cj4vdsu0qu loadbalancer replicated 1/1 traefik:latest *:80->80/tcp, *:8080->8080/tcp
</pre>