Upgrade to Pro — share decks privately, control downloads, hide ads and more …

MANAGING MICROSERVICES AT SCALE WITH OPENSTACK + DOCKER - YOUR IDEAL ENVIRONMENT FOR DEVOPS

MANAGING MICROSERVICES AT SCALE WITH OPENSTACK + DOCKER - YOUR IDEAL ENVIRONMENT FOR DEVOPS

OpenStack gives you a non-proprietary and extensible cloud. Microservices and Docker allow for extensible app architecture, and a vendor-agnostic, scalable infrastructure. While Microservices simplify app deployments, they come with a price: because it is so fragmented, it is more difficult to track and manage all the independent, yet inter-connected, components of the app.

With a combination of Docker, OpenStack, and an end-to-end orchestration layer you can have a Microservices architecture, while supporting easy deployments across Build, QA, and Production environments, with a scalable, centrally managed Openstack infrastructure.

This seamless integration between the application and the infrastructure simplifies and accelerates your DevOps processes and software delivery pipeline, while maximizing compute resources.

Using real examples and a live demonstration (JIRA, Jenkins, Chef, Selenium), this talk would cover best practices and tips for enabling a robust, scalable and extensible DevOps infrastructure to support today’s modern app delivery – all the way from architecture, pipeline design, build, test, and deployment.

Nikhil Vaze

October 28, 2015
Tweet

More Decks by Nikhil Vaze

Other Decks in Technology

Transcript

  1. © Electric Cloud | www.electric-cloud.com Nikhil Vaze | @therealnikhil |

    OpenStack Tokyo MANAGING MICROSERVICES AT SCALE WITH OPENSTACK + DOCKER - YOUR IDEAL ENVIRONMENT FOR DEVOPS
  2. © Electric Cloud | www.electric-cloud.com Introductions Nikhil Vaze https://github.com/nikhilv @therealnikhil

    Staff Software Engineer at Electric Cloud Full stack engineer and loves to hack on things Johns Hopkins University Alum
  3. © Electric Cloud | www.electric-cloud.com DEV OPS Electric Cloud: Powering

    Continuous Delivery ElectricFlow Deploy Pipeline & Release Management ElectricAccelerator Build & Test Acceleration DevOps Automation Platform Build DELIVERY Plugs right in to your existing tools CONTINUOUS Build Test
  4. © Electric Cloud | www.electric-cloud.com I spend my time on

    integrations Source Control, Defect Tracking, Databases, Clouds, Testing Tools , Application Servers….
  5. © Electric Cloud | www.electric-cloud.com Experience with Docker General interest

    in Docker, containers and software delivery. Docker Santa Clara Co-organizer: http://www.meetup.com/Docker-Santa-Clara Docker Hackathon 2014 & 2015 http://blog.docker.com/2014/07/dockercon-video- dockercon-hackathon-winners/ Lightning demo @ DOES ‘14 Docker and Application Deployment
  6. © Electric Cloud | www.electric-cloud.com Docker Survey: Keep your hands

    up if … You’ve heard of Docker You’ve typed ‘docker run…’ You use docker in dev/test You use docker in production You’ve exported a docker container and run it with systemd-nspawn
  7. © Electric Cloud | www.electric-cloud.com Why are people excited about

    containers?  Builds can be done inside the container, gives file system isolation and reproducibility.  Development/Production Parity. The container is the deployable artifact.  Container start up times measured in milliseconds  Microsoft getting on board!
  8. © Electric Cloud | www.electric-cloud.com Enter Docker • https://docker.io/ •

    Open Source • Used to wrap LXC, now has its own container implementation • Really, really fast. Start measuring in milliseconds
  9. © Electric Cloud | www.electric-cloud.com What are Microservices? • A

    pattern for building distributed systems: • A suite of services, each running in its own process, each exposing an API • Independently developed • Independently deployable • Each service is focused on doing one thing well “Gather together those things that change for the same reason, and separate those things that change for different reasons.” – Robert Martin
  10. © Electric Cloud | www.electric-cloud.com What’s good/bad about monolithic apps?

    • Can be easier to test • Can be easier to develop • Can be easier to deploy • Can’t deploy anything until you deploy everything • Harder to learn and understand the code • Easier to produce spaghetti code • Hard to adopt new technologies • You have to scale everything to scale anything
  11. © Electric Cloud | www.electric-cloud.com What’s cool about Microservices? •

    Loose coupling, so each service can: • choose the tooling that’s appropriate for the problem it solves • can be scaled as appropriate, independent of other services • can have its own lifecycle independent of other services • Makes it easier to adopt new technologies • Smaller more autonomous teams are more productive
  12. © Electric Cloud | www.electric-cloud.com Should I use Microservices? •

    If you already have solid CI, automated testing, and automated deployment, and you’re looking to scale, then maybe • If you don’t have automated testing, then you should probably definitely worry about that first • You have to be (or become) very good at automated deployment, testing and monitoring to reap the benefits. Microservices are not a magic hammer that will make your other problems go away
  13. © Electric Cloud | www.electric-cloud.com What’s difficult about Microservices? •

    Getting the service composition right is difficult • Breaking up a monolithic application takes time and will present challenges. (But it’s still worth it) • There’s more to monitor (and monitoring is much more important) “it needs to be a cohesive system made of many small parts with autonomous lifecycles but all coming together” - Ben Christensen, Netflix
  14. © Electric Cloud | www.electric-cloud.com Am I ready for microservices?

    • If you’re just starting out, stay monolithic until you understand the problem better • You need to be good at infrastructure provisioning • You need to be good at rapid application deployment • You need to be good at monitoring http://martinfowler.com/bliki/MicroservicePrerequisites.html
  15. © Electric Cloud | www.electric-cloud.com Sample pipeline: monolith, no containers

    Subversion Check out sources overlay deltas JIRA Mark issue as ‘build & unit test’ Jenkins Launch build + test w/ sources JIRA Mark issue as ‘code review’ ReviewBoard Create review request JIRA Mark issue as ‘resolved’ Build + test success? Review success? ReviewBoard Review modified code OpenStack Deploy integration environment OpenStack Teardown integration environment Testing success? Chef Configure integration environment ElectricFlow Flow Run tests against integration environment Flow Deploy application to container Flow Publish application to artifact repository.
  16. © Electric Cloud | www.electric-cloud.com Sample pipeline: monolith with containers

    Github Send Pull Request. Start build Jenkins Launch build + test w/ sources. Create container Github Merge Pull request Build + test success? Review success? Github Review pull request OpenStack Deploy integration environment OpenStack Teardown integration environment Testing success? ElectricFlow Flow Run tests against integration environment Docker Deploy application to container Docker Publish container to registry
  17. © Electric Cloud | www.electric-cloud.com Sample pipeline: microservices with containers

    Github Send Pull Request. Start build Flow Built & test. Create container Github Review pull request & merge ElectricFlow Flow Run tests against integration environment Docker Publish containers to registry OpenStack Deploy integration environment Flow Deploy Github Send Pull Request. Start build Flow Built & test. Create container Github Review pull request & merge Github Send Pull Request. Start build Flow Built & test. Create container Github Review pull request & merge Docker Publish containers to registry Docker Publish containers to registry Flow Schedule deployment Docker Retrieve containers from registry
  18. © Electric Cloud | www.electric-cloud.com Assembly ElectricFlow Flow Run tests

    against integration environment OpenStack Deploy integration environment Flow Ship it! Retrieve artifacts from server OpenStack Teardown integration environment ElectricFlow Flow Run tests against integration environment OpenStack Deploy integration environment Flow Ship it! Retrieve containers from registry OpenStack Teardown integration environment
  19. © Electric Cloud | www.electric-cloud.com Weather Dashboard  All deployed

    on an OpenStack cloud  16 widgets  First everything will be a Docker container (monolith)  Next all 16 will be broken into individual microservices
  20. © Electric Cloud | www.electric-cloud.com Weather Dashboard, monolith  One

    container housing the dashing monolith (front end and backend).  Using containers for Selenium (firefox inside a container and selenese)  Based off of davefp. Code: https://gist.github.com/nikhilv/2890da8695bdd1a16265
  21. © Electric Cloud | www.electric-cloud.com Weather Dashboard, microservices  17

    containers that represent the dashboard (1 front end and 16 backend).  Again using containers for Selenium (firefox inside a container and selenese).  Future: Begging to be parallelized!  Current implementation introduced coupling . Dashing widgets cannot install layouts (UI)
  22. © Electric Cloud | www.electric-cloud.com Everything can be done via

    the community edition… http://electric-cloud.com/downloads/electricflow/communityedition
  23. © Electric Cloud | www.electric-cloud.com Thoughts • Selenium + Docker

    was easier than expected. • More potential here. Get the impression UI testing is too intensive so most skip it. How do we tame this technology? • Still undecided about ‘packing it all in’ a container. • Lose the ability to define an interface. Harder to reason about the contents of the container. Blasphemy? • Oh so much more to explore about! So much glossed over. • Notion of application manifest. Deploying individual microservices. Zero downtime, Rolling deploys and Roll back.
  24. © Electric Cloud | www.electric-cloud.com MTTR or MTBF? • There

    is a point of diminishing returns with testing (especially end-to-end testing) • You may be better off getting really good at remediating production problems • Monitoring • Very fast rollbacks • Blue/green deployments • Canary deployments • Not all services have the same durability requirements
  25. © Electric Cloud | www.electric-cloud.com Resources • http://www.infoq.com/presentations/Breaking-the- Monolith •

    http://martinfowler.com/tags/microservices.html • http://www.amazon.com/Building-Microservices-Sam- Newman/dp/1491950358 • http://highscalability.com/blog/2014/7/28/the-great- microservices-vs-monolithic-apps-twitter-melee.html