ceph, docker, heroku slugs, coreos and deis overview

29
Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview lorieri Nov/2014 @againstty0

Upload: leo-lorieri

Post on 02-Jul-2015

1.207 views

Category:

Software


5 download

DESCRIPTION

Ceph, Docker, Heroku Slugs, CoreOS and Deis simple overview for my colleagues

TRANSCRIPT

Page 1: Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview

Ceph, Docker, Heroku Slugs,CoreOS and Deis Overview

lorieri Nov/2014 @againstty0

Page 2: Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview

Welcometothefuture

Page 3: Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview

“Ceph's main goals are to be completely distributed without a single point of failure, scalable to the exabyte level, and freely-

available”

Page 4: Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview

● 100% distributed

● CephFS○ For POSIX sharing○ not really 100% (active-standby)

● LibRados

○ RBD■ For Blocks

○ Rados Gateway■ For REST Objects■ S3 and Swift compatible

Page 5: Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
Page 6: Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview

CephFS

Page 7: Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview

“Build, Ship and RunAny App, Anywhere”

Page 8: Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview

● 100% portable● Easy API for LXC● Public Repository● Lightweight, 1 process (ideal)● Layers (Union File System)

○ Shares read-only data○ Incremental

● Volumes (not layered volumes)

Page 9: Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview

● We will only talk about slugs○ (and twelve-factor later)

“A slug is a bundle of your source,fetched dependencies, the language

runtime, and compiled/generated outputof the build system - ready for execution.”

Page 10: Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview

Your App

Git

Buildpacks Repo

$ git push

Builder

Code

Runtime

Slug

Page 11: Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview

“Linux for Massive Server Deployments

CoreOS enables warehouse-scale computing on top of a minimal, modern

operating system.”

Page 12: Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview

● 100% distributed● Lightweight● cloud-init for every boot● Automatic Updates

○ 2 boot partitions

Page 13: Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview

Etcd

Node 1 Node 2 Node 3 Node 4 Node 5 Node 6 Node 7

Locksmithd ConfdFleet

Systemd Systemd Systemd Systemd Systemd Systemd Systemd

Page 14: Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview

Distributed database

Node 1 Node 2 Node 3 Node 4 Node 5 Node 6 Node 7

Reboot Admin Configuration ManagerDistributed Init

New Init New Init New Init New Init New Init New Init New Init

Page 15: Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
Page 16: Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview

● Fleet

DistributedServices

Page 17: Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview

“Your PaaS. Your Rules.

An open source PaaS that makes it easy to deploy and manage applications on your

own servers. Deis builds upon Docker and CoreOS to provide a lightweight PaaS

with a Heroku-inspired workflow.”

Page 18: Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
Page 19: Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview

● CoresOS + Docker + Ceph + Heroku● Twelve-Factor

○ for Deis: must be stateless (no wordpress)● Nginx Router + Wildcard DNS● First release using Ceph

○ more features coming soon● Limited

○ twelve-factor○ only HTTP port (non-http soon)○ must expose ONLY one port

Page 20: Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview

● Installation:○ Install CoreOS and ssh keys then:

$ export DEISCTL_TUNNEL=coreos01

$ curl -sSL http://deis.io/deisctl/install.sh | sh

$ git clone https://github.com/deis/deis.git ; cd deis

$ deisctl config platform set \

domain=mylocalpaas.com

$ deisctl install platform && deisctl start platform

Page 21: Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview

Installation will set the domain inthe distributed database (Etcd)

then load and run the“init” files (Fleet+Systemd)

into the cluster

Everything else happens by the help of twelve-factor

Page 22: Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview

● Install client * at deis git directory

$ pip install ./client/

$ deis register http://mylocalpaas.com

$ deis keys:add

Page 23: Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview

● Create a Docker App

# write some “code”

$ mkdir ~/myapp ; cd ~/myapp

$ git init

$ echo "Hello" > index.html

# create the Dockerfile

$ echo 'FROM myregistry/my-tiny-nginx

ADD ./index.html /usr/share/nginx/www/index.html

EXPOSE 80

ENTRYPOINT ["/usr/sbin/nginx"]

CMD ["-c","/etc/nginx/nginx.conf","-p","/etc/nginx","-g","daemon off;"]' \

> Dockerfile

# create the app

$ git commit -a -m "initial"

$ deis create myapp

Page 24: Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview

● Deploy it

$ git push deis master

-----> Building Docker image

-----> Pushing image to private registry

-----> Launching...

done, myapp:v1 deployed to Deis

http://myapp.mylocalpaas.com

$ curl http://myapp.mylocalpaas.com

Hello

Page 25: Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview

● Scale it

$ deis scale cmd=5

Scaling processes... but first, coffee!

..o

done in 25s

=== myapp Processes

--- cmd:

cmd.1 up (v13)

cmd.2 up (v13)

cmd.3 up (v13)

cmd.4 up (v13)

cmd.5 up (v13)

Page 26: Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview

● Deploy a Heroku App

Available Buildpacks:

● Ruby● Nodejs● Java● Gradle● Grails● Play● Python● Clojure● PHP● Go● Meteorite● Perl● Scala● Dart● Nginx● Apache

Page 27: Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview

● Create it $ git clone https://github.com/deis/example-ruby-sinatra.git

$ cd example-ruby-sinatra

$ deis create myappheroku

Creating application... done, created myappheroku

Git remote deis added

Page 28: Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview

● Deploy it

(suppressed output)

$ git push deis master

-----> Ruby app detected

-----> Compiling Ruby/Rack

-----> Installing dependencies using 1.5.2

Using bundler (1.5.2)

Installing tilt (1.3.6)

Installing rack (1.5.2)

Installing rack-protection (1.5.0)

Installing sinatra (1.4.2)

Your bundle is complete!

-----> Compiled slug size is 12M

-----> Building Docker image

-----> Pushing image to private registry

-----> myappheroku deployed to Deis

http://myappheroku.mylocalpaas.com

$ curl -s http://myappheroku.mylocalpaas.com

Powered by Deis!

Page 29: Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview

Thanks!

lorieri@againstty0