Cloud Foundry: Hands-on Deployment Workshop
Post on 10-May-2015
Embed Size (px)
DESCRIPTIONSlides from Workshop 'Cloud Foundry: Hands-on Deployment Workshop' http://www.meetup.com/CloudFoundry/events/150601282/ In this workshop you will learn Cloud Foundry fundamental concepts, setup, deployment and operations. Well cover a couple of alternatives to deploy CF in a local environment for learning and testing purposes as well as deploying Cloud Foundry atop IaaS production level environment, being able to manage hundreds of components and thousands of applications. If you did not have a chance to work with Cloud Foundry, it may be useful to test its features locally at first. Deploying this environment on a local machine allows you to get hands-on experience in the solution and, in case you are a contributor, to test some features before you commit them to a production environment.
- 1.Dive into Cloud Foundry Internals Quick Start Manuel Garcia / altoros.com / @rmgarciap
2. Altoros Fact Sheet & Overview 3. **our vision Transform the way applications are being delivered, making a dramatic impact. 4. Solution Pack #1: Application * Fabric B IL F R UT OExpertiseCloud Foundry Consulting CustomersNoSQL & Hadoop IntegrationMulti-CloudClustered SQL/NoSQL Databases as CF Automation Services24/7 Managed ServicesSingle or multi-site deploymentsLegacy application migrationHigh Availability & Disaster RecoverySecurity - Testing & Certification 5. *In the past you had to deal with the full stack Apps Data/Services RuntimeYou scale, make resilient and manageMiddleware OS Virtualization Servers StorageNetworking 6. * Today you deal with the IaaS AppsYou scale, make resilient and manageData/Services Runtime Middleware OS Virtualization Servers StorageNetworkingManaged by IaaS Provider 7. *In the future you PaaS everything but your app You manageApps Data/Services RuntimeCode and add value instead of dealing with overwhelming systems maintenance and interoperability issuesMiddleware OS Virtualization Servers StorageNetworkingScale, resilient and managed by you or a Provider 8. Big Boss: The application is ready, lets put it in production now You: but I need to follow the process. 1 monthBig Boss: blah blah blah MAKE IT HAPPEN !!! 9. To Do:We need the experts Define requirements (CPU, RAM, Storage, networking, etc) Provision new servers Setup Load Balancing Apply security policiesBring me the SWAT team who can deal with this. FAST!Sorry man, they are busy Your team will have to do itThanks Lord my boss gave The guy who knows this left the teamme a cloud (AWS account!) 10. * Why PaaS? You dont care about: Multiple environments chaos (dev, test, prod) Managing instances Deal with IaaS APIs/clients Become a cook with Chef/Puppet/.. IaaS lock-in 11. * What PaaS is not? Middleware over IaaS Application hosting Application orchestration deployment tool Preinstalled packages/services for me to manage 12. * What do I care about as a developer? My code runsNot just run-timeMonitori ngNot just codeCIDatabases / Cache / Message Queues CDManual (Auto?) - scalingAutomated TestLoad-balancing 13. * PaaS vs IaaS FeaturesPaaSIaaSApp goes liveHours, days, or weeksMinutesApp Scalability / High AvailabilityArchitects link each app to IaaS APIsCentralized service by PaaS, for any appTime to be productiveServer setup, dev-ops requestsManage app by API?None. Build your own?Restfull APISelf-healingNoYesPortability between CloudsNone. Build your own?Use a simple CLI: $ cf pushYes (move entire app portfolios between IaaS 14. *Will my app run on Cloud Foundry just as it is? Avoid Writing to the Local File System It is short-lived Instances of the same app do not share a local file system HTTP Sessions Not Persisted or Replicated HTTP and HTTPS Port Limitations Runtimes and Frameworks? 15. * Buildpacks Based on Heroku buildpacks Fork and customize Develope your own Search buildpack: We've found 811 repository resultsOpen Source https://github.com/cloudfoundry 16. * Deploy and scale apps Deploy apps $ cf push $ cf push --buildpack https://github.com/heroku/heroku-buildpack-php Scale app up & down $ cf scale APP_NAME 17. * Something wrong deploying the app? $ cf app [app name] $ cf logs [app name] $ cf crashlogs [app name] $ cf env [app name] $ cf events [app name] $ cf health [app name] 18. * Push a RoR app From Ruby on Rails Tutorial sample application: http://railstutorial.org/ https://github.com/cloudfoundry-samples/rails_sample_appMy local Cloud Foundry API: https://api.10.244.0.34.xip.io 19. * 20. * Key architectural characteristics Portable Scalable Reliable Extensible 21. * Key architectural characteristics Portable 22. * Key architectural characteristics PortableOpen Source https://github.com/cloudfoundry 23. * Key architectural characteristics Scalable From few servers to thousands 24. * Key architectural characteristics Reliable Very few Single Points of Failure which are been improved (Message Bus -NAT S server-, Collector) 25. * Key architectural characteristics Extensible Loosely Coupled Components with specific responsibilities and technology agnostic intercommunication through a message bus. Ruby? Rewrite in GO lang? No problem 26. * Core components 27. * How do I deploy Cloudfoundry? Altoros Vagrant Installer, developer oriented deployment Nise Bosh, a lightweight BOSH emulator Bosh Lite, a lite development environment for BOSH. Wardenized VMsBOSH, tool chain for release engineering 28. * What is Bosh? Why BOSH? Tool chain for release engineering, deployment and lifecycle managementDesigned for large scale, distributed services Two floors up from Chef/Puppet. Multi-cloud, IaaS Provider independent Already Supports AWS, OpenStack & VMware vSphere (Cloudstack) Deploys & Manages Clusters of Cloud Foundry, Databases Updates & Operates Deployments 29. * What is BOSH? Main components Director, public API for the bosh CLI and coordinator of bosh behavior Blobstore, to store and retrieve precompiled packages Agents, run on each server within deployments The Health Manager, to track the state of deployed systems (the infrastructure and running jobs) Internal DNS, called PowerDNS, for internal unique naming of servers within bosh deployments Registry, for example AWS Registry, for tracking the infrastructure that has been provisioned (servers, persistent disks) 30. * BOSH deployments HOW-TOs http://docs.cloudfoundry.com/ Deploy to AWS Deploy to OpenStack Deploy to vSphere Deploy to vCloud Director Deploying Community Services 31. * Cloud Foundry: W.T.H.I.G.O? BOSH: status at a deployment level (CF, services and custom releases) Metrics / Monitoring Logs management 32. BOSH: Status at a deployment * level BOSH $ bosh vms --vitals dns 33. * Metrics / Monitoring Cloud Foundry Metric Collector https://github.com/cloudfoundry/collectorSend metrics wherever you want. Pluginable architecture Out of the box: OpenTSDB AWS CloudWatch DataDog?% Average Utilization 34. * 35. * Workshop - Prerequisites Vagrant Vagrant plugins $ vagrant plugin install vagrant-berkshelf $vagrant plugin install vagrant-omnibus 36. * Workshop - Prerequisites Vagrant Vagrant plugins $ vagrant plugin install vagrant-berkshelf $vagrant plugin install vagrant-omnibus Add prebuilt Vagrant box $ vagrant box add altoros-cf-installer altoros-cfinstaller.box 37. * Workshop VM setup $ vagrant up $ vagrant ssh $ cd /vagrant $ ./status.sh $ ./start.sh 38. * Workshop Cloud Foundry Directory structure Running processes logs Start / Stop / Status 39. * Workshop As a developer Log in $ cf target http://api.192.168.12.34.xip.io $ cf login Email> admin Password> password 40. * Workshop Orgs, spaces & users $ cf create-org myorg $ cf create-space myspace $ cf switch-space myspace 41. * Workshop Push an App $ cd test/fixtures/apps/sinatra Review manifest.yml $ cf push (wait.. I asume a slow connection) 42. * Workshop App details $ cf app $ cf env $ cf health 43. Workshop Errors / Logs / * Files $ cf logs $ cf crashlogs $ cf env $ cf events $ cf health 44. * Workshop Scaling $ cf scale Memory Instances Up Down 45. * Workshop CF Internals UAA Cloud Controller Router (gorouter) DEA Health Manager Warden 46. * Workshop CF Internals Everything goes through NATS $ nats-sub > $ nats-sub router.register 47. Muchas Gracias! (Thx) firstname.lastname@example.org @rmgarciap (650) 395-7002