Upgrade to Pro — share decks privately, control downloads, hide ads and more …

A million containers isn't cool

A million containers isn't cool

You know what's cool? A hundred containers.

A lot of us ship software multiple times a day—but what goes into that, and how do we make it happen reliably?

In this talk, we'll look at the deployment of a typical web app/API. We'll focus on build artifacts - the things we actually ship to production - and why it's helpful to make their build and deployment processes consistent.

From there, we'll move on to containers—Docker in particular—with with a focus on container images and how they can get us to that goal.

We'll deliberately sidestep the world of distributed schedulers—Mesos, Kubernetes, and friends. They're great tools when you need to manage a growing fleet of computers, but running them doesn't come without an operational cost.

By following the example of a production system that's built this way—containerised apps without a distributed scheduler—we'll explore what it takes to move apps into containers, and how doing so might shape your infrastructure.

To wrap up, we'll look at some alternatives that could serve you well if Docker isn't the right fit for your organisation.

Chris Sinjakli

March 13, 2017
Tweet

More Decks by Chris Sinjakli

Other Decks in Programming

Transcript

  1. On each server: - Clone source - Build dependencies -

    Run schema migrations - Build static assets
  2. On each server: - Clone source - Build dependencies -

    Run schema migrations - Build static assets - SIGHUP
  3. On each server: - Clone source - Build dependencies -

    Run schema migrations - Build static assets - SIGHUP
  4. On each server: - Clone source - Build dependencies -

    Run schema migrations - Build static assets - SIGHUP Hope
  5. On each server: - Clone source - Build dependencies -

    Run schema migrations - Build static assets - SIGHUP Hope
  6. On each server: - Clone source - Build dependencies -

    Run schema migrations - Build static assets - SIGHUP Hope Hope
  7. On each server: - Clone source - Build dependencies -

    Run schema migrations - Build static assets - SIGHUP Hope Hope Hope
  8. A service: — an image — environment config — command

    to run — limits (memory, CPU) — …
  9. Chef Service A Service C Service B Compute 1 Service

    A Service B Compute 2 Compute 3 config
  10. Chef Service A Service C Service B Compute 1 Service

    A Service B Compute 2 Service B Service C Compute 3 config
  11. Chef Service A Service C Service B Compute 1 Service

    A Service B Compute 2 Service B Service C Compute 3 Service A Service C config
  12. Chef Service A Service C Service B Compute 1 Service

    A Service B Compute 2 Service B Service C Compute 3 Service A Service C
  13. The flow: — start containers for new version — wait

    for health check — rewrite local nginx config
  14. The flow: — start containers for new version — wait

    for health check — rewrite local nginx config — reload nginx
  15. The flow: — start containers for new version — wait

    for health check — rewrite local nginx config — reload nginx — stop old containers
  16. # Clean up expired API tokens */30 * * *

    * scripts/cleanup-api-tokens
  17. # Clean up expired API tokens */30 * * *

    * /usr/local/bin/conductor run --id gocardless_cron_production --revision 279d903588 scripts/cleanup-api-tokens
  18. $

  19. Specifically: — check number of containers — health check each

    container — restart if either fails — at most every 5 seconds
  20. $

  21. To fit our usage: — Conductor generates systemd config —

    systemd manages processes — Delete conductor supervise
  22. To fit our usage: — Conductor generates systemd config —

    systemd manages processes — Delete conductor supervise — HTTP health checks???