Structure and Opinions
Software Deployment with
Cloud Foundry
Image credit - http://www.rmeoc.org/wp-content/uploads/2016/07/foundry.jpg
A little about me
• Andrew Ripka
• @rippmn
Cloud Native
DevOps Continuous
Delivery
ContainersMicro services
12 Factor Apps
Some Further Reading
https://content.pivotal.io/ebooks
Topics
● Structure and Opinions
● Introduction to Cloud Foundry
● The Structure and Opinions of Cloud Foundry
Setting the Stage
Structure and Opinions
Structured - Stronger Guarantees
Opinionated - More DefaultsLogs
Lumber
Treehouse
Structure and Opinions
● Structure - coherent form or organization
● Opinions - Specific Implementation of Something
Enterprise Architecture Context
Structure and Opinions
● Structure - Governance
● Opinions - Reference Architecture
Conceptual IT Mapping
Structure and Opinions
● Structure - API
● Opinions - API implementation
Introduction to Cloud Foundry
Cloud Foundry gives companies the speed,
simplicity and control they need to develop and
deploy applications faster and easier.
• Platform As a Service
– Polyglot Runtime supporting multiple languages
and frameworks
– Choice of IaaS Providers
– Choice of Application Services
https://www.cloudfoundry.org/foundation/
Foundation Driven
Certified Distros
https://cloudfoundry.org/certified-platforms/
Essential Elements of Enterprise Platform
• Rapid Provisioning
• Rapid Application Deployment & Management
• Scale Horizontally
• Basic Monitoring, Logs & Metrics
• No-downtime platform upgrades
• Dynamic load balancing and routing
• Manage supporting services (data, messaging)
• Failure detection and health remediation
http://blog.cloudfoundry.org/2013/10/24/essential-elements-of-an-enterprise-paas/
https://www.youtube.com/watch?v=SSxI9eonBVs
The developer haiku
https://blog.pivotal.io/pivotal-cloud-foundry/products/pivotal-cloud-foundrys-roadmap-for-2
The operator haiku
Cloud Native Framework
Contract: 12 Factor App
Contract: BOSH Deployment/Release
Contract: Cloud Provider Interface
Culture
Dev
Dev IT
Ops
Applications
Runtime
Platform
Infrastructure Automation
Infrastructure
IT
Ops
IT
Ops
Tools
BOSH
Services
Cloud Native Framework
Contract: 12 Factor App
Contract: BOSH Deployment/Release
Contract: Cloud Provider Interface
Culture
Dev
Dev IT
Ops
Applications
Runtime
Platform
Infrastructure Automation
Infrastructure
IT
Ops
IT
Ops
Tools
BOSH
Services
The Structures
(and Default Opinions)
Cloud Native Framework
Contract: 12 Factor App
Contract: BOSH Deployment/Release
Contract: Cloud Provider Interface
Culture
Dev
Dev IT
Ops
Applications
Runtime
Platform
Infrastructure Automation
Infrastructure
IT
Ops
IT
Ops
Tools
BOSH
Services
Infrastructure (as a Service)
Infrastructure Resource Pool
than can be provisioned via
API calls
Cloud Native Framework
Contract: 12 Factor App
Contract: BOSH Deployment/Release
Contract: Cloud Provider Interface
Culture
Dev
Dev IT
Ops
Applications
Runtime
Platform
Infrastructure Automation
Infrastructure
IT
Ops
IT
Ops
Tools
BOSH
Services
Infrastructure
Automation
via BOSH
What Is BOSH?
• BOSH is an open source tool chain for release
engineering, deployment, and lifecycle
management of large-scale distributed services.
• BOSH was specifically developed to facilitate the
deployment of Cloud Foundry
• BOSH Interacts with IaaS via Cloud Provider
Interface (CPI)
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)
▪ has_vm(vm_id)
▪ set_vm_metadata(vn_id, metadata)
▪ configure_networks(vm_id, networks)
Cloud Provider Interface
Disk
create_disk(size, vm_locality)
delete_disk(disk_id)
attach_disk(vm_id, disk_id)
detach_disk(vm_id, disk_id)
has_disk(disk_id)
get_disks(disk_id, metadata)
Disk Snapshots
snapshot_disk(disk_id, metadata)
delete_snapshot (disk_id)
current_vm_id(vm_id)
BOSH Architecture
DB Blob Store
Worker NATS
Health
Monitor
CPI
DirectorCLI
Inner shell
Outer shell
Agents
BOSH Delivery Concepts
• Stemcells
• Release
• Deployment
Stemcell
• Base OS System
• BOSH Agent
• Same for all Infrastructures
• No specific info about software to be installed
• Wrapped in IaaS packaging that allows fast cloning
▪ vSphere - VMDK
▪ AWS – AMI
▪ Google Compute and Azure - Image
Release
• Versioned collection of:
– configuration properties
– configuration templates
– start up scripts
– source code
– binary artifacts
– Other stuff (like config)
• Collection of VMs (1 or more)
• Built from stemcells
• Populated with Releases and Persistent Disk
Deployment
Deployment Example
Full Example - https://bosh.io/docs/sample-manifest.html
Elastic Runtime High Level Architecture
Cloud Foundry Elastic Runtime
Dynamic Router
OAuth 2.0 Server (UAA)
CELL
Garden
Build Packs
Login Server
CC & CC Bridge
Blob Store
BBS/etcd
Sys Log
ServiceBrokers
Collector App Log
ROUTING
AUTHENTICATION
APP LIFECYCLE
APP STORAGE
& EXECUTION
MESSAGING
METRICS & LOGGING
Cloud Foundry BOSH
BBS Converger
Cloud Native Framework
Contract: 12 Factor App
Contract: BOSH Deployment/Release
Contract: Cloud Provider Interface
Culture
Dev
Dev IT
Ops
Applications
Runtime
Platform
Infrastructure Automation
Infrastructure
IT
Ops
IT
Ops
Tools
BOSH
Services
Cloud Controller
• Restful API to allow clients to access platform functionality
• Several Clients exist to call functionality
– Command Line Interface
– Apps Manager
– IDE Plugins
Cloud Controller API
http://apidocs.cloudfoundry.org
Cloud Foundry CLI
• CLI is a RESTful client to Cloud Controller
• Commands Structured as CF <<command>> <<parameters>>
• Built in Architecture for Plugin extensions
• Getting help
– cf –h returns available commands
– cf <<command>> -h returns help for a specific command
• Includes ability to write plugins to extend
Application Deployment
Applications
Source code and application frameworks used by developers to
create application
– Java/Spring
– Ruby/Rails
– JavaScript for Node.js
– .Net
– others
Automate App Deployments
Step 1 - Upload
Upload application files
via the Platform
Controller API
Step 2 - Stage
Take application files and
package with other
dependencies into the
container file
Step 3 - Distribute
Platform controller
schedules (assigns) the
container to cluster cell
Step 4 - Run
Assigned cluster cell starts
application using provided
metadata and informs the
platform load balancer/router
that application traffic can be
routed to container endpoint
Buildpacks
• A Buildpack is a combination of scripts that will combine the application
with the frameworks and runtimes necessary to deploy
• Written as scripts that:
– Detect if buildpack should be applied
– Compile container file by combining application code and defined
runtime components
– Release describe how app container can be deployed to an assigned
container host
• Installed into a Cloud Foundry instance or loaded from an external
location
Services
• Services are an add on that can be provisioned to provide
service an application
– Databases (MySQL, Mongo, Redis) and Rabbit MQ
• Marketplace service instances are created and bound using a
Service Broker
• Bound services connection information is placed in
application environment variable
Service Broker
• Restful endpoint that provides contract allowing self service
creation and binding to apps by authorized users
– create
– delete
– bind
– unbind
– catalog
• Loggregator
• Route Services
• Container Networking
• Credential Storage Management and Rotation
Other Structures and Opinions
• Applications write logs to STDOUT and STDERR
• Relevant Cloud Foundry component events added to
application stream
• Log events collected, collated, and expose via API and the
firehose
• API Allows application users and operators to:
– Tail their application logs
– Dump a recent set of application logs
– Continually drain their application logs to 3rd party log
archive and analysis service
Loggregator
• Enable automatic insertion of
services into the request path
for applications configured for
specific needs
• Use Cases
– API Gateway
– Security Gateways
– Anayltics
Route Services
Client
Route Service
Router App
Service
Broker
• Provides mean to
communication between
containers via a SDN
provider
• CNI API used to provide
common interaction across
SDN Providers
Container Networking Control
A central point of control for
credential
• Generation
• Storage
• lifecycle management
• access control
• access event logging
CredHub
Any Questions?
http://i.onionstatic.com/avclub/6077/85/16x9/960.jpg

MNAssociationEnterpriseArchitectsCloudFoundryJuly2017

  • 1.
    Structure and Opinions SoftwareDeployment with Cloud Foundry Image credit - http://www.rmeoc.org/wp-content/uploads/2016/07/foundry.jpg
  • 2.
    A little aboutme • Andrew Ripka • @rippmn
  • 3.
  • 4.
  • 5.
    Topics ● Structure andOpinions ● Introduction to Cloud Foundry ● The Structure and Opinions of Cloud Foundry
  • 6.
  • 7.
    Structured - StrongerGuarantees Opinionated - More DefaultsLogs Lumber Treehouse
  • 8.
    Structure and Opinions ●Structure - coherent form or organization ● Opinions - Specific Implementation of Something
  • 9.
    Enterprise Architecture Context Structureand Opinions ● Structure - Governance ● Opinions - Reference Architecture
  • 10.
    Conceptual IT Mapping Structureand Opinions ● Structure - API ● Opinions - API implementation
  • 11.
  • 12.
    Cloud Foundry givescompanies the speed, simplicity and control they need to develop and deploy applications faster and easier.
  • 14.
    • Platform Asa Service – Polyglot Runtime supporting multiple languages and frameworks – Choice of IaaS Providers – Choice of Application Services
  • 15.
  • 16.
  • 17.
    Essential Elements ofEnterprise Platform • Rapid Provisioning • Rapid Application Deployment & Management • Scale Horizontally • Basic Monitoring, Logs & Metrics • No-downtime platform upgrades • Dynamic load balancing and routing • Manage supporting services (data, messaging) • Failure detection and health remediation http://blog.cloudfoundry.org/2013/10/24/essential-elements-of-an-enterprise-paas/
  • 18.
  • 19.
  • 20.
    Cloud Native Framework Contract:12 Factor App Contract: BOSH Deployment/Release Contract: Cloud Provider Interface Culture Dev Dev IT Ops Applications Runtime Platform Infrastructure Automation Infrastructure IT Ops IT Ops Tools BOSH Services
  • 21.
    Cloud Native Framework Contract:12 Factor App Contract: BOSH Deployment/Release Contract: Cloud Provider Interface Culture Dev Dev IT Ops Applications Runtime Platform Infrastructure Automation Infrastructure IT Ops IT Ops Tools BOSH Services
  • 22.
  • 23.
    Cloud Native Framework Contract:12 Factor App Contract: BOSH Deployment/Release Contract: Cloud Provider Interface Culture Dev Dev IT Ops Applications Runtime Platform Infrastructure Automation Infrastructure IT Ops IT Ops Tools BOSH Services
  • 24.
    Infrastructure (as aService) Infrastructure Resource Pool than can be provisioned via API calls
  • 25.
    Cloud Native Framework Contract:12 Factor App Contract: BOSH Deployment/Release Contract: Cloud Provider Interface Culture Dev Dev IT Ops Applications Runtime Platform Infrastructure Automation Infrastructure IT Ops IT Ops Tools BOSH Services
  • 26.
  • 27.
    What Is BOSH? •BOSH is an open source tool chain for release engineering, deployment, and lifecycle management of large-scale distributed services. • BOSH was specifically developed to facilitate the deployment of Cloud Foundry • BOSH Interacts with IaaS via Cloud Provider Interface (CPI)
  • 28.
    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) ▪ has_vm(vm_id) ▪ set_vm_metadata(vn_id, metadata) ▪ configure_networks(vm_id, networks)
  • 29.
    Cloud Provider Interface Disk create_disk(size,vm_locality) delete_disk(disk_id) attach_disk(vm_id, disk_id) detach_disk(vm_id, disk_id) has_disk(disk_id) get_disks(disk_id, metadata) Disk Snapshots snapshot_disk(disk_id, metadata) delete_snapshot (disk_id) current_vm_id(vm_id)
  • 30.
    BOSH Architecture DB BlobStore Worker NATS Health Monitor CPI DirectorCLI Inner shell Outer shell Agents
  • 31.
    BOSH Delivery Concepts •Stemcells • Release • Deployment
  • 32.
    Stemcell • Base OSSystem • BOSH Agent • Same for all Infrastructures • No specific info about software to be installed • Wrapped in IaaS packaging that allows fast cloning ▪ vSphere - VMDK ▪ AWS – AMI ▪ Google Compute and Azure - Image
  • 33.
    Release • Versioned collectionof: – configuration properties – configuration templates – start up scripts – source code – binary artifacts – Other stuff (like config)
  • 34.
    • Collection ofVMs (1 or more) • Built from stemcells • Populated with Releases and Persistent Disk Deployment
  • 35.
    Deployment Example Full Example- https://bosh.io/docs/sample-manifest.html
  • 36.
    Elastic Runtime HighLevel Architecture Cloud Foundry Elastic Runtime Dynamic Router OAuth 2.0 Server (UAA) CELL Garden Build Packs Login Server CC & CC Bridge Blob Store BBS/etcd Sys Log ServiceBrokers Collector App Log ROUTING AUTHENTICATION APP LIFECYCLE APP STORAGE & EXECUTION MESSAGING METRICS & LOGGING Cloud Foundry BOSH BBS Converger
  • 37.
    Cloud Native Framework Contract:12 Factor App Contract: BOSH Deployment/Release Contract: Cloud Provider Interface Culture Dev Dev IT Ops Applications Runtime Platform Infrastructure Automation Infrastructure IT Ops IT Ops Tools BOSH Services
  • 38.
    Cloud Controller • RestfulAPI to allow clients to access platform functionality • Several Clients exist to call functionality – Command Line Interface – Apps Manager – IDE Plugins
  • 39.
  • 40.
    Cloud Foundry CLI •CLI is a RESTful client to Cloud Controller • Commands Structured as CF <<command>> <<parameters>> • Built in Architecture for Plugin extensions • Getting help – cf –h returns available commands – cf <<command>> -h returns help for a specific command • Includes ability to write plugins to extend
  • 41.
  • 42.
    Applications Source code andapplication frameworks used by developers to create application – Java/Spring – Ruby/Rails – JavaScript for Node.js – .Net – others
  • 43.
    Automate App Deployments Step1 - Upload Upload application files via the Platform Controller API Step 2 - Stage Take application files and package with other dependencies into the container file Step 3 - Distribute Platform controller schedules (assigns) the container to cluster cell Step 4 - Run Assigned cluster cell starts application using provided metadata and informs the platform load balancer/router that application traffic can be routed to container endpoint
  • 44.
    Buildpacks • A Buildpackis a combination of scripts that will combine the application with the frameworks and runtimes necessary to deploy • Written as scripts that: – Detect if buildpack should be applied – Compile container file by combining application code and defined runtime components – Release describe how app container can be deployed to an assigned container host • Installed into a Cloud Foundry instance or loaded from an external location
  • 45.
    Services • Services arean add on that can be provisioned to provide service an application – Databases (MySQL, Mongo, Redis) and Rabbit MQ • Marketplace service instances are created and bound using a Service Broker • Bound services connection information is placed in application environment variable
  • 46.
    Service Broker • Restfulendpoint that provides contract allowing self service creation and binding to apps by authorized users – create – delete – bind – unbind – catalog
  • 47.
    • Loggregator • RouteServices • Container Networking • Credential Storage Management and Rotation Other Structures and Opinions
  • 48.
    • Applications writelogs to STDOUT and STDERR • Relevant Cloud Foundry component events added to application stream • Log events collected, collated, and expose via API and the firehose • API Allows application users and operators to: – Tail their application logs – Dump a recent set of application logs – Continually drain their application logs to 3rd party log archive and analysis service Loggregator
  • 49.
    • Enable automaticinsertion of services into the request path for applications configured for specific needs • Use Cases – API Gateway – Security Gateways – Anayltics Route Services Client Route Service Router App Service Broker
  • 50.
    • Provides meanto communication between containers via a SDN provider • CNI API used to provide common interaction across SDN Providers Container Networking Control
  • 51.
    A central pointof control for credential • Generation • Storage • lifecycle management • access control • access event logging CredHub
  • 52.