81
An Introduction into BOSH

a9s - An Introduction into Bosh

Embed Size (px)

Citation preview

Page 1: a9s - An Introduction into Bosh

An Introduction intoBOSH

Page 2: a9s - An Introduction into Bosh

Introduction

Page 3: a9s - An Introduction into Bosh
Page 4: a9s - An Introduction into Bosh

Cloud Foundry

Page 5: a9s - An Introduction into Bosh

Cloud Foundryis a

distributed system

Page 6: a9s - An Introduction into Bosh

Operating a platform + operating apps on the

platform must be easierthan doing so without it.

Page 7: a9s - An Introduction into Bosh

How do operate a platform

such as Cloud Foundryat a large-scale?

Page 8: a9s - An Introduction into Bosh

BOSH is built with platform operations in

mind.

Page 9: a9s - An Introduction into Bosh

What is BOSH?

Page 10: a9s - An Introduction into Bosh

„BOSH let’s you orchestrate the lifecycle of large-scale

deployments of distributed systemsto infrastructure.“

Page 11: a9s - An Introduction into Bosh

Infrastructure as a Service (IaaS), e.g. OpenStack

VIRTUAL DATACENTER

VIRTUAL MACHINE

BOSH

Router

STORAGE

Storage Node Storage Node Storage Node

HDD HDD

HDD HDD

HDD HDD

HDD HDD

HDD HDD

HDD HDD

HDD HDD

HDD HDD

HDD HDD

BOSH API

Storage Volume

Operating System

BOSH Agent

VIRTUAL MACHINE

BOSH CLI$> bosh deploy

IaaS API

BOSH CPI

Page 12: a9s - An Introduction into Bosh

Infrastructure as a Service (IaaS), e.g. OpenStack

VIRTUAL DATACENTER

VIRTUAL MACHINE

BOSH

Router

STORAGE

Storage Node Storage Node Storage Node

HDD HDD

HDD HDD

HDD HDD

HDD HDD

HDD HDD

HDD HDD

HDD HDD

HDD HDD

HDD HDD

BOSH APIOperating

System

BOSH Agent

VIRTUAL MACHINE

BOSH CLI$> bosh deploy

IaaS API

PostgreSQL

BOSH CPI

Page 13: a9s - An Introduction into Bosh

Infrastructure as a Service (IaaS), e.g. OpenStack

VIRTUAL DATACENTER

VIRTUAL MACHINE

BOSH

Router

STORAGE

Storage Node Storage Node Storage Node

HDD HDD

HDD HDD

HDD HDD

HDD HDD

HDD HDD

HDD HDD

HDD HDD

HDD HDD

HDD HDD

BOSH APIOperating

System

BOSH Agent

VIRTUAL MACHINE

BOSH CLI$> bosh deploy

IaaS API

BOSH Agent

VIRTUAL MACHINE

PostgreSQL Operating System

BOSH Agent

VIRTUAL MACHINE

Cloud Controller

Operating System

BOSH Agent

VIRTUAL MACHINE

UAA

BOSH CPI

Page 14: a9s - An Introduction into Bosh

How BOSH works

Page 15: a9s - An Introduction into Bosh

BOSH Architecture

Page 16: a9s - An Introduction into Bosh

BOSH Installation BOSH Managed Infrastructure Resources

Some process

BOSH Agent

VIRT

UAL

MAC

HINE Process Monitor

Yet another process

VIRT

UAL

MAC

HINE BOSH Agent Process Monitor

BOSH Health Monitor

BOSH Director

NATS Message BusSome other process

VIRT

UAL

MAC

HINE BOSH Agent Process Monitor

Process Monitor

BOSH Registry

BLOB Store

❤️��

����

��

CPI M

ACHINE

Page 17: a9s - An Introduction into Bosh

BOSH Installation

VIRTUAL MACHINE

��

BOSH Director��

NATS Message Bus��

BOSH Registry��

BLOB Store

BOSH Health Monitor❤️

BOSH on a single VM = MicroBOSH

Page 18: a9s - An Introduction into Bosh

BOSH Installation

VIRTUAL MACHINE

BOSH Health Monitor❤️️

BOSH on multiple VMs

VIRTUAL MACHINE

BOSH Director��

VIRTUAL MACHINE

BOSH Registry��

VIRTUAL MACHINE

BLOB Store��❤️️

VIRTUAL MACHINE

NATS Message Bus��

Page 19: a9s - An Introduction into Bosh

BOSH Automation

Page 20: a9s - An Introduction into Bosh

BOSH Releasescontain the automation

Page 21: a9s - An Introduction into Bosh
Page 22: a9s - An Introduction into Bosh

A BOSH-Deployment depends on 1 .. *

Stemcells

Page 23: a9s - An Introduction into Bosh

• VM template

• BOSH clones new VMs from stemcells

• Stemcell = OS + BOSH Agent

• BOSH Agent acts on the VM

• Stemcells are infrastructure and OS specific (VMware + Ubuntu, OpenStack + CentOS, etc.)

Page 24: a9s - An Introduction into Bosh

A BOSH-Deployment is described by a Release &

Manifest

Page 25: a9s - An Introduction into Bosh

• Release = collection of

• source code

• configuration files

• startup scripts

• software packages

• jobs

Page 26: a9s - An Introduction into Bosh

A Release describe 1 .. * Jobs

Page 27: a9s - An Introduction into Bosh

• Jobs = Processes to be run

• = set of configuration files

• + scripts

• > run process from a package,e.g. mysqld

Page 28: a9s - An Introduction into Bosh

A Release contains 1 .. * Package

Page 29: a9s - An Introduction into Bosh

• Package

• src code

• compile script

• install script

Page 30: a9s - An Introduction into Bosh

A BOSH Deployment’s settings are contained in a

Manifest

Page 31: a9s - An Introduction into Bosh

• defines the layout and properties of a deployment

• network architecture

• VM dimensions, used stemcells (OS)

Page 32: a9s - An Introduction into Bosh

• bosh cli pushed manifest to BOSH director

• > BOSH director creates a deployment

Page 33: a9s - An Introduction into Bosh

Infrastructure settingssettings are contained in the

Cloud Config

Page 34: a9s - An Introduction into Bosh

BOSH makes your deployments…

Page 35: a9s - An Introduction into Bosh

Infrastructure Independent

Page 36: a9s - An Introduction into Bosh

• A BOSH release contains the main-automation (software packages, how to run processes)

• BOSH releases can be re-used on every* infrastructure

Page 37: a9s - An Introduction into Bosh

Automate once,deploy everywhere.

Page 38: a9s - An Introduction into Bosh

VMware

BOSH

BOSH CLI$> bosh target http://bosh-on.vmware.com$> bosh deploy

SomeService / App

BOSH Agent

VIRTUAL MACHINE

SomeService / App

BOSH Agent

VIRTUAL MACHINE

SomeService / App

BOSH Agent

VIRTUAL MACHINE

SomeService / App

BOSH Agent

VIRTUAL MACHINE

SomeService / App

BOSH Agent

VIRTUAL MACHINE

SomeService / App

BOSH Agent

VIRTUAL MACHINE

OpenStack

BOSH

AWS

BOSH

Page 39: a9s - An Introduction into Bosh

BOSH CLI

VMware AWS OpenStack

$> bosh target http://bosh-on.aws.com$> bosh deploy

SomeService / App

BOSH Agent

VIRTUAL MACHINE

SomeService / App

BOSH Agent

VIRTUAL MACHINE

SomeService / App

BOSH Agent

VIRTUAL MACHINE

SomeService / App

BOSH Agent

VIRTUAL MACHINE

SomeService / App

BOSH Agent

VIRTUAL MACHINE

SomeService / App

BOSH Agent

VIRTUAL MACHINE

BOSH BOSH BOSH

Page 40: a9s - An Introduction into Bosh

OpenStack

BOSH

BOSH CLI$> bosh target http://bosh-on.openstack.com$> bosh deploy

SomeService / App

BOSH Agent

VIRTUAL MACHINE

SomeService / App

BOSH Agent

VIRTUAL MACHINE

SomeService / App

BOSH Agent

VIRTUAL MACHINE

SomeService / App

BOSH Agent

VIRTUAL MACHINE

SomeService / App

BOSH Agent

VIRTUAL MACHINE

SomeService / App

BOSH Agent

VIRTUAL MACHINE

VMware

BOSH

AWS

BOSH

Page 41: a9s - An Introduction into Bosh

Infrastructure as a Service (IaaS), e.g. OpenStack

VIRTUAL DATACENTER

VIRTUAL MACHINE

BOSH

Router

STORAGE

Storage Node Storage Node Storage Node

HDD HDD

HDD HDD

HDD HDD

HDD HDD

HDD HDD

HDD HDD

HDD HDD

HDD HDD

HDD HDD

BOSH APIOperating

System

BOSH Agent

VIRTUAL MACHINE

BOSH CLI$> bosh deploy

IaaS API

BOSH Agent

VIRTUAL MACHINE

PostgreSQL Operating System

BOSH Agent

VIRTUAL MACHINE

Cloud Controller

Operating System

BOSH Agent

VIRTUAL MACHINE

UAA

BOSH CPI

Page 42: a9s - An Introduction into Bosh

OpenStack

VIRTUAL DATACENTER

VIRTUAL MACHINE

BOSH

Router

STORAGE

Storage Node Storage Node Storage Node

HDD HDD

HDD HDD

HDD HDD

HDD HDD

HDD HDD

HDD HDD

HDD HDD

HDD HDD

HDD HDD

BOSH APIOperating

System

BOSH Agent

VIRTUAL MACHINE

BOSH CLI$> bosh deploy

IaaS API

PostgreSQL Operating System

BOSH Agent

VIRTUAL MACHINE

Cloud Controller

Operating System

BOSH Agent

VIRTUAL MACHINE

UAA

OPENSTACK CPI

Page 43: a9s - An Introduction into Bosh

VIRTUAL DATACENTER

VIRTUAL MACHINE

BOSH

Router

STORAGE

Storage Node Storage Node Storage Node

HDD HDD

HDD HDD

HDD HDD

HDD HDD

HDD HDD

HDD HDD

HDD HDD

HDD HDD

HDD HDD

BOSH APIOperating

System

BOSH Agent

VIRTUAL MACHINE

BOSH CLI$> bosh deploy

IaaS API

PostgreSQL Operating System

BOSH Agent

VIRTUAL MACHINE

Cloud Controller

Operating System

BOSH Agent

VIRTUAL MACHINE

UAA

AWS CPI

Page 44: a9s - An Introduction into Bosh

• Switch deployment between clouds

• Keep the same release

• Use a stemcell specific to the new cloud

• Adapt the cloud config

Page 45: a9s - An Introduction into Bosh

Operating System Independent

Page 46: a9s - An Introduction into Bosh

A BOSH release does not depend on the OS

Page 47: a9s - An Introduction into Bosh

The only dependency to the OS is a BOSH

stemcell

Page 48: a9s - An Introduction into Bosh

Operating SystemImage

BOSH Agent

VIRTUAL MACHINE

}OS image +BOSH agent= Stemcell

Page 49: a9s - An Introduction into Bosh

UbuntuStemcell

BOSH Agent

VIRTUAL MACHINE

Page 50: a9s - An Introduction into Bosh

SUSEStemcell

BOSH Agent

VIRTUAL MACHINE

Page 51: a9s - An Introduction into Bosh

• Channing the OS of a BOSH deployed system

• Keep the same release

• Change the stemcell

• Change the manifest

Page 52: a9s - An Introduction into Bosh

Scalable

Page 53: a9s - An Introduction into Bosh

Horizontal Scaling

Some Service

BOSH Agent

VIRTUAL MACHINE

Some Service

BOSH Agent

VIRTUAL MACHINE

Some Service

BOSH Agent

VIRTUAL MACHINE

Some Service

BOSH Agent

VIRTUAL MACHINE

Some Service

BOSH Agent

VIRTUAL MACHINE

Some Service

BOSH Agent

VIRTUAL MACHINE

Some Service

BOSH Agent

VIRTUAL MACHINE

Some Service

BOSH Agent

VIRTUAL MACHINE

Some Service

BOSH Agent

VIRTUAL MACHINE

Some Service

BOSH Agent

VIRTUAL MACHINE

Some Service

BOSH Agent

VIRTUAL MACHINE

Some Service

BOSH Agent

VIRTUAL MACHINE

Some Service

BOSH Agent

VIRTUAL MACHINE

Some Service

BOSH Agent

VIRTUAL MACHINE

Some Service

BOSH Agent

VIRTUAL MACHINE

Some Service

BOSH Agent

VIRTUAL MACHINE

Some Service

BOSH Agent

VIRTUAL MACHINE

Some Service

BOSH Agent

VIRTUAL MACHINE

Some Service

BOSH Agent

VIRTUAL MACHINE

Some Service

BOSH Agent

VIRTUAL MACHINE

Some Service

BOSH Agent

VIRTUAL MACHINE

Some Service

BOSH Agent

VIRTUAL MACHINE

Some Service

BOSH Agent

VIRTUAL MACHINE

Some Service

BOSH Agent

VIRTUAL MACHINE

Some Service

BOSH Agent

VIRTUAL MACHINE

Some Service

BOSH Agent

VIRTUAL MACHINE

Some Service

BOSH Agent

VIRTUAL MACHINE

Some Service

BOSH Agent

VIRTUAL MACHINE

Page 54: a9s - An Introduction into Bosh

• Scaling-out a BOSH deployed system

• Keep the same release

• Use the same stemcell

• Change the manifest

Page 55: a9s - An Introduction into Bosh

Vertical Scaling

Page 56: a9s - An Introduction into Bosh

4GB RAM1 vCPU

10GB persistent disk

BOSH Agent

VIRTUAL MACHINE4 GB RAM, 1 vCPU

10 GB Persistent DiskData

PostgreSQL

Page 57: a9s - An Introduction into Bosh

BOSH Agent

PostgreSQL

VIRTUAL MACHINE8 GB RAM, 2 vCPUs

10 GB Persistent DiskData

BOSH Agent

VIRTUAL MACHINE4 GB RAM, 1 vCPU

PostgreSQL

10 GB Persistent DiskData

20 GB Persistent Disk

Data

Page 58: a9s - An Introduction into Bosh

BOSH Deployments are Predictable

Page 59: a9s - An Introduction into Bosh

• Src code is compiled in a freshly created VMs

• VMs always contain exact the software, specified in the release

• No left-overs of prior deployments as new VMs are used.

Page 60: a9s - An Introduction into Bosh

BOSH Deployments are

Repeatable

Page 61: a9s - An Introduction into Bosh

Executing a specific BOSH deployment always leads to

exact same deployed system.

Page 62: a9s - An Introduction into Bosh

Monitored &Self-Healing

Page 63: a9s - An Introduction into Bosh

Self-healingprocess failures

Page 64: a9s - An Introduction into Bosh

BOSH Installation BOSH Managed Infrastructure Resources

Some process

BOSH Agent

VIRT

UAL

MAC

HINE Process Monitor

Yet another process

VIRT

UAL

MAC

HINE BOSH Agent

BOSH Health Monitor

BOSH Director

NATS Message BusSome other process

VIRT

UAL

MAC

HINE BOSH Agent Process Monitor

BOSH Registry

BLOB Store

❤️��

����

��

CPI M

ACHINE

Some other process

Process MonitorProcess Monitor

Page 65: a9s - An Introduction into Bosh

Self-healingprocess monitor failures

Page 66: a9s - An Introduction into Bosh

BOSH Installation BOSH Managed Infrastructure Resources

Some process

BOSH Agent

VIRT

UAL

MAC

HINE Process Monitor

Yet another process

VIRT

UAL

MAC

HINE BOSH Agent

BOSH Health Monitor

BOSH Director

NATS Message BusSome other process

VIRT

UAL

MAC

HINE BOSH Agent Process Monitor

BOSH Registry

BLOB Store

❤️��

����

��

CPI M

ACHINE

Some other process

Process MonitorProcess Monitor

Process Monitor

Page 67: a9s - An Introduction into Bosh

Self-healingVM failures

Page 68: a9s - An Introduction into Bosh

BOSH Installation BOSH Managed Infrastructure Resources

Some process

BOSH Agent

VIRT

UAL

MAC

HINE Process Monitor

Yet another process

VIRT

UAL

MAC

HINE BOSH Agent Process Monitor

NATS Message BusSome other process

VIRT

UAL

MAC

HINE BOSH Agent Process Monitor

Process Monitor

BOSH Registry

BLOB Store

����

��

��

BOSH Director CPI M

ACHINE

Some other process

VIRT

UAL

MAC

HINE BOSH Agent Process Monitor

BOSH Health Monitor❤️

Page 69: a9s - An Introduction into Bosh

Self-healingBOSH Agent failures

Page 70: a9s - An Introduction into Bosh

BOSH Managed Infrastructure Resources

Yet another process

VIRT

UAL

MAC

HINE Process Monitor

BOSH Installation

Some process

BOSH Agent

VIRT

UAL

MAC

HINE Process Monitor

BOSH Agent

NATS Message BusSome other process

VIRT

UAL

MAC

HINE BOSH Agent Process Monitor

BOSH Registry

BLOB Store

����

��

��

BOSH Director CPI M

ACHINE

BOSH Agent

BOSH Health Monitor❤️

Yet another process

VIRT

UAL

MAC

HINE Process MonitorBOSH Agent

Page 71: a9s - An Introduction into Bosh

How BOSH is used

Page 72: a9s - An Introduction into Bosh

Developing automationwith BOSH

BOSH Automation Design Workflow

Page 73: a9s - An Introduction into Bosh

https://mariash.github.io/learn-

bosh/

Page 74: a9s - An Introduction into Bosh

Applying automationwith BOSH

BOSH Deployment Workflow

Page 75: a9s - An Introduction into Bosh

• Upload stemcell

• Upload a release

• Set deployment with a manifest

• Execute deployment

Page 76: a9s - An Introduction into Bosh

When to use BOSH

Page 77: a9s - An Introduction into Bosh

„BOSH let’s youorchestrate the

lifecycle of large-scale deployments of distributed systemsto infrastructure.“

Page 78: a9s - An Introduction into Bosh

Use Case:a9s Data Service

Framework

Page 79: a9s - An Introduction into Bosh

a9s Deployer

Templates Deployments

BOSH

a9s Service Broker

my-3node-mongodb-cluster-2

MongoDB VM#1

MongoDB VM#2

MongoDB VM#3

my-single-mongodb-1

MongoDB VM#1

Middleware Adapter

Cloud Foundry Adapter

a9s MongoDB SPI

Service InstanceService Instancemy-3node-mongodb-cluster-3

MongoDB VM#1

MongoDB VM#2

MongoDB VM#3

Service Instance

Cloud ControllerCF Clientcreate service

create service

create deployment from template xy with attributes {…}

deploy release abc & deployment manifest xyz

Execute deployments

create service specific

credentials

create binding

Page 80: a9s - An Introduction into Bosh

Use Case:Deploy Cloud Foundry