ceph, docker, heroku slugs, coreos and deis overview

Post on 02-Jul-2015

1.208 Views

Category:

Software

5 Downloads

Preview:

Click to see full reader

DESCRIPTION

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

TRANSCRIPT

Ceph, Docker, Heroku Slugs,CoreOS and Deis Overview

lorieri Nov/2014 @againstty0

Welcometothefuture

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

available”

● 100% distributed

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

● LibRados

○ RBD■ For Blocks

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

CephFS

“Build, Ship and RunAny App, Anywhere”

● 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)

● 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.”

Your App

Git

Buildpacks Repo

$ git push

Builder

Code

Runtime

Slug

“Linux for Massive Server Deployments

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

operating system.”

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

○ 2 boot partitions

Etcd

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

Locksmithd ConfdFleet

Systemd Systemd Systemd Systemd Systemd Systemd Systemd

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

● Fleet

DistributedServices

“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.”

● 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

● 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

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

● Install client * at deis git directory

$ pip install ./client/

$ deis register http://mylocalpaas.com

$ deis keys:add

● 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

● 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

● 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)

● Deploy a Heroku App

Available Buildpacks:

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

● 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

● 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!

Thanks!

lorieri@againstty0

top related