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
2. * Whythis 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
3. * Goals
•Understand how Cloud Foundry is deployed
•Get to know how Cloud Foundry internally works
from an PaaS Operator perspective
5. * 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
6. * It is so easy
•Install Bosh
•Deploy Something (ex.: ElasticSearch)
•Upload stemcell
•Upload release
•Configure deployment manifest
•Deploy !
7. * Bosh Lite – From Local to theCloud
• 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
8. * Bosh Lite – From Local to theCloud
• 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
9. * 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
13. * 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.
14. * 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.
15. * 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
16. * Example BOSH Release
• ElasticSearch release
• Take me to the repo…
17. * Cloud Foundry BOSH Release
• Around 20 jobs
• Open Source: github.com/cloudfoundry/cf-release
• Weekly releses (releases directory)
• Fully tested (CAT)
18. * Bosh Lite (lets continue)
• Upload Warden Stemcell
• $ bosh public stemcells
• $ bosh upload stemcell latest-bosh-stemcell-warden.tgz
19. * 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
20. * 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
24. * 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
28. *
• 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 FoundrySystem Buildpacks
29. *
> cf push = deploy
CLI Cloud
Controller
CCDB
(MySQL
)
Blob
Store
(S3,
etc.)
Executor
Stager
W
Build
packs
A2
A2 A3
A3
A1
A1
Pkg
Metadata
PkgMetadata Pkg
Droplet
Droplet
Users
R
o
u
t
e
r
A1.yourdomain.com
Frontend Backend
Stage A1
Deploy A1
DEA Nodes
32. *
• 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
42. *
Scalable
• From few servers to thousands
• Horizontally and Vertically
Key architecturalcharacteristics
43. *
Reliable
Very few Single Points of Failure which are been improved
(Message Bus -NAT S server-, Collector)
Key architecturalcharacteristics
44. *
Extensible
Loosely Coupled Components with specific responsibilities and
technology agnostic intercommunication through a message
bus.
Ruby? Rewrite in GO lang? No problem
Key architecturalcharacteristics
47. * What have we done?
• Install BOSH (with bosh lite)
• Install BOSH CLI
• Upload stemcell
• Upload Release
• Create and configure Deployment Manifest
• Deploy CF
48. * What have we done?
• Install Cloud Foundry CLI (cf)
• Target and log into CF
• Create organization and space
• Push an application
49. * 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
The Middleware over IaaS model today provides more flexibility to application administrators in that they have full control of the middleware runtime environment and its infrastructure knob. However, the beauty of a PaaS model is that it promises to eliminate the need for the control of these parameters altogether. The ultimate PaaS solution would be able to automatically deduce the optimal runtime environment for an application and automatically adjust it as the needs of the application and its usage evolve
http://docs.cloudfoundry.com/docs/using/app-arch/index.html
For example, rather than using the local file system, you can use a Cloud Foundry service such as the MongoDB document database or a relational database (MySQL or Postgres). Another option is to use cloud storage providers such as Amazon S3, Google Cloud Storage, Dropbox, or Box. If your application needs to communicate across different instances of itself (for example to share state etc), consider a cache like Redis or a messaging-based architecture with RabbitMQ.
Portable: Open Source / Multi-Platforms
- vSphere
- AWS
- Openstack -> It’s my data, I don’t want to have it out there!!!
- None of these? Extensible to other IaaS API through CPIs (Altoros is currently working on one)
Scalable: from 1 node to thousands
Extensible: Loosely Coupled Components with specific responsibilities and technology agnostic intercommunication through a message bus
Reliable: minimum (soon none) SPOF
Portable: Open Source / Multi-Platforms
- vSphere
- AWS
- Openstack -> It’s my data, I don’t want to have it out there!!!
- None of these? Extensible to other IaaS API through CPIs (Altoros is currently working on one)
Scalable: from 1 node to thousands
Extensible: Loosely Coupled Components with specific responsibilities and technology agnostic intercommunication through a message bus
Reliable: minimum (soon none) SPOF
Portable: Open Source / Multi-Platforms
- vSphere
- AWS
- Openstack -> It’s my data, I don’t want to have it out there!!!
- None of these? Extensible to other IaaS API through CPIs (Altoros is currently working on one)
Scalable: from 1 node to thousands
Extensible: Loosely Coupled Components with specific responsibilities and technology agnostic intercommunication through a message bus
Reliable: minimum (soon none) SPOF
Portable: Open Source / Multi-Platforms
- vSphere
- AWS
- Openstack -> It’s my data, I don’t want to have it out there!!!
- None of these? Extensible to other IaaS API through CPIs (Altoros is currently working on one)
Scalable: from 1 node to thousands
Extensible: Loosely Coupled Components with specific responsibilities and technology agnostic intercommunication through a message bus
Reliable: minimum (soon none) SPOF
Portable: Open Source / Multi-Platforms
- vSphere
- AWS
- Openstack -> It’s my data, I don’t want to have it out there!!!
- None of these? Extensible to other IaaS API through CPIs (Altoros is currently working on one)
Scalable: from 1 node to thousands
Extensible: Loosely Coupled Components with specific responsibilities and technology agnostic intercommunication through a message bus
Reliable: minimum (soon none) SPOF
Portable: Open Source / Multi-Platforms
- vSphere
- AWS
- Openstack -> It’s my data, I don’t want to have it out there!!!
- None of these? Extensible to other IaaS API through CPIs (Altoros is currently working on one)
Scalable: from 1 node to thousands
Extensible: Loosely Coupled Components with specific responsibilities and technology agnostic intercommunication through a message bus
Reliable: minimum (soon none) SPOF