altoros cloud foundry training: hands-on workshop for devops, architects and sysadmins

50
Hands-on Workshop for Operators Manuel Garcia / altoros.com / @rmgarciap

Upload: manuel-garcia

Post on 06-May-2015

770 views

Category:

Education


0 download

DESCRIPTION

Dealing with high-load services of all kinds makes us to seek for new generation tools to build reliable, scalable, and 100% available systems. At this workshop, you will have chance to dive deep into how Cloud Foundry solves the issues of portability, scalability, reliability and extensibility. Hands-on agenda: - Application lifecycle: from development to production - Deep dive into Cloud Foundry architecture - Where to deploy Cloud Foundry - How to Deploy Cloud Foundry: from small evaluation to hundreds VMs High Availability production environments - Scale up and down your infrastructure. Can you auto scale? - Zero downtime upgrades - Auto Healing deployments - Cloud Foundry system logging and monitoring - Services: types, current restrictions and expectations

TRANSCRIPT

Page 1: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

Hands-on Workshop for Operators

Manuel Garcia / altoros.com / @rmgarciap

Page 2: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

*Why this training?•SysAdmins and DevOps requested it in several

meetup Altoros talks

•Evolution from a minimalistic CF local installation workshop to a full CF deployment done with BOSH

Page 3: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

*Goals•Understand how Cloud Foundry is deployed

•Get to know how Cloud Foundry internally works from an PaaS Operator perspective

Page 4: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

Hands on?

1, 2, 3… go!

Page 5: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

* How do I deploy Cloudfoundry?

Nise Bosh, a lightweight BOSH emulator. Virtual and bare metal

Altoros Vagrant Installer, developer oriented deployment

BOSH, tool chain for release engineering

Bosh Lite, a lite development environment for BOSH. Conteinerized VMs

Canonical Juju Charms, cloud infrastructure automation

Page 6: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

*It is so easy

•Install Bosh•Deploy Something (ex.: ElasticSearch)•Upload stemcell•Upload release•Configure deployment manifest•Deploy !

Page 7: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

*Bosh Lite – From Local to the Cloud• Prerequisites • GIT• Ruby 1.9.3 (latest. 2.0.X not supported)• RubyGems and Bundler• VirtualBox• Vagrant

• Clone repo and deploy bosh lite (preferable local)• Lower RAM if needed (Vagrantfile)• $ vagrant up

Page 8: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

*Bosh Lite – From Local to the Cloud• Upload Stemcell• $ bosh public stemcells• $ bosh download public stemcell bosh….tgz

• Download Elasticsearch bosh release• $ git clone https://github.com/bonzofenix/elasticsearch-boshrelease

• Upload it to Bosh• $ bosh upload release releases/<version>.yml

• Deploy ElasticSeach• $ bosh manifest <elasticsearch manifest file>• $ bosh deploy

Page 9: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

* What is Bosh? Why BOSH?

Designed for large scale, distributed services

Tool chain for release engineering, deployment and lifecycle management

Already Supports AWS, OpenStack & VMware vSphere (Cloudstack)

Two floors up from Chef/Puppet. Multi-cloud, IaaS Provider independent

Updates & Operates Deployments

Deploys & Manages Clusters of Cloud Foundry, Databases, etc

Page 10: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

BOSH Overview

Page 11: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins
Page 12: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

BOSH Releases

Page 13: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

*What is a release?• A collection of configuration:

– files, – job definitions– source code– package definitions – and accompanying information needed to make a

software component deployable by BOSH.

• A release should have no dependencies that need to be fetched from the internet.

Page 14: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

*What is a release?• Source directories

– jobs: start and stop commands for each of the jobs (processes) running on Cloud Foundry nodes.

– packages: packaging instructions used by BOSH to build each of the dependencies.

– src: the source code for the components in Cloud Foundry. Note that each of the components is a submodule with a pointer to a specific SHA.

Page 15: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

*What is a release?• Releases directories

– releases: yml files containing the references to blobs for each package in a given release; these are solved within .final_builds

– .final_builds: references into the public blostore for final jobs & packages (each referenced by one or more releases)

– config: URLs and access credentials to the bosh blobstore for storing final releases

Page 16: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

*Example BOSH Release• ElasticSearch release

• Take me to the repo…

Page 17: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

*Cloud Foundry BOSH Release

• Around 20 jobs• Open Source: github.com/cloudfoundry/cf-release• Weekly releses (releases directory)• Fully tested (CAT)

Page 18: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

*Bosh Lite (lets continue)• Upload Warden Stemcell• $ bosh public stemcells• $ bosh upload stemcell latest-bosh-stemcell-warden.tgz

Page 19: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

*Stemcells• A minimal VM image that can convert into anything

• Contains a BOSH Agent: A process that runs continuously on each VM that BOSH deploys (one Agent process per VM). The BOSH Agent executes tasks in response to messages it receives from the BOSH Director

Page 20: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

*In the meantime.. What have we done?•MicroBosh in a local VM

• Director, public API• Blobstore, to store and retrieve

precompiled packages• Health Manager, to track the state of

deployed systems• Internal DNS, called PowerDNS, for

internal unique naming of servers within bosh deployments

• Bosh Database, desired state of a BOSH deployment

• Message Bus (NATS)• Registry, for tracking the

infrastructure that has been provisioned (servers, persistent disks)

• Resurrector• Task Queue (requires Redis), async

queue used by the BOSH Director and Workers to manage tasks

Page 21: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

Example Component Interaction

Page 22: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins
Page 23: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

Lets Deploy Cloud Foundry

Page 24: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

*CF deployment steps• Download Release from repo and upload it to

BOSH– $ git clone https://github.com/cloudfoundry/cf-release– $ bosh upload release releases/cf-169.yml– Check it is there: $ bosh releases

• Build deployment manifest and tell BOSH to use it– $ ./scripts/make_manifest_spiff– $ bosh deployment manifests/cf-manifest.yml

• Deploy: $ bosh deploy

Page 25: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

Test your Cloud Foundry Deployment

Page 26: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

*Target and deploy• $ cf login -a https://api.10.0.244.34.xip.io

• Download, build and deploy the app– $ git clone https://github.com/mgarciap/cf-ruby-example.git– $ cd cf-ruby-example– $ cf push

• App metadata? – Manifests

Page 27: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

Runtimes and Frameworks

Buildpacks

Page 28: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

*• Java

– Java, Grails, Play, Spring or any other JVM-based language or framework

• Node.js– Node or JavaScript

• Ruby– Ruby, Rack, Rails or Sinatra

• Go Lang

Cloud Foundry System Buildpacks

Page 29: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

*> cf push = deploy

CLI Cloud Controller

CCDB(MySQ

L)

Blob Store (S3, etc.)

Executor

Stager

W

Build packs

A2

A2 A3

A3

A1

A1

Pkg

Metadata

PkgMetadata

Pkg

Droplet

Droplet

Users

Router

A1.yourdomain.com

Frontend Backend

Stage A1

Deploy A1

DEA Nodes

Page 30: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

*• $ cf app [app]• $ cf logs [app]

• Logs are streamed. CC API, Staging, DEA, Router – HTTP and finally your app

• Dump: cf logs [app] –recent

• $ cf env [app name]• $ cf events [app name]• $ cf files [app]

Something wrong deploying the app?

Page 31: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

Services

( *aaS )

Page 32: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

*• They can be anything external resource as far as they provide

an API and they are registered with the CC• Actions

• Provision/deprovision• Bind/unbind

Services

Page 33: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

No downtime deployments

Blue-green deployment release technique

Page 34: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

*• One production domain and two apps

• Blue prod • Green next release• $ cf push Blue -n demo-time

Blue-Green Deployment

Page 35: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

*• Update App and Push• $ cf push Green -n demo-time-

temp

Blue-Green Deployment

Page 36: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

*• Map Original Route to Green• $ cf map-route Green

example.com -n demo-timeBinding demo-time.example.com to Green... OK

Blue-Green Deployment

Page 37: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

*• Unmap Route to Blue• cf unmap-route Blue example.com

-n demo-time-tempUnbinding demo-time.example.com from blue... OK

Blue-Green Deployment

Page 38: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

*• Remove Temporary Route to Green• $ cf unmap-route Green

example.com -n demo-time-temp

Blue-Green Deployment

Page 39: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

Key architectural characteristics

Page 40: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

*

Portable

Key architectural characteristics

CPIs

Page 41: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

*

Portable

Key architectural characteristics

https://github.com/cloudfoundry

Open Source

Page 42: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

*

Scalable• From few servers to thousands• Horizontally and Vertically

Key architectural characteristics

Page 43: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

*

Reliable

Very few Single Points of Failure which are been improved (Message Bus -NAT S server-, Collector)

Key architectural characteristics

Page 44: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

*

Extensible

Loosely Coupled Components with specific responsibilities and technology agnostic intercommunication through a message bus. Ruby? Rewrite in GO lang? No problem

Key architectural characteristics

Page 45: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

Cloud Foundry Architecture Overview

Page 46: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

*Core components

Page 47: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

* What have we done?

• Install BOSH (with bosh lite)• Install BOSH CLI• Upload stemcell• Upload Release• Create and configure Deployment Manifest• Deploy CF

Page 48: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

* What have we done?

• Install Cloud Foundry CLI (cf)• Target and log into CF• Create organization and space• Push an application

Page 49: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

* What is next? Deploy CF into a IaaS

• Small/Medium deployment for demos/testing• Microbosh

• Medium to large production deployments• Deploy Microbosh• With Microbosh deploy BOSH• From BOSH deploy CF

Page 50: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins

Thank [email protected]

@rmgarciap(650) 395-7002