42
Lattice 08/22/2015 Etourneau Gwenn @The_shinji62 Run containerized workload

Lattice yapc-slideshare

Embed Size (px)

Citation preview

Page 1: Lattice yapc-slideshare

Lattice

08/22/2015Etourneau Gwenn

@The_shinji62

Run containerized workload

Page 2: Lattice yapc-slideshare

About meEtourneau Gwenn

Sr Solution Architect

Bef.: Platform Architect

https://github.com/shinji62

https://twitter.com/the_shinji62

Page 3: Lattice yapc-slideshare

Pivotal

• Spring Framework• RabbitMQ

• CloudFoundry• Pivotal Tracker

Page 4: Lattice yapc-slideshare

Agenda• Born from Cloufoundry• Why Lattice ?• Easy, clustered, Scheduling, Self Healing, LB, Logs• Usage• X-Ray• Demo• Q&A

Page 5: Lattice yapc-slideshare

Born from Cloudfoundry

• Truly OpenSource Platform as a Service• Aim to be de-facto enteprise PaaS• Huge community• Authentification, Service, High Availability …• Support Buildpack and Docker as well

Page 6: Lattice yapc-slideshare

cf push

Application deployed

Deploying to Cloudfoundry

Page 7: Lattice yapc-slideshare

CF Architecture (80% ..)

Page 8: Lattice yapc-slideshare

Lattice Architecture

DIEGO

Page 9: Lattice yapc-slideshare

Cloudfoundry

Page 10: Lattice yapc-slideshare

Lattice

Page 11: Lattice yapc-slideshare

Why LatticeCloudfoundry is “hard” to install

Focused for local development

Easy to use and install

Be able to run Docker and Buildpack and your own workload

Suitable for micro-service architecture

http://lattice.cf

Page 12: Lattice yapc-slideshare

Why not LatticeProduction workload, use Cloudfoundry

Persistent data

Strong security policies

Page 13: Lattice yapc-slideshare

Other solutions • DIY do it yourself

• Docker

• Kubernetes / Docker

Page 14: Lattice yapc-slideshare

Easy

vagrant up

Local deployment

Page 15: Lattice yapc-slideshare

Clustered

terraform apply

Terraform

Public / Private cloud

Page 16: Lattice yapc-slideshare

Diego Distribution across the clusterAuction system

Scheduling

Page 17: Lattice yapc-slideshare

Long Running Process

TaskA Task is guaranteed to be run at most once

LRP may have multiple instances.

Diego is a state machine maintaining the desiredLRP vs actualLRP

Diego attempts to keep the correct number of instances running in the face of network failures and crashes.

Page 18: Lattice yapc-slideshare

Task

One off task CronDatabase migration ‘rake db::migrate’

Page 19: Lattice yapc-slideshare

Long Running Process

WebsiteWorkerDatabase / Key-Value store

Page 20: Lattice yapc-slideshare

Based on :

• Memory • Disk Space• Number of Running container• Number of the same running application instance…

Lowest score win the bids

Scheduling

Page 21: Lattice yapc-slideshare

Auctioneer

RepExec

RepExec

RepExec

Auction system

RepExec

Scheduling0 5

2 4

Cell

Page 22: Lattice yapc-slideshare

Auctioneer

RepExec

RepExec

RepExec

Auction system

RepExec

Scheduling2 3

4 5

Page 23: Lattice yapc-slideshare

Scheduling

Auctioneer

RepExec

RepExec

RepExec

Auction system

RepExec

4 3

3 4

Page 24: Lattice yapc-slideshare

Auctioneer

RepExec

RepExec

RepExec

Auction system

RepExec

Scheduling

Page 25: Lattice yapc-slideshare

Self Healing State machine !

Desired state VS Actual state

Page 26: Lattice yapc-slideshare

RepExec

RepExec

RepExec

RepExec

Desired state 6Actual state 6

0

Self Healing

Page 27: Lattice yapc-slideshare

RepExec

RepExec

RepExec

RepExec

Desired state 6Actual state 3

-3

Self Healing

Page 28: Lattice yapc-slideshare

RepExec

RepExec

RepExec

RepExec

Desired state 6Actual state 6

0

Self Healing

Page 29: Lattice yapc-slideshare

RepExec

Load Balancing

RepExec

Router

10.10.2.1:2343

10.10.2.1:7643

10.10.2.2:7433

10.10.2.2:4324

http://myapp.mydomain.com

Page 30: Lattice yapc-slideshare

RepExec

Log Stream & Aggregation

RepExecRepExecRepExecdoppler

LogAggregation

Page 31: Lattice yapc-slideshare

Usage*

* basic one

Page 32: Lattice yapc-slideshare

Deploy docker image

ltc create yourappname myrepos/mydockerimage

Scale your appltc scale yourappname 15

• memory, instance, disk limit

Page 33: Lattice yapc-slideshare

Buildpack ltc create-droplet my-droplet-name phpbuildpack1- Create droplet (Task)

2- Launch droplet(LRP)ltc launch-droplet my-app-name my-droplet-name

Page 34: Lattice yapc-slideshare

Own workload ltc submit-lrp lrp.json1- Submit LRP (LRP)

{memory: 128mb,

rootfs: “docker:///cloudfoundry/lucid64”,

setup: <download-application>

action: “<run-startcommand>”}

https://github.com/cloudfoundry-incubator/receptor/doc/lrps.md

Page 35: Lattice yapc-slideshare

Routing (Http)

ltc update-route my-app-name 8080:my-apiUpdate route (LRP)

my-app-name.mydomain.comBy default

my-api.mydomain.com

Page 36: Lattice yapc-slideshare

Logs ltc logs my-app-name

Page 37: Lattice yapc-slideshare

X-Ray http://x-ray.cf

Page 38: Lattice yapc-slideshare

X-Ray Visualize application instance distribution

Start / Stop and crash event

By memory or container

OpenSource

Page 39: Lattice yapc-slideshare

X-Ray

Page 40: Lattice yapc-slideshare

Thank You !!

Page 41: Lattice yapc-slideshare

References

Page 42: Lattice yapc-slideshare

Lattice homepage http://lattice.cf/

ReferencesGithub https://github.com/cloudfoundry-incubator/latticeOthers https://github.com/cloudfoundry-incubator/diego-design-notes https://www.cloudfoundry.org/