Docker Swarm Mode

large h trans

Docker Meetup Hamburg · September 13th, 2016


tgbyte bk
Thilo-Alexander Ginkel · TG Byte Software GmbH
thilo.ginkel@tgbyte.de · www.tgbyte.de

About us

TG Byte Software GmbH

  • Founded in 1998, located in Hamburg

  • Service Range

    • Software Development & Consulting

    • DevOps

    • Training & Coaching

  • Looking for freelancers to support us with various projects

Thilo-Alexander Ginkel

  • Passionate Software Engineer, IT Consultant & Trainer

  • Focus

    • Software Development & Architecture

    • DevOps

    • Troubleshooting

  • Software Development since 1994

Docker Swarm Mode

Docker Swarm Mode

  • Cluster management integrated with Docker Engine

    • Accessible via the regular Docker CLI

  • Built on top of SwarmKit (using Raft Consensus Algorithm)

    • Self-organizing (no dedicated cluster coordinator required)

  • New "service" concept as an abstraction on top of containers

  • Multi-host overlay networking

  • Service Discovery via DNS

  • Introduced in Docker 1.12

  • Not to be confused with the standalone Docker Swarm product

Docker Swarm Mode

Services

swarm diagram

Docker Swarm Mode

New HEALTHCHECK Directive

  • Enables Docker Engine to assess the health state of a container

  • Exit code indicates success (exit code 0) or failure (exit code 1)

  • Enables Docker Swarm Mode to direct inbound traffic only to healthy containers

  • Example

HEALTHCHECK --interval=15s --timeout=5s CMD curl --fail \
  http://localhost:2368/ || exit 1

Demo

Demo

Setup

  • Stateful web application

    • "Ghost" blogging platform

    • MySQL database

  • Three nodes on Google Compute Engine

    • Running Docker 1.12.1 in Swarm Mode

  • Google Cloud load balancing for HTTPS termination and (pseudo-)HA

Demo

arch

Wrap-up & Outlook

Questions?

Thank you!

Image Credits