Slide 1

Slide 1 text

BRET FISHER Docker Captain, DevOps Dude, Author of Docker Mastery Building Your Docker Tech Stack bretfisher.com/dockercon18 @bretfisher

Slide 2

Slide 2 text

People ask "Where's my LAMP for container clusters?" Your solutions will be a "stack" of infrastructure tools Cloud-native container tools are new We need patterns and examples of full cluster stacks Problem: No Server Tool Lives In Isolation

Slide 3

Slide 3 text

Build examples of full-er/ish stacks on different tools Options for solo to medium-sized DevOps/Ops teams Use Docker Swarm latest stable as orchestrator Avoid cloud vendor lock-in* 4 Goals for Today * Lock-in: A service I can't swap out in my server stack

Slide 4

Slide 4 text

Limit "going production Docker" project scope. Go Lean! Focus first on quality Dockerfiles Stay on your familiar host OS with 4.x Kernel Use base images of familiar OS (keep same pkg mgr) Swarm CE can be 1 or more nodes, use it everywhere Swarm EE is your "easy button" for security and ops Last Time On Bret's DockerCon Talk

Slide 5

Slide 5 text

Two Stacks, Same Core Docker CE Swarm Used for Dev/Test Heavy use of OSS/free Gluttony of choice for 3rd party Newest engine features Docker EE Swarm Used for Staging/Prod Heavy use of paid support Use Docker Solution Briefs Mature engine with hotfixes + +

Slide 6

Slide 6 text

Clusters are Complex Start small and simple, grow them as you grow

Slide 7

Slide 7 text

EE Platform Architecture Physical Virtualization Public Cloud Platform Security Developer Services Registry Services Access Policies App Lifecycle Management Automation & Extensibility Networking Orchestration Storage Container Engine ENTERPRISE EDITION PLATFORM

Slide 8

Slide 8 text

CE Platform Architecture Public Cloud Overlay Swarm Container Engine COMMUNITY EDITION PLATFORM Physical Virtualization Platform Security

Slide 9

Slide 9 text

v Sci-Fi, Am I Right!

Slide 10

Slide 10 text

v Epic Battle Royale, on Swarm dogvs.cat VS

Slide 11

Slide 11 text

v Epic Battle Royale, on Swarm dogvs.cat Sci-Fi Sounds Edition

Slide 12

Slide 12 text

dogvs.cat App Services www.dogvs.cat vote.dogvs.cat blog.dogvs.cat result.dogvs.cat (Stack Files)

Slide 13

Slide 13 text

dogvs.cat Swarm CE, (Han) Solo Sysadmin or

Slide 14

Slide 14 text

Cloud agnostic, minimal infra Apps auto-recover on node fail Incoming TLS Centralized logging Centralized monitoring Healthcheck all containers Infra Requirements of dogvs.cat Performance auto-scaling Self-healing nodes Support serverless functions Services highly available Han Solo Requirements Optional Requirements for Later

Slide 15

Slide 15 text

Simple Infrastructure, Easy Deployment "How can I deploy a multi-tier app on a few servers, with all the bells and whistles of orchestration with load balancing and auto recovery?" Han Solo, The Sysadmin

Slide 16

Slide 16 text

3+ Droplets (Ubuntu 16.04) Block Storage (Volumes) Load Balancer (incoming HTTP) Digital Ocean dogvs.cat Services Needed for High Availability

Slide 17

Slide 17 text

App Services www.dogvs.cat vote.dogvs.cat blog.dogvs.cat result.dogvs.cat

Slide 18

Slide 18 text

App Services + L7 Proxy www.dogvs.cat vote.dogvs.cat blog.dogvs.cat result.dogvs.cat

Slide 19

Slide 19 text

App Services + L7 Proxy + Overlay www.dogvs.cat vote.dogvs.cat blog.dogvs.cat result.dogvs.cat

Slide 20

Slide 20 text

App Services + L7 Proxy + Ops www.dogvs.cat vote.dogvs.cat blog.dogvs.cat result.dogvs.cat

Slide 21

Slide 21 text

Cluster + External Load Balancer www.dogvs.cat vote.dogvs.cat blog.dogvs.cat result.dogvs.cat

Slide 22

Slide 22 text

Open Source Stack Swarm GUI Portainer Central Monitoring Prometheus + Grafana Central Logging Elastic ELK Layer 7 Proxy Traefik + Let's Encrypt Storage REX-Ray + Digital Ocean Volumes Networking Docker Swarm Overlay Orchestration Docker Swarm Runtime Docker CE HW / OS Docker Machine + Digital Ocean

Slide 23

Slide 23 text

Deploy Nodes: Docker Machine ./create-servers.sh ./enable-monitoring.sh ./create-swarm.sh

Slide 24

Slide 24 text

Deploy Storage: RexRay Plug-in docker stack deploy -c stack-rexray.yml rexray

Slide 25

Slide 25 text

Deploy Proxy Stack: Traefik with Let's Encrypt docker network create --driver overlay proxy docker stack deploy -c stack-proxy.yml proxy http://www.dogvs.cat:8080/dashboard/

Slide 26

Slide 26 text

Deploy Ops Stacks: Prometheus + ELK + Portainer docker stack deploy -c stack-swarmprom.yml prom docker stack deploy -c stack-elk.yml elk docker stack deploy -c stack-portainer.yml portainer

Slide 27

Slide 27 text

Our Apps: Voting + Ghost + Static Site docker stack deploy -c stack-ghost.yml ghost docker stack deploy -c stack-voting.yml vote docker stack deploy -c stack-menu.yml menu

Slide 28

Slide 28 text

Deploy Stacks: Maintenance Tasks docker stack deploy -c stack-prune.yml prune backups (in stack file with app)

Slide 29

Slide 29 text

Day Two Operations: Updates stack deploy ∞ micromanage update_config and healthcheck tune your limits and reservations

Slide 30

Slide 30 text

Security? host setup scanning: Docker Bench image scanning: Aqua Microscanner behavior monitoring: Sysdig Falco user namespaces

Slide 31

Slide 31 text

Next Steps more nodes? make 'em workers CI/CD stacks: gitlab, jenkins make redis, mysql, psql HA add app metrics to Prometheus swap Overlay for Weave Net swap ELK for Papertrail, etc. swap Prometheus for Sysdig, Datadog, Librato, etc. add socat proxy to Traefik

Slide 32

Slide 32 text

Swarm EE, Amazonian DevOps dogvscat.biz or

Slide 33

Slide 33 text

Complex Infrastructure, Harder Deployment "How can I deploy many multi-tier app on a many servers, with all the b e l l s a n d w h i s t l e s o f H A orchestration, have load balancing at all levels, with failover and auto recovery?" Amazonian Team

Slide 34

Slide 34 text

CE Platform Architecture Physical Virtualization Public Cloud Platform Security Networking Orchestration Container Engine COMMUNITY EDITION PLATFORM

Slide 35

Slide 35 text

EE Platform Architecture Physical Virtualization Public Cloud Platform Security Developer Services Registry Services Access Policies App Lifecycle Management Automation & Extensibility Networking Orchestration Storage Container Engine ENTERPRISE EDITION PLATFORM

Slide 36

Slide 36 text

No More One Size Fits All Docker for AWS Docker for Azure

Slide 37

Slide 37 text

Docker Certified Infrastructure

Slide 38

Slide 38 text

v Reference Architecture Automation Tools Ecosystem Integration Docker Certified Infrastructure

Slide 39

Slide 39 text

DCI AWS

Slide 40

Slide 40 text

Docker EE on AWS Stack Swarm GUI Docker EE UCP Central Monitoring AWS Cloudwatch + Telegraph Central Logging AWS Cloudwatch Logs Registry Docker EE DTR Layer 7 Proxy HTTP Routing Mesh (Interlock+Nginx) Storage Docker Cloudstor EBS/EFS Networking Docker Swarm Overlay Orchestration Docker Swarm Runtime Docker EE HW / OS Terraform + Ansible + AWS

Slide 41

Slide 41 text

Deploy Nodes: Terraform + Ansible terraform apply ansible-playbook -i inventory install.yml

Slide 42

Slide 42 text

Advantages more flexible deployment tools more SecOps tools ops tools are fully HA ops tools are team-ready deploy to K8s just as easy

Slide 43

Slide 43 text

Deploy Apps docker stack deploy -c stack-ghost.yml ghost docker stack deploy -c stack-voting.yml vote docker stack deploy -c stack-menu.yml menu

Slide 44

Slide 44 text

Next Steps All the things in Swarm CE monitoring via CloudWatch and Telegraph logging via CloudWatch Logs

Slide 45

Slide 45 text

Summary Infrastructure as code, make everything repeatable No "special" nodes, use remote management Grow as you go, assume you'll resize Look for compose files of popular tools to make stacks Don't throw out the good in search of the perfect

Slide 46

Slide 46 text

I'd like to thank the internet

Slide 47

Slide 47 text

Support the open source you use

Slide 48

Slide 48 text

PLEASE VOTE SO I WIN ALL THE DOCKERS FRIDAY! Thanks! bretfisher.com/dockercon18 "Building Your Docker Tech Stack"