Ike Devolder


@BlackIkeEagle

DevOps / developer @ Studio Emma

Studio Emma


@studioemma

Magento Silver Solution Partner

Pimcore Gold Solution Partner

topics

  • our requirements
  • some history
  • docker swarm
  • demo time

and then there was

dockercon kubernetes
oh noo

topics

  • our requirements
  • some history
  • docker swarm
  • demo time

further improve software stack consistency

can be hosted by us

easy to manage

easy for deployment

topics

  • our requirements
  • some history
  • docker swarm
  • demo time
$ docker run -e MYSQL_ROOT_PASSWORD=toor -d \
    --name mysql mysql:5.7
$ docker run --link mysql -d \
    --name my-phpapp myphpapp:latest
$ docker run --link my-phpapp -d \
    -p 80:80 \
    --name my-nginx mynginx:latest
                        
great site
$ uptime
 20:04:33 up 16 min,  8 users,  load average: 0,63, 0,46, 0,34
                        
rebooted
down
fig
fix example
docker compose
 1 version: '3'
 2 services:
 3   redis:
 4     image: redis:alpine
 5   mysql:
 6     image: mysql
 7   mailcatcher:
 8     image: schickling/mailcatcher
 9   application:
10     image: dockerwest/php-pimcore:7.1
11     volumes:
12       - ../pimcore:/phpapp
13     links:
14       - mysql
15       - redis
16       - mailcatcher
17   nginx:
18     image: dockerwest/nginx-pimcore:stable
19     volumes:
20       - ../pimcore:/phpapp
21     links:
22       - application
better

topics

  • our requirements
  • some history
  • docker swarm
  • demo time

concepts

  • node
  • stack
  • service
  • task

setting up your own swarm

  • manager
  • worker
  • other?

choose our base

more traditional distributions

centos debian fedora ubuntu

more advanced or specific distributions

arch linux coreos alpine linux rancher

setup a swarm

Chosen base distribution:
alpine linux

system

$ apk add --update --no-cache docker
$ rc-update add docker default
                        

certificates

communication between client and server will be encrypted

client config

to communicate with our server(s) we have to setup some environment variables


export DOCKER_HOST=tcp://192.168.250.31:2375
export DOCKER_CERT_PATH=$(pwd)/client-cert
export DOCKER_TLS_VERIFY=1
                        

setup the swarm

# docker swarm init \
    --advertise-addr=[internal server ip]
# docker swarm join-token \
    -q worker
# docker swarm join \
    --token [worker token] \
    [internal master server ip]
                        

simple check swarm status

$ docker node ls
$ docker service ls
                        

docker service

create/manage a single service within a swarm

docker stack

create/manage an application stack within a swarm

deploying a simple stateless application

challenges encountered

  • create stateless images
  • create swarm configuration
  • registry? self hosted? docker hub?
  • what if I want to add more applications

What if I want more applications

Enter traefik
traefik

done
really

I like visual representation

visualizer

deploying pimcore, there is state, a database, ...

additional challenges

  • prepare your database
  • how to handle/store state
  • handle scheduled jobs

are we still missing something

  • central logging
  • metrics / alerting

topics

  • our requirements
  • some history
  • docker swarm
  • demo time

pimcore 5

pimcore

magento 2

magento

summarized

  • we can run php applications
  • we can see where what is running
  • we have some monitoring and alerting
  • we have central logging
mindblown

Questions?

https://joind.in/talk/05b5d

Ike Devolder

joindin qr

@BlackIkeEagle

DevOps / developer @ Studio Emma

PHP-WVL / Docker West / Arch Linux Trusted User

studioemma  php-wvl  docker west  arch linux

Thanks.

https://joind.in/talk/05b5d

Ike Devolder

joindin qr

@BlackIkeEagle

DevOps / developer @ Studio Emma

PHP-WVL / Docker West / Arch Linux Trusted User

studioemma  php-wvl  docker west  arch linux

Image credits

  • https://blenderartists.org/forum/showthread.php?343877-Fish-Swarm
  • https://giphy.com/search/oh-noo
  • https://giphy.com/search/panic
  • http://www.fig.sh/
  • https://giphy.com/search/better
  • https://traefik.io/
  • https://giphy.com/search/really
  • https://giphy.com/search/done