2. Agenda
Why PaaS matters to developers
Overview of Cloud Foundry
Getting started with Cloud Foundry
Consuming Cloud Foundry services
2
3. Let’s imagine that you want to deploy an app...
Do you know how much hardware to buy?
Can you afford it?
How long does it take to approve, buy and install?
Who is going to set it up?
What happens if the traffic increases 10x?
Can we afford a test lab?
3
7. Benefits of IaaS
Agility
Pay per use
Elasticity
But you need to configure and maintain
the operating systems, the app servers and
the databases etc.
7
13. Cloud Foundry open PaaS - Choice of application services
vFabric
Postgres
Ap
p lica
Data
'o
Services
n
S
erv
ice
In
vFabric
ter
fac
RabbitMQTM Msg
e
Services
Other
Services
Additional partners
services …
14. Cloud Foundry open PaaS - Choice of clouds
d
Avoi n
Ap
p lica Lo ck-i
Data Private
'o
Services Clouds
n
S
erv
ice
In
e
fac
ter
ter
fac
Msg Public
r
In
e
Clouds
ide
Services
ov
Pr
ud
Cl o
Micro
Other Clouds
Services
16. Micro Cloud FoundryTM – Industry first downloadable PaaS
Micro Cloud Foundry
Runtimes & Frameworks
Services
Your Laptop/PC
Single VM instance of
Cloud Foundry
that runs on a developer’s
MAC or PC
16
17. CloudFoundry.ORG - Community open-source project
CloudFoundry.ORG
Your Infrastructure
Download Setup Deploy Behind
BOSH
Code Environment Firewall
Apache2 license
17
18. Cloud Foundry: you can trade-off effort vs flexibility
Less
Less
Public PaaS
....
.COM
Private PaaS
Effort .... Flexibility
Custom Private PaaS
git clone git://github.com/cloudfoundry/
More More
18
19. Cloud Foundry Resources
Primary Site : cloudfoundry.com
Open Source Site : cloudfoundry.org
Twitter : @cloudfoundry , hash tag #cfoundry
Blog : blog.cloudfoundry.com
FB : facebook.com/cloudfoundry
Support : support.cloudfoundry.com
• Documentation
• Knowledge Base
• Q & A / Forums
19
20. Agenda
Why PaaS matters to developers
Overview of Cloud Foundry
Getting started with Cloud Foundry
Consuming Cloud Foundry services
20
38. Recap so far…
Understand APaaS
Register for Cloud Foundry
Installed the Cloud Foundry Plugin
Logged In/Authenticated
Create a Spring MVC App
Deployed MVC App to Cloud Foundry
Hit URL from STS and Viewed MVC App
Learned about vmc
38
39. Agenda
Why PaaS matters to developers
Overview of Cloud Foundry
Getting started with Cloud Foundry
Consuming Cloud Foundry services
39
41. Creating a service instance
$ vmc create-service mysql --name mysql1
Creating Service: OK
$ vmc services
============== System Services ==============
+------------+---------+---------------------------------------+
| Service | Version | Description |
+------------+---------+---------------------------------------+
| mongodb | 1.8 | MongoDB NoSQL store |
| mysql | 5.1 | MySQL database service |
| postgresql | 9.0 | PostgreSQL database service (vFabric) |
| rabbitmq | 2.4 | RabbitMQ messaging service |
| redis | 2.2 | Redis key-value store service |
+------------+---------+---------------------------------------+
=========== Provisioned Services ============
+-------------+---------+
| Name | Service |
+-------------+---------+
| mysql1 | mysql |
+-------------+---------+
42. Binding a service to an application
$ vmc push cer-spring --path web/target/
Application Deployed URL [cer-spring.cloudfoundry.com]:
Detected a Java SpringSource Spring Application, is this correct? [Yn]:
Memory Reservation (64M, 128M, 256M, 512M, 1G) [512M]:
Creating Application: OK
Would you like to bind any services to 'cer-spring'? [yN]: y [yN]: y
Would you like
to bind any services to 'cer-spring'?
Would you like to use anan existing provisioned service? [yN]: y
Would you like
to use existing provisioned service? [yN]: y
The The following provisioned servicesavailable
following provisioned services are are available
1: mysql1
1: mysql1
2: mysql-135e0
2: mysql-135e0
Please select one you wish to use:use: 1
Please select one you wish to 1
Binding Service [mysql1]: OK OK
Binding Service [mysql1]:
Uploading Application:
Checking for available resources: OK
Processing resources: OK
Packing application: OK
Uploading (12K): OK
43. Binding a service to an application
$ vmc bind-service mysql1 myapp
Binding Service [mysql1]: OK
Stopping Application 'myapp': OK
Staging Application 'myapp': OK
Starting Application 'myapp': OK
$
46. Uses MySQL and MongoDB
@Entity
public class Customer { Stored in MySQL
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String firstName;
private String lastName;
Stored in Mongo
@RelatedDocument
private SurveyInfo surveyInfo;
public class SurveyInfo { public class Survey {
private List<Survey> questionsAndAnswers = new ArrayList<Survey>(); String question;
public List<Survey> getQuestionsAndAnswers() { String answer;
return questionsAndAnswers;
}
46
62. .js
Ap
p
Private
lica
Data
Services
Clouds
'o
e
fac
n
S
ter
erv
r
In
i
ce
ide
Public
In
ov
Msg Services
Clouds
ter
Pr
fac
ud
e
Cl o
Other
Micro
Services Clouds