a9s - An Introduction into Bosh

Preview:

Citation preview

An Introduction intoBOSH

Introduction

Cloud Foundry

Cloud Foundryis a

distributed system

Operating a platform + operating apps on the

platform must be easierthan doing so without it.

How do operate a platform

such as Cloud Foundryat a large-scale?

BOSH is built with platform operations in

mind.

What is BOSH?

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

deployments of distributed systemsto infrastructure.“

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

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

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

How BOSH works

BOSH Architecture

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

BOSH Installation

VIRTUAL MACHINE

��

BOSH Director��

NATS Message Bus��

BOSH Registry��

BLOB Store

BOSH Health Monitor❤️

BOSH on a single VM = MicroBOSH

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

BOSH Automation

BOSH Releasescontain the automation

A BOSH-Deployment depends on 1 .. *

Stemcells

• 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.)

A BOSH-Deployment is described by a Release &

Manifest

• Release = collection of

• source code

• configuration files

• startup scripts

• software packages

• jobs

A Release describe 1 .. * Jobs

• Jobs = Processes to be run

• = set of configuration files

• + scripts

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

A Release contains 1 .. * Package

• Package

• src code

• compile script

• install script

A BOSH Deployment’s settings are contained in a

Manifest

• defines the layout and properties of a deployment

• network architecture

• VM dimensions, used stemcells (OS)

• bosh cli pushed manifest to BOSH director

• > BOSH director creates a deployment

Infrastructure settingssettings are contained in the

Cloud Config

BOSH makes your deployments…

Infrastructure Independent

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

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

Automate once,deploy everywhere.

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

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

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

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

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

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

• Switch deployment between clouds

• Keep the same release

• Use a stemcell specific to the new cloud

• Adapt the cloud config

Operating System Independent

A BOSH release does not depend on the OS

The only dependency to the OS is a BOSH

stemcell

Operating SystemImage

BOSH Agent

VIRTUAL MACHINE

}OS image +BOSH agent= Stemcell

UbuntuStemcell

BOSH Agent

VIRTUAL MACHINE

SUSEStemcell

BOSH Agent

VIRTUAL MACHINE

• Channing the OS of a BOSH deployed system

• Keep the same release

• Change the stemcell

• Change the manifest

Scalable

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

• Scaling-out a BOSH deployed system

• Keep the same release

• Use the same stemcell

• Change the manifest

Vertical Scaling

4GB RAM1 vCPU

10GB persistent disk

BOSH Agent

VIRTUAL MACHINE4 GB RAM, 1 vCPU

10 GB Persistent DiskData

PostgreSQL

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

BOSH Deployments are Predictable

• 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.

BOSH Deployments are

Repeatable

Executing a specific BOSH deployment always leads to

exact same deployed system.

Monitored &Self-Healing

Self-healingprocess failures

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

Self-healingprocess monitor failures

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

Self-healingVM failures

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❤️

Self-healingBOSH Agent failures

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

How BOSH is used

Developing automationwith BOSH

BOSH Automation Design Workflow

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

bosh/

Applying automationwith BOSH

BOSH Deployment Workflow

• Upload stemcell

• Upload a release

• Set deployment with a manifest

• Execute deployment

When to use BOSH

„BOSH let’s youorchestrate the

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

Use Case:a9s Data Service

Framework

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

Use Case:Deploy Cloud Foundry

Thank you.@fischerjulian

julian.fischer@anynines.com