Top Banner
Structure and Opinions Software Deployment with Cloud Foundry Image credit - http://www.rmeoc.org/wp-content/uploads/2016/07/foundry.jpg
41

Structure and Opinions - Software Deployments with Cloud Foundry

Jan 21, 2018

Download

Technology

Andrew Ripka
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Structure and Opinions - Software Deployments with Cloud Foundry

background image: 960x540 pixels - send to back of slide and set to 80% transparency

Structure and OpinionsSoftware Deployment with Cloud Foundry

Image credit - http://www.rmeoc.org/wp-content/uploads/2016/07/foundry.jpg

Page 2: Structure and Opinions - Software Deployments with Cloud Foundry

A little about me

• Andrew Ripka

• @rippmn

Page 3: Structure and Opinions - Software Deployments with Cloud Foundry

Twin Cities Cloud Foundry Meetup

Page 4: Structure and Opinions - Software Deployments with Cloud Foundry

Topics

● Structure and Opinions● Introduction to Cloud Foundry● Developer Demo● Elastic Runtime Components● BOSH Components

Page 5: Structure and Opinions - Software Deployments with Cloud Foundry

Setting the StageStructure and Opinions

Page 6: Structure and Opinions - Software Deployments with Cloud Foundry

Structured - Stronger Guarantees

Opinionated - More DefaultsLogs

Lumber

Treehouse

Page 7: Structure and Opinions - Software Deployments with Cloud Foundry

Structure, Frameworks, and Opinions

● Structure - coherent form or organization

● Framework - a basic structure underlying a system,

concept, or text.

● Opinions - Specific Implementation of Something

Page 8: Structure and Opinions - Software Deployments with Cloud Foundry

Introduction to Cloud Foundry

Page 9: Structure and Opinions - Software Deployments with Cloud Foundry

Cloud Foundry gives companies the speed, simplicity and control they need to develop and

deploy applications faster and easier.

Page 10: Structure and Opinions - Software Deployments with Cloud Foundry
Page 11: Structure and Opinions - Software Deployments with Cloud Foundry

• Platform As a Service– Polyglot Runtime supporting multiple languages

and frameworks

– Choice of IaaS Providers

– Choice of Application Services

Page 12: Structure and Opinions - Software Deployments with Cloud Foundry

https://www.cloudfoundry.org/foundation/

Foundation Driven

Page 13: Structure and Opinions - Software Deployments with Cloud Foundry

Certified Distros

https://cloudfoundry.org/certified-platforms/

Page 14: Structure and Opinions - Software Deployments with Cloud Foundry

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/

Page 15: Structure and Opinions - Software Deployments with Cloud Foundry

https://www.youtube.com/watch?v=SSxI9eonBVs

The developer haiku

Page 16: Structure and Opinions - Software Deployments with Cloud Foundry

https://blog.pivotal.io/pivotal-cloud-foundry/products/pivotal-cloud-foundrys-roadmap-for-2016

The operator haiku

Page 17: Structure and Opinions - Software Deployments with Cloud Foundry

Cloud Foundry

Contract: 12 Factor App

Contract: BOSH Release

Contract: Cloud Provider Interface

Culture

Dev

Dev IT Ops

Applications

Runtime Platform

Infrastructure Automation

InfrastructureIT

Ops

IT Ops

Tools

BOSH

Page 18: Structure and Opinions - Software Deployments with Cloud Foundry

Developer DemoUsing Elastic Runtime

Page 19: Structure and Opinions - Software Deployments with Cloud Foundry

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

Page 20: Structure and Opinions - Software Deployments with Cloud Foundry

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

Serv

ice

Bro

kers

Collector App Log

ROUTING

AUTHENTICATION

APP LIFECYCLE

APP STORAGE& EXECUTION

MESSAGING

METRICS & LOGGING

Cloud Foundry BOSH

BBS Converger

Page 21: Structure and Opinions - Software Deployments with Cloud Foundry

Elastic Runtime What You Care About

• Cloud Controller

• Applications

• Buildpacks

• Services

• Service Brokers

• Routing

• Health Management

• Loggregator

Cloud Foundry Elastic Runtime

Dynamic Router

APP HOSTS

App

Build Packs

Loggregator

Serv

ice

Bro

kers

ROUTING

AUTHENTICATION

APP STORAGE& EXECUTION

METRICS & LOGGING

Cloud Foundry BOSH

Cloud Controller

App AppApp

Page 22: Structure and Opinions - Software Deployments with Cloud Foundry

Applications

Source code and application frameworks used by developers to create application

– Java/Spring

– Ruby/Rails

– JavaScript for Node.js

– .Net

– others

Page 23: Structure and Opinions - Software Deployments with Cloud Foundry

Cloud Controller

• Restful API to allow clients to access platform functionality • Several Clients exist to call functionality

– Command Line Interface

– Apps Manager

– IDE Plugins

Page 24: Structure and Opinions - Software Deployments with Cloud Foundry

Cloud Controller API

http://apidocs.cloudfoundry.org

Page 25: Structure and Opinions - Software Deployments with Cloud Foundry

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

Page 26: Structure and Opinions - Software Deployments with Cloud Foundry

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

Page 27: Structure and Opinions - Software Deployments with Cloud Foundry

• Monitor applications to determine version, current state, and number of instances and status via health checks

• On changes Determine desired application state and instances from cloud controller and converges to desired state

Health Management

Page 28: Structure and Opinions - Software Deployments with Cloud Foundry

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

Page 29: Structure and Opinions - Software Deployments with Cloud Foundry

Service Broker

• Restful endpoint that provides contract allowing self service creation and binding to apps by authorized users

– create

– delete

– bind

– unbind

– catalog

Page 30: Structure and Opinions - Software Deployments with Cloud Foundry

• Router shapes and routes all external system traffic (HTTP/API/TCP)– maintains a dynamic routing table for each load-balanced

app instance• URL Routes to applications consist of domain, host, and

optionally a path• Applications are either assigned route based upon application

name or defined host• Allows extension through Route Services

Router and URL Routes

Page 31: Structure and Opinions - Software Deployments with Cloud Foundry

• 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

Page 32: Structure and Opinions - Software Deployments with Cloud Foundry

Automated Systems BOSH

Page 33: Structure and Opinions - Software Deployments with Cloud Foundry

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)

Page 34: Structure and Opinions - Software Deployments with Cloud Foundry

BOSH Architecture

DB Blob Store

Worker NATSHealth Monitor

CPI

DirectorCLI

Inner shell

Outer shellAgents

Page 35: Structure and Opinions - Software Deployments with Cloud Foundry

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)

Page 36: Structure and Opinions - Software Deployments with Cloud Foundry

Cloud Provider Interface

Diskcreate_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 Snapshotssnapshot_disk(disk_id, metadata)delete_snapshot (disk_id)current_vm_id(vm_id)

Page 37: Structure and Opinions - Software Deployments with Cloud Foundry

BOSH Delivery Concepts

• Stemcells• Release• Deployment

Page 38: Structure and Opinions - Software Deployments with Cloud Foundry

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 - Image

Page 39: Structure and Opinions - Software Deployments with Cloud Foundry

Release

• Versioned collection of:

– configuration properties

– configuration templates

– start up scripts

– source code

– binary artifacts

– Other stuff (like config)

Page 40: Structure and Opinions - Software Deployments with Cloud Foundry

• Collection of VMs (1 or more)• Built from stemcells• Populated with Releases and Persistent Disk

Deployment

Page 41: Structure and Opinions - Software Deployments with Cloud Foundry

background image: 960x540 pixels - send to back of slide and set to 80% transparency

Any Questions?

http://i.onionstatic.com/avclub/6077/85/16x9/960.jpg