1. Introduction to Cloud Foundry
for Spring & Java Developers
Eric BOTTARD
Developer Advocate
@ebottard / ebottard@vmware.com
2. Eric Bottard
Developer Advocate • VMware
t@ebottard
Äericbottard
3. Cloud Stack - Classic Pyramid
Software
as a Service
Platform as a Service
Infrastructure as a Service
4. Cloud Foundry – The Open Platform as a Service
Target a choice of
deployment clouds
Provide a choice of Bind a choice of
development application
frameworks services
github.com/cloudfoundry
CONFIDENTIAL
6. Micro Cloud FoundryTM – Cloud on a Stick
Micro Cloud Foundry
Frameworks
Services
Your Laptop/PC
Single VM instance of
Cloud Foundry
that runs on a developer’s
MAC or PC
CONFIDENTIAL
7. CloudFoundry.ORG – Community Open Source Project
CloudFoundry.ORG
Community Frameworks Contributions
Community Services Contributions
Your Infrastructure
Download Setup Tool Chain & Deploy Behind
Code Environment Scripts Firewall
Cloud
Foundry
BOSH
Apache2
license
CONFIDENTIAL
9. Main Risk: Lock In
Welcome to the hotel california
Such a lovely place
Such a lovely face
Plenty of room at the hotel california
Any time of year, you can find it here
Last thing I remember, I was
Running for the door
I had to find the passage back
To the place I was before
’relax,’ said the night man,
We are programmed to receive.
You can checkout any time you like,
But you can never leave!
-the Eagles
CONFIDENTIAL
10. Cloud Foundry - Making Multi-Cloud a Reality
Private Cloud Management and Public Cloud
Distributions Deployment Operators
.COM
Bare metal
CONFIDENTIAL
11. Cloud Foundry: Clouds
§ AppFog.com
• community lead for PHP
• PaaS for PHP
§ Joyent
• community lead for Node.js
§ ActiveState
• community lead for Python, Perl
• Providers of Stackato private PaaS
CONFIDENTIAL
14. Auto-reconfiguration
§ Works for Spring, Node, Ruby
§ Spring: Uses a BeanFactoryPostProcessor
under the hood
• adds a jar to your app
• modifies web.xml to load the BFPP
• also adds correct jdbc driver jar
§ Only works if no ambiguity (80% of apps)
• One service of a kind
CONFIDENTIAL
15. Production Grade Cloud Foundry Clusters
§ 500 – 5,000 VMs cloudfoundry.com
§ 40+ unique node types
§ 75+ unique software packages
§ 75+ unique environments
§ 2x/week cf.com updates
§ 24x7x365 non-stop operation
§ No-downtime deployments
§ Reliable, robust, repeatable
deployments, updates, capacity
adjustments
§ Small teams manage many
production, staging, stress, qa, dev
instances
Google style problem è Google style solution
CONFIDENTIAL
16. Cloud Foundry BOSH
§ Cloud Foundry BOSH is an open source tool-chain for release
engineering, deployment, and lifecycle management of large scale
distributed services
• Prescriptive way of creating releases and managing systems and services
• It is not a collection of shell scripts, not a pile of Perl
§ Built to deploy and manage production-class, large scale clusters
• Production grade Cloud Foundry clusters: 500+ VMs, 40+ jobs, 75+ packages
• Multi-node, multi-tier, complex clusters: e.g., our Gerrit/Jenkins Cluster
§ Built for devops usage and scale by a crack team of veterans
• A project, not a product: command line interface, YAML, etc.
• Continuous improvement, iterative development, rough edges
github.com/cloudfoundry/bosh
CONFIDENTIAL
17. Key Takeaways
§ PaaS is the application platform for the Cloud era
§ Cloud Foundry is the Industry’s Open PaaS
• Developer agility
• Portability without changes
• Open system
§ What’s next?
• Free Signup: www.cloudfoundry.com (use “cloudtoday” as a promocode)
• Get started: docs.cloudfoundry.com/getting-started.html
• Learn more on the blog: blog.cloudfoundry.com
• Download your Micro Cloud Foundry: my.cloudfoundry.com/micro
• Get the source code: www.cloudfoundry.org
• Follow us: @cloudfoundry
• Watch us: www.youtube.com/cloudfoundry
CONFIDENTIAL
55. vmc tunnel (caldecott)
$ vmc tunnel
1: foobar-mq
2: foobar-pg
3: postgresql-handson-cf
Which service instance?> 3
1: none
2: psql
Which client would you like to start?> 2
Opening tunnel on port 10000...
61. Main Risk: Lock In
Welcome to the hotel california
Such a lovely place
Such a lovely face
Plenty of room at the hotel california
Any time of year, you can find it here
Last thing I remember, I was
Running for the door
I had to find the passage back
To the place I was before
’relax,’ said the night man,
We are programmed to receive.
You can checkout any time you like,
But you can never leave!
-the Eagles
74. One app, Many deploys
of
ONE set
les
deliverab
Code Build
Deployment
Config
75. One app, Many deploys
of
ONE set
les
deliverab
Code Build
Deployment
Config
ploys
MANY de
76. “ Environment Variables [...] unlike custom config
files, or other config mechanisms such as Java
System Properties, are a language- and OS-
agnostic standard
The Twelve Factor App, http://www.12factor.net
78. Do your current apps look like this?
Tomcat
.war
Browser Apache MySQL
79.
80. “ SOA is like Adam Sandler’s career:
Do one thing, and do it well.
Rob Spectre, Developer Evangelism,
Twilio
81. Another way to look at it
cut -d" " -f1 < access.log | sort | uniq -c | sort -rn | less
82. Chances are they will soon look like this..
Tomcat
search.
war
Desktop
Browser
Tomcat
Native users.
Node.js Message Bus war Mongo
Mobile
Front End e.g. RabbitMQ
App
HTML5
Mobile
App
Tomcat
orders.
war MySQL
105. Write your own logic
Use system-level metrics
http://www.sxc.hu/photo/1128191
106. Write your own logic
Use system-level metrics
$vmc stats myapp
instance #0
cpu 0.0% of 2 cores
memory 191.6M of 512M
disk 15.0M of 2G
http://www.sxc.hu/photo/1128191
107. Write your own logic
Use system-level metrics
$vmc stats myapp
instance #0
cpu 0.0% of 2 cores
memory 191.6M of 512M
disk 15.0M of 2G
as well as
business-related
info
http://www.sxc.hu/photo/1128191
114. Blue/Green Deployment
$vmc app awesome
awesome: running
platform: spring on java
usage: 512M × 1 instance
urls: awesome.cloudfoundry.com
services: postgresql-db
Version N Version N
Users LB / Proxy
116. Blue/Green Deployment
$vmc push --name awesome_v2
--url awesome_secret.cloudfoundry.com
Version N Version N
Users LB / Proxy
117. Blue/Green Deployment
$vmc push --name awesome_v2
--url awesome_secret.cloudfoundry.com
Version N Version N
Users LB / Proxy
Version N+1 Version N+1
119. Blue/Green Deployment
$vmc unmpap awesome awesome.cloudfoundry.com
$vmc map awesome_v2 awesome.cloudfoundry.com
Version N Version N
Users LB / Proxy
Version N+1 Version N+1
120. Blue/Green Deployment
$vmc unmpap awesome awesome.cloudfoundry.com
$vmc map awesome_v2 awesome.cloudfoundry.com
Version N Version N
Users LB / Proxy
Version N+1 Version N+1
121. Blue/Green Deployment
$vmc unmpap awesome awesome.cloudfoundry.com
$vmc map awesome_v2 awesome.cloudfoundry.com
Version N Version N
Users LB / Proxy
Version N+1 Version N+1
133. Limit your Http Traffic
There is no File System
Strive for Statelessness
Automate your DB Migrations
Avoid Vendor Lock-in
Treat all envs as Identical
It’s all about Loose Coupling
Use Frequent Deployments
Targeted and Custom Scaling
Upgrade with Zero Downtime
134. Thank You
Eric Bottard
Developer Advocate • VMware
t@ebottard
Äericbottard
ebottard@vmware.com