Managing Managing Microservices Microservices E ff ectively E ff - - PowerPoint PPT Presentation

managing managing microservices microservices e ff
SMART_READER_LITE
LIVE PREVIEW

Managing Managing Microservices Microservices E ff ectively E ff - - PowerPoint PPT Presentation

Managing Managing Microservices Microservices E ff ectively E ff ectively Daniel Hall (@smarthall) Daniel Hall (@smarthall) About Me About Me Systems Engineer at LIFX Making the 'Internet' in the Internet of Things About This Talk About


slide-1
SLIDE 1

Managing Managing Microservices Microservices Effectively Effectively

Daniel Hall (@smarthall) Daniel Hall (@smarthall)

slide-2
SLIDE 2

About Me About Me

Systems Engineer at LIFX Making the 'Internet' in the Internet of Things

slide-3
SLIDE 3

About This Talk About This Talk

This is how we do things at LIFX Feel free to ask questions as we go It works for us, it might not work for you Think about how each bit fits into your situation

slide-4
SLIDE 4

Step One: Write your apps Step One: Write your apps

You may not get input into this part Micro services are popular at the moment Design pattern that works with continuous delivery

slide-5
SLIDE 5

Microservices Microservices

Try to keep as much state outside your apps Don't make them too small, they're not nanoservices Don't make them too big, they're not milliservices Each service should be Replacable Independently Deployable Have a single capability (billing, authentication) Think about information flow and circular dependencies

slide-6
SLIDE 6

The Hype Curve The Hype Curve

Jeremy Kemp CC-BY-SA (http://commons.wikimedia.org/wiki/File:Gartner_Hype_Cycle.svg)

Microservices

slide-7
SLIDE 7

Step Two: Packaging Step Two: Packaging

All dependencies need to be available Needs to be small or cachable Faster install means faster deployments You might want multiple versions on the same machine Preferably it works in several environments

slide-8
SLIDE 8

Docker Docker

Filesystem layers stacked on top of each other Uses Linux containers to isolate applications You can run a local Docker registry Security Speed You can run it locally in dev and on your servers Less of 'it works on my laptop' Minuscule performance hit compared to VMs

slide-9
SLIDE 9

The Hype Curve The Hype Curve

Jeremy Kemp CC-BY-SA (http://commons.wikimedia.org/wiki/File:Gartner_Hype_Cycle.svg)

Docker

slide-10
SLIDE 10

Step Three: Deployment Step Three: Deployment

As fast as possible Preferably minimal interaction Recovery from failures

slide-11
SLIDE 11

Mesos/Marathon Mesos/Marathon

Mesos manages tasks running on a cluster Marathon coordinates long running jobs You submit a JSON job description to Marathon Marathon handles switching from the old app to new Marathon will also handle task failure and recover Health checks ensure broken tasks get replaced

slide-12
SLIDE 12

The Hype Curve The Hype Curve

Jeremy Kemp CC-BY-SA (http://commons.wikimedia.org/wiki/File:Gartner_Hype_Cycle.svg)

Mesos/Marathon

slide-13
SLIDE 13

Extra Credit: Sheduling Extra Credit: Sheduling

Some things need to run repeatedly Cron works, but its not really HA HA Crons exist but can be complex Your cluster probably has spare capacity

slide-14
SLIDE 14

Chronos Chronos

Chronos runs your scheduled tasks in Mesos Uses ISO8601 intervals to specify schedules Use your spare capacity for repeating tasks Can rerun failing jobs Can handle job dependencies Records stats on run times for jobs

slide-15
SLIDE 15

The Hype Curve The Hype Curve

Jeremy Kemp CC-BY-SA (http://commons.wikimedia.org/wiki/File:Gartner_Hype_Cycle.svg)

Chronos

slide-16
SLIDE 16

Summary Summary

slide-17
SLIDE 17

Demo Demo

https://github.com/smarthall/ansible-mesos

slide-18
SLIDE 18

Demo Time! Demo Time!

All the code is on Github https://github.com/smarthall/ansible-mesos 'vagrant up' will give you a development cluster './init-cluster.sh' will add some sample apps