Automation Tools for UCS Sysadmins - University of Wisconsin
Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins
-
Upload
manuel-garcia -
Category
Education
-
view
772 -
download
0
description
Transcript of Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins
![Page 1: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/1.jpg)
Hands-on Workshop for Operators
Manuel Garcia / altoros.com / @rmgarciap
![Page 2: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/2.jpg)
*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](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/3.jpg)
*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](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/4.jpg)
Hands on?
1, 2, 3… go!
![Page 5: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/5.jpg)
* 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](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/6.jpg)
*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](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/7.jpg)
*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](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/8.jpg)
*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](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/9.jpg)
* 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](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/10.jpg)
BOSH Overview
![Page 11: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/11.jpg)
![Page 12: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/12.jpg)
BOSH Releases
![Page 13: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/13.jpg)
*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](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/14.jpg)
*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](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/15.jpg)
*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](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/16.jpg)
*Example BOSH Release• ElasticSearch release
• Take me to the repo…
![Page 17: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/17.jpg)
*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](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/18.jpg)
*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](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/19.jpg)
*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](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/20.jpg)
*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](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/21.jpg)
Example Component Interaction
![Page 22: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/22.jpg)
![Page 23: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/23.jpg)
Lets Deploy Cloud Foundry
![Page 24: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/24.jpg)
*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](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/25.jpg)
Test your Cloud Foundry Deployment
![Page 26: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/26.jpg)
*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](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/27.jpg)
Runtimes and Frameworks
Buildpacks
![Page 28: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/28.jpg)
*• 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](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/29.jpg)
*> 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](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/30.jpg)
*• $ 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](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/31.jpg)
Services
( *aaS )
![Page 32: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/32.jpg)
*• 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](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/33.jpg)
No downtime deployments
Blue-green deployment release technique
![Page 34: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/34.jpg)
*• 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](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/35.jpg)
*• 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](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/36.jpg)
*• 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](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/37.jpg)
*• 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](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/38.jpg)
*• 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](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/39.jpg)
Key architectural characteristics
![Page 40: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/40.jpg)
*
Portable
Key architectural characteristics
CPIs
![Page 41: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/41.jpg)
*
Portable
Key architectural characteristics
https://github.com/cloudfoundry
Open Source
![Page 42: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/42.jpg)
*
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](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/43.jpg)
*
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](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/44.jpg)
*
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](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/45.jpg)
Cloud Foundry Architecture Overview
![Page 46: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/46.jpg)
*Core components
![Page 47: Altoros Cloud Foundry Training: hands-on workshop for DevOps, Architects and SysAdmins](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/47.jpg)
* 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](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/48.jpg)
* 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](https://reader035.fdocuments.us/reader035/viewer/2022062418/554a11a3b4c905825d8b4ae9/html5/thumbnails/49.jpg)
* 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