Orchestration Flashcards
create docker swarm
docker swarm init –advertise-addr IPADDRESS
add swarm worker
docker join-token worker
add swarm manager
docker join-token manager
create a service on a swarm
docker service create –replicas 1 –name helloworld ping docker.com
how do you specify replicas for a swarm
–replicas
what is a quorum
the majority of managers
what is the difference between running a container and a service
a docker service can be run on multiple containers
how to view low level information of a container
docker inspect
how to template docker inspect to simplifiy inspection
docker inspect –format
i.e docker inspect nginx -f {{.NetworkSettings.Ports}}
what is docker-compose
docker compose allows us to create multiple containers
reminder: practice making docker-compose.yml file
What is orchestration
moving and scaling containers accross clouds and data centers. automating maintenance, replacing of failed containers, managing rollout
how do you increase the number of replicas
docker service scale name-of-service=number
eg docker service scale myService=6
how do you publish ports for a service
-p or –publish tags when creating a service :
docker service update –publish-add published=8080,target=80
docker service update –publish-rm
published=8080,target=80
add a network to a service
–network tag on create
docker service update –network-add
docker service update –network-rm
describe and demonstrate how to run replicated and global services.
replicated by default
global mode: –mode global