lattice yapc-slideshare
TRANSCRIPT
Lattice
08/22/2015Etourneau Gwenn
@The_shinji62
Run containerized workload
About meEtourneau Gwenn
Sr Solution Architect
Bef.: Platform Architect
https://github.com/shinji62
https://twitter.com/the_shinji62
Pivotal
• Spring Framework• RabbitMQ
• CloudFoundry• Pivotal Tracker
Agenda• Born from Cloufoundry• Why Lattice ?• Easy, clustered, Scheduling, Self Healing, LB, Logs• Usage• X-Ray• Demo• Q&A
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
cf push
Application deployed
Deploying to Cloudfoundry
CF Architecture (80% ..)
Lattice Architecture
DIEGO
Cloudfoundry
Lattice
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
Why not LatticeProduction workload, use Cloudfoundry
Persistent data
Strong security policies
Other solutions • DIY do it yourself
• Docker
• Kubernetes / Docker
Easy
vagrant up
Local deployment
Clustered
terraform apply
Terraform
Public / Private cloud
Diego Distribution across the clusterAuction system
Scheduling
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.
Task
One off task CronDatabase migration ‘rake db::migrate’
Long Running Process
WebsiteWorkerDatabase / Key-Value store
Based on :
• Memory • Disk Space• Number of Running container• Number of the same running application instance…
Lowest score win the bids
Scheduling
Auctioneer
RepExec
RepExec
RepExec
Auction system
RepExec
Scheduling0 5
2 4
Cell
Auctioneer
RepExec
RepExec
RepExec
Auction system
RepExec
Scheduling2 3
4 5
Scheduling
Auctioneer
RepExec
RepExec
RepExec
Auction system
RepExec
4 3
3 4
Auctioneer
RepExec
RepExec
RepExec
Auction system
RepExec
Scheduling
Self Healing State machine !
Desired state VS Actual state
RepExec
RepExec
RepExec
RepExec
Desired state 6Actual state 6
0
Self Healing
RepExec
RepExec
RepExec
RepExec
Desired state 6Actual state 3
-3
Self Healing
RepExec
RepExec
RepExec
RepExec
Desired state 6Actual state 6
0
Self Healing
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
RepExec
Log Stream & Aggregation
RepExecRepExecRepExecdoppler
LogAggregation
Usage*
* basic one
Deploy docker image
ltc create yourappname myrepos/mydockerimage
Scale your appltc scale yourappname 15
• memory, instance, disk limit
Buildpack ltc create-droplet my-droplet-name phpbuildpack1- Create droplet (Task)
2- Launch droplet(LRP)ltc launch-droplet my-app-name my-droplet-name
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
Routing (Http)
ltc update-route my-app-name 8080:my-apiUpdate route (LRP)
my-app-name.mydomain.comBy default
my-api.mydomain.com
Logs ltc logs my-app-name
X-Ray Visualize application instance distribution
Start / Stop and crash event
By memory or container
OpenSource
X-Ray
Thank You !!
References
Lattice homepage http://lattice.cf/
ReferencesGithub https://github.com/cloudfoundry-incubator/latticeOthers https://github.com/cloudfoundry-incubator/diego-design-notes https://www.cloudfoundry.org/