A lightweight, composable PaaS



A lightweight, composable PaaS

0 0


distributed-matters-barcelona-2015

My talk for Distributed Matters Barcelona on the distributed systems that Deis relies upon.

On Github carmstrong / distributed-matters-barcelona-2015

A lightweight, composable PaaS

Chris Armstrong / @carmstrong_afk

Today's Goals

  • Introduce the Deis PaaS
  • Briefly cover etcd, fleet, Ceph
  • Touch on container schedulers
  • VP Engineering, Deis
  • Core maintainer
  • Author of Deis persistent storage

Deis, Inc.

  • Deis - Lightweight, composable Docker PaaS
  • Helm - The Package Manager for Kubernetes
  • All open-source
  • Leading Docker-based PaaS
  • Opinionated developer workflow
  • Go, Python & Shell
  • 100% open source

Philosophy

  • Focus on 12 Factor Apps
  • Release early, release often
  • Keep a stable developer workflow
  • Integrate with open source ecosystem

The Project

  • 1,200,000 downloads
  • ~5000 stars, ~800 forks
  • 2200+ Deis deployments daily
  • 15 full-time devs, 150+ contributors

Why PaaS?

Developer Self-Service

  • Create applications
  • Deploy code or Docker images
  • Configure runtime environment
  • Manage releases and rollbacks
  • Run admin commands
  • View aggregated logs
  • Scale via the process model
  • Collaborate with a team

Division of Responsibility

  • Developers own the containers
  • Operations own the platform

How does it work?

Deis is...

  • Lightweight
  • Customizable
  • Open-source
  • Highly-available
  • Persistent

Requirements

  • Shared config / service discovery
  • Survive host failure
  • Provide persistent storage for platform

How?

+

Distributed systems!

  • etcd (distributed key-value store)
  • fleet (distributed init)
  • Ceph (distributed storage)

etcd

  • Distrubted key-value store
  • Daemon runs on all CoreOS hosts
  • Raft for consensus

Writing

$ etcdctl set /message Hello
Hello
$ curl -L -X PUT http://127.0.0.1:2379/v2/keys/message -d value="Hello"
{"action":"set","node":{"key":"/message","value":"Hello","modifiedIndex":4,"createdIndex":4}}

Reading

$ etcdctl get /message
Hello
$ curl -L http://127.0.0.1:2379/v2/keys/message
{"action":"get","node":{"key":"/message","value":"Hello","modifiedIndex":4,"createdIndex":4}}

fleet

  • Cluster-aware systemd wrapper
  • Stores state in etcd
  • Services packed into unit definitions

deis-router

[Unit]
Description=deis-router

[Service]
EnvironmentFile=/etc/environment
TimeoutStartSec=20m
ExecStart=/bin/sh -c "IMAGE=`/run/deis/bin/get_image /deis/router` && docker run --name deis-router --rm -p 80:80 -p 2222:2222 -p 443:443 -p 9090:9090 -e EXTERNAL_PORT=80 -e HOST=$COREOS_PRIVATE_IPV4 $IMAGE"
ExecStop=-/usr/bin/docker stop deis-router
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target

[X-Fleet]
Conflicts=deis-router@*.service

Cluster units

$ fleetctl list-units
UNIT                            MACHINE                 ACTIVE          SUB
api_v28.web.1.service           15499c5f.../10.21.2.149 active          running
dashboard_v34.web.1.service     c98d2f7c.../10.21.1.230 active          running
deis-builder.service            15499c5f.../10.21.2.149 activating      start-post
deis-router@1.service           25992000.../10.21.1.229 active          running
deis-router@2.service           c98d2f7c.../10.21.1.230 active          running
deis-router@3.service           15499c5f.../10.21.2.149 active          running

Ceph

  • Distributed storage
  • Consumable as block device, blob API, or filesystem
  • Paxos consensus

deis-store

  • monitor
  • daemon
  • gateway
  • metadata
  • volume

All in containers!

FROM ubuntu:14.04
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -yq curl
RUN curl -sSL 'https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc' | apt-key add -
RUN echo "deb http://ceph.com/debian-firefly trusty main" > /etc/apt/sources.list.d/ceph.list
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -yq ceph

Why do we need a scheduler?

  • Workload placement
  • Resource management
  • Internal service discovery

Container Schedulers

  • CoreOS fleet
  • Apache Mesos
  • Docker Swarm
  • HashiCorp Nomad
  • Google Kubernetes

The Future

Kubernetes

  • lean: lightweight, simple, accessible
  • portable: public, private, hybrid, multi cloud
  • extensible: modular, pluggable, hookable, composable
  • self-healing: auto-placement, auto-restart, auto-replication

Deis 2.0

  • Certified workloads on Kubernetes
  • Components run indepdently
  • Still open-source!
  • Runs anywhere Kubernetes runs

You can help!

Today's Goals

  • Introduce the Deis PaaS
  • Briefly cover etcd, fleet, Ceph
  • Touch on container schedulers

...now go learn more!

Thanks!

  • twitter.com/carmstrong_afk
  • github.com/carmstrong
  • chris@deis.com