33
1 © 2013 Pivotal Software, Inc. All rights reserved Cloud Foundry Technical Overview By Pivotal

Cloud Foundry Technical Overview

Embed Size (px)

DESCRIPTION

This presentation covers both the Cloud Foundry Elastic Runtime (known by many as just "Cloud Foundry") as well as the Operations Manager (known by many as BOSH). For each, the main components are covered with interactions between them.

Citation preview

Page 1: Cloud Foundry Technical Overview

1 © 2013 Pivotal Software, Inc. All rights reserved

Cloud Foundry Technical Overview

By Pivotal

Page 2: Cloud Foundry Technical Overview

2

* An actual application provisioning/update flow in a large enterprise. Image is blurred for privacy reasons

Simplify Application Deployment, from: this…

Page 3: Cloud Foundry Technical Overview

3

To: Pushing apps to the cloud with a few easy verbs

target  <my  cloud>  push  <my  app>  create  <my  services>  bind  <my  services>  scale  <my  app>  +100  

Cloud  Deployment:    2-­‐4  hours App  Deployment:    30-­‐90  seconds

Developer Operator

cf-­‐iaas.yml  provision  <my  cloud>  add_capacity  <my  cloud>  

Page 4: Cloud Foundry Technical Overview

4

Overview: Deploying App to Cloud Foundry Runtime

Developer

①  Upload app bits and metadata

push app

Router  

②  Create and bind services

③  Stage application

④  Deploy application

⑤  Manage application health …which we will depict in a moment

Cloud  Foundry  Run.me  (PaaS)  

Blobstore DB

Cloud Controller Service Broker Node(s)

DEA DEA

DEA DEA

+ app MD

+ =

Service credentials app MD

Page 5: Cloud Foundry Technical Overview

5

Creating and Binding a Service Developer

Router  

Cloud  Foundry  Run.me  (PaaS)  

DB Service credentials

reserve resources create service (HTTP) create service (HTTP)

bind service (HTTP) bind service (HTTP) obtain connection data

CLI Cloud Controller

Service Broker

Data Service

Page 6: Cloud Foundry Technical Overview

6

Stage an Application Developer Ro

uter  

Cloud  Foundry  Run.me  (PaaS)  

Blobstore DB

DEA Detect Compile Upload

No

Yes

System Buildpacks

+ =

Cloud Controller

Page 7: Cloud Foundry Technical Overview

7

Deploying an Application Developer

Router  

Blobstore Cloud Controller

Messaging (NATS)

DEA DEA DEA Cloud  Foundry  Run.me  (PaaS)  

Access App

①  Deploy message

②  Droplet deployed

③  Routes registered

④  Port forwarding

① 

①  ① 

② 

③  ③ 

③ 

④ 

Page 8: Cloud Foundry Technical Overview

8

Router  

Monitoring and Replacing an Application Developer

Blobstore Cloud Controller Health Manager

Actual State Desired State

Messaging (NATS)

DEA DEA DEA Cloud  Foundry  Run.me  (PaaS)  

①  App status

messaging

②  App instance fails

③  Health manager

detects and

advises

④  New app instance

deployed

⑤  Routing table

updated

① 

② 

③ 

④ 

①  ① 

⑤ 

Page 9: Cloud Foundry Technical Overview

9

Dynamic  Router  

Cloud  Controller  

UAA/Login  Servers   Health  Manager  

DEA  Pool  Service  Broker  Node(s)  

User  Provided  Service  Instances  

Messaging  (NATS)  

Apps  

Cloud  Foundry  BOSH  

Build  Packs  

Logging  

Cloud Foundry Architecture

The Cloud Foundry platform is abstracted as a set of large-scale distributed services. It uses Cloud Foundry Bosh to operate the underlying infrastructure from IaaS providers (e.g., VMware, Amazon AWS, OpenStack).

Internet

Underlying Infrastructure

PaaS

Components are dynamically discoverable and loosely coupled, exposing health through HTTP endpoints so agents can collect state information (app state & system state) and act on it.

Page 10: Cloud Foundry Technical Overview

10

The router shapes and routes all external system traffic (HTTP/API) and application traffic from the internet/intranet. It maintains a dynamic routing table for each load-balanced app instance with IP addresses and ports.

How  It  Works: •  Load balancing •  Maintaining an active routing table •  Access logs •  Supports web-sockets

Responsible  For:

Roadmap: App-specific Metrics

Throughput

Latency

HTTP Response Codes

Bandwidth

SSL Termination

Router

Page 11: Cloud Foundry Technical Overview

11

The Cloud Controller maintains command and control systems, including interface with clients (CLI, Web UI, Spring STS), account and provisioning control. It also provides RESTful interface to domain objects (apps, services, organizations, spaces, service instances, user roles, and more).

How  It  Works: •  Expected App state, state transitions,

and desired convergence •  Permissions/Auth •  Orgs/Spaces/Users •  Services management •  App placement •  Auditing/Journaling and billing events •  Blob storage

Responsible  For:

Roadmap: Availability Zone Aware Placement

Richer Auditing with Queries and Filters OpenStack Swift Blob Configuration

Oauth Scope and Role Mapping

Cloud Controller

Page 12: Cloud Foundry Technical Overview

12

“User Authorization and Authentication” provides identity, security and authorization services. It manages third party Oauth 2.0 access credentials and can provide application access and identity-as-a-service for apps running on Cloud Foundry. Composed of: UAA Server, Command Line Interface, Library.

How  It  Works: •  Token Server •  ID Server (User management) •  OAuth Scopes (Groups) and SCIM •  Login Server

•  UAA Database •  SAML support (for SSO integration) and Active

Directory support with the VMWare SSO Appliance

•  Access auditing

Responsible  For:

Roadmap: LDAP Login Server

App User Management Services

Horizontally Scalable Login Server

UAA and Login Servers

Page 13: Cloud Foundry Technical Overview

13

Health Manager monitors application uptime by listening to the NATS message bus for mismatched application states (expected vs. actual). The Cloud Controller publishes expected state and the DEAs publish actual state. State mismatches are reported to the Cloud Controller.

How  It  Works: •  Maintains the actual state of apps •  Compares to expected state •  Sends suggestions to make actual

match expected (cannot make state changes itself – only CC can do that!)

Responsible  For:

Roadmap: Short-lived Apps

Configurable Restart Policies

Horizontally Scalable Health Manager

Health Manager

Page 14: Cloud Foundry Technical Overview

14

“Droplet Execution Agents” are secure and fully isolated containers. DEAs are responsible for an Apps lifecycle: building, starting and stopping Apps as instructed. They periodically broadcast messages about their state via the NATS message bus.

How  It  Works: •  Managing Linux containers (Warden) •  Monitoring resource pools

•  Process •  File system •  Network •  Memory

•  Managing app lifecycle •  App log and file streaming •  DEA heartbeats (NATS to CC, HM)

Responsible  For:

Roadmap: Placement Pools for Advanced Resource Allocation and Isolation

Aggregated Logs Including All App Instances and App-related System Logs

Evaluation of Windows .NET DEAs from Iron Foundry

App Log Draining with Syslog

DEA

Page 15: Cloud Foundry Technical Overview

15

Buildpacks are Ruby scripts that detect application runtimes/frameworks/plugins, compile the source code into executable binaries, and release the app to an assigned DEA. Runtime components can be cached for faster execution of subsequent app pushes.

How  It  Works: •  Staging*

•  /bin/detect •  /bin/compile •  /bin/release

•  Configure droplet •  Runtime (Ruby/Java/Node/Python) •  Container (Tomcat/Websphere/Jetty) •  Application (.WAR, .rb, .js, .py)

Responsible  For:

Roadmap:

Buildpack Management Including Updates and Versioning

vFabric Import Tool Enhanced Caching

(*) Cloud Foundry Buildpacks are compatible with Heroku

Buildpacks

Page 16: Cloud Foundry Technical Overview

16

NATS is a fast internal messaging bus to manage system wide communication via a publish-and-subscribe mechanism.

How  It  Works: •  Non-Persistent messaging •  Pub/Sub •  Queues (app events) •  Directed messages (INBOX)

Responsible  For:

Roadmap:

RabbitMQ Investigation

Robust Message Bus Interface Horizontal Scaling

Messaging (NATS)

Page 17: Cloud Foundry Technical Overview

17

Service Brokers provide an interface for native and external 3rd party services. Service processes run on Service Nodes or with external as-a-service providers (e.g., email, database, messaging, etc.).

How  It  Works: •  Advertising service catalog •  Makes create/delete/bind/unbind calls

to service nodes •  Requests inventory of existing

instances and bindings from cloud controller for caching, orphan management

•  SaaS marketplace gateway •  Implemented as HTTP enpoint,

written in any language.

Responsible  For:

Roadmap:

Multi-Node Support

Service Broker

Asynchronous protocol

Page 18: Cloud Foundry Technical Overview

18

Service Broker Example: run.pivotal.io + AppDirect

(run.pivotal.io)

Page 19: Cloud Foundry Technical Overview

19

UPSI (formerly “Service Connectors”) store meta-data in the Service Broker to enable Cloud Foundry to connect to local services that are NOT managed by Cloud Foundry (e.g., OracleDB, DB2, SQLServer, etc.)

How  It  Works: •  Metadata management

Responsible  For:

Roadmap:

Investigate Sharing Service Instances Across Spaces

Service Type Templates (OracleDB, DB2, SQLServer, MQSeries)

User Provided Service Instances

Page 20: Cloud Foundry Technical Overview

20

User Provided Service Instances (on-prem example)

Service Broker

Gateway

Alt Broker

Service Broker

Service Broker

IBM DB2 ORACLE DB

CF MySQL

MYSQL DB LB

Mongo Lab

Send Grid

AppDirect

ClearDB

INTE

RN

ET

Synchronous

Synchronous Synchronous

Ser

vice

C

onne

ctor

Ser

vice

C

onne

ctor

Page 21: Cloud Foundry Technical Overview

21

To: Pushing apps to the cloud with a few easy verbs

target  <my  cloud>  push  <my  app>  create  <my  services>  bind  <my  services>  scale  <my  app>  +100  

Developer Operator

cf-­‐iaas.yml  provision  <my  cloud>  add_capacity  <my  cloud>  

Page 22: Cloud Foundry Technical Overview

22

Message Bus

Deploying the CF Runtime with Cloud Foundry BOSH

IaaS  Cloud  Foundry  BOSH  (Opera.ng  the  PaaS)  

DB

BOSH Director

Blobs

Health Monitor Deployment • Packages •  Jobs • Blobs • Source • Manifest

Deploy my CF

Worker VMs

Messaging

Target VM Health Manager

Target VM Cloud Controller

Target VM

Operator

Page 23: Cloud Foundry Technical Overview

23

BOSH (Outer Shell) Logical View

Deploys and manages large scale distributed systems. BOSH provides the means to go from deployment (i.e., Chef/Puppet) to VM creation and management (i.e., cloud CPI). It includes interfaces for vSphere, vCloud, AWS and OpenStack. Additional CPI can be written for alternative IaaS providers. Key Elements:

•  CLI •  Director •  Blobstore •  Workers

•  Message Bus •  Health Monitor •  IaaS CPI •  Agents

DB Blob Store

Worker NATS Health Monitor

CPI

Director CLI

Inner shell

Outer shell Agents

Page 24: Cloud Foundry Technical Overview

24

BOSH: Command Line Interface

The Command Line Interface is how users interact with BOSH using a terminal session to do a deployment, create and upload releases, and upload ‘stemcells’ (i.e. a VM template with an embedded Agent).

DB Blob Store

Worker NATS Health Monitor

CPI

Director CLI

Inner shell

Outer shell Agents

Page 25: Cloud Foundry Technical Overview

25

The core orchestrating component in BOSH which controls creation of VMs, deployment, and other life cycle events of software and services. Command and control is handed over to the the Director-Agent interaction after the CPI has created resources.

BOSH: Director DB Blob Store

Worker NATS Health Monitor

CPI

Director CLI

Inner shell

Outer shell Agents

Page 26: Cloud Foundry Technical Overview

26

The core BOSH engine is abstracted from any particular IaaS. IaaS interfaces are implemented as plugins to BOSH. Currently, BOSH supports both VMware vSphere and Amazon Web Services. These CPIs allow for automated VM and storage disk provisioning, and network management.

BOSH: Cloud Provider Interface (CPI) DB Blob

Store

Worker NATS Health Monitor

CPI

Director CLI

Inner shell

Outer shell Agents

Page 27: Cloud Foundry Technical Overview

27

BOSH: Cloud Provider Interface Stemcell create_stemcell(image, cloud_properties) delete_stemcell(stemcell_id) VM create_vm(agent_id, stemcell_id, resource_pool,

networks, disk_locality, env) delete_vm(vm_id) reboot_vm(vm_id) configure_networks(vm_id, networks) Disk create_disk(size, vm_locality) delete_disk(disk_id) attach_disk(vm_id, disk_id) detach_disk(vm_id, disk_id)

IaaS Neutral

...ETC

Page 28: Cloud Foundry Technical Overview

28

Used to store the content of Releases, Jobs and Packages in their source form as well as the compiled image. When you deploy a Release, BOSH will orchestrate the compilation of packages and store the result in Blobstore. When BOSH deploys a Job to a VM, the Agent will pull the specified Job and associated Packages from the Blobstore.

BOSH: Blobstore DB Blob Store

Worker NATS Health Monitor

CPI

Director CLI

Inner shell

Outer shell Agents

Page 29: Cloud Foundry Technical Overview

29

Every VM contains an Agent. Through the Director-Agent interaction, VMs are given Jobs, or roles, within Cloud Foundry. If the VM's job is to run MySQL, for example, the Director will send instructions to the Agent about which packages must be installed and what the configurations for those packages are.

BOSH: Agents DB Blob Store

Worker NATS Health Monitor

CPI

Director CLI

Inner shell

Outer shell Agents

Page 30: Cloud Foundry Technical Overview

30

A Stemcell is a VM template with an embedded Agent. Stemcells are uploaded using the CLI and used by the Director when creating VMs through the CPI. When the Director creates a VM through the CPI, it will pass along configurations for networking and storage, as well as the location and credentials for the Message Bus (NATS) and the Blobstore.

BOSH: Stemcells DB Blob Store

Worker NATS Health Monitor

CPI

Director CLI

Inner shell

Outer shell Agents

Page 31: Cloud Foundry Technical Overview

31

Receives health status and life cycle events from Agents and can send alerts through notification plugins (such as email) to operations staff.

BOSH: Health Monitor DB Blob Store

Worker NATS Health Monitor

CPI

Director CLI

Inner shell

Outer shell Agents

Page 32: Cloud Foundry Technical Overview

32

BOSH components use NATS, a lightweight pub sub messaging system, for command and control.

BOSH: NATS DB Blob Store

Worker NATS Health Monitor

CPI

Director CLI

Inner shell

Outer shell Agents

Page 33: Cloud Foundry Technical Overview

33

BOSH: Putting it all together DB Blob Store

Worker NATS Health Monitor

CPI

Director CLI

Inner shell

Outer shell Agents

When you deploy Cloud Foundry the following sequence of steps occur: 1.  Target a BOSH director using CLI 2.  Upload a Stemcell 3.  Get a Release from a repo 4.  Create a deployment manifest 5.  BOSH Deploy Cloud Foundry:

•  Prepare deployment •  Compile packages •  Create and bind VMs •  Pull in job configurations •  Create needed job instances

– this is where things get pushed live