Microservices kept simple

44
digitalocean.c om Microservices kept simple with DigitalOcean Vitor Pellegrino @pellegrino

Transcript of Microservices kept simple

Page 1: Microservices kept simple

digitalocean.com

Microservices kept simple with

DigitalOceanVitor Pellegrino@pellegrino

Page 2: Microservices kept simple
Page 3: Microservices kept simple

Full bleed images

Page 4: Microservices kept simple

Full bleed images

~ 18 million droplets

Page 5: Microservices kept simple

digitalocean.com

Droplet

Page 6: Microservices kept simple

digitalocean.com

Block Storage

Page 7: Microservices kept simple

digitalocean.com

Networking

Page 8: Microservices kept simple

http://martinfowler.com/bliki/MicroservicePrerequisites.html

Page 9: Microservices kept simple

digitalocean.com

Make sure you haveRapid provisioning

Basic monitoring

Rapid application deployment

Page 10: Microservices kept simple

digitalocean.com

“I’m just starting, why do I need an orchestration/cluster management tool?”

Page 11: Microservices kept simple

digitalocean.com

Why do I need such a tool?Cattle vs Pets

Easier to provision resources for a given application.

Better utilization of computing resources.

Page 12: Microservices kept simple

digitalocean.com

"How would I deploy a microservice from scratch in 10 minutes?"

Page 13: Microservices kept simple
Page 14: Microservices kept simple

digitalocean.com

Lets explore a few options

dokku

docker-swarm

kubernetes

Page 15: Microservices kept simple

digitalocean.com

Dokku

Page 16: Microservices kept simple

digitalocean.com

https://www.digitalocean.com/products/one-click-apps/dokku/

Page 17: Microservices kept simple

digitalocean.com

Page 18: Microservices kept simple

digitalocean.com

Dokku

Page 19: Microservices kept simple

Dokku

digitalocean.com

Good for teams used to herokuOptimised for a single box experiencePre built images on DigitalOceanExtensible using plugins

Page 20: Microservices kept simple

Dokku

digitalocean.com

Only vertical scaling is possibleYour server may become a single point of

failure

Page 21: Microservices kept simple

digitalocean.com

Page 22: Microservices kept simple

digitalocean.com

Docker swarm modeDocker’s built in orchestration for natively managing a cluster of Docker Engines called swarm.

Page 23: Microservices kept simple

Embedded data storage Built in security out of the boxOrchestration and cluster management By default, also execute work.Typically 3, 5 or 7 in a HA production

cluster

Manager

digitalocean.com

Page 24: Microservices kept simple

Take work and report status backCan scale to several nodes

Worker nodes

digitalocean.com

Page 25: Microservices kept simple

digitalocean.com

Security

Page 26: Microservices kept simple

Docker swarm mode

digitalocean.com

Very simple setupNative built in orchestration Built in security out of the boxNo extra components needed

Page 27: Microservices kept simple

Docker swarm mode

digitalocean.com

It is not as mature as other toolsDocker only

Page 28: Microservices kept simple

digitalocean.com

Kubernetes

Page 29: Microservices kept simple

digitalocean.com

KubernetesKubernetes is an open-source system for automating deployment, scaling, and management of containerized applications.

Page 30: Microservices kept simple

Kubernetes

digitalocean.com

Strong communitySupports different types of containers.Powerful set of constructsUses etcd to store cluster state, other

components are stateless

Page 31: Microservices kept simple

digitalocean.com

Page 32: Microservices kept simple

Installing kubernetes

digitalocean.com

https://github.com/Capgemini/kubeform (terraform + ansible, using CoreOS)

https://github.com/kubernetes-incubator/bootkube (self hosted kubernetes bootstrap)

https://github.com/kelseyhightower/kubernetes-the-hard-way

Page 33: Microservices kept simple

Kubeadm

digitalocean.com

Automates the installation to a couple of commands.

Rapidly evolving (currently alpha)

Still no High Available setup is supported

Page 34: Microservices kept simple

Kubeadm

digitalocean.com

Still only a single master is supported

Rapidly evolving (currently alpha)

Page 35: Microservices kept simple

digitalocean.com

"Great! I have my cluster up and running, now what?”

Page 36: Microservices kept simple

Centralized logging TelemetryProvisioning automation

Next steps

digitalocean.com

Page 37: Microservices kept simple

Get the output from any container in a central place

Useful for graphs and learning more about your data

ELK stack

Centralized Logging

digitalocean.com

Page 38: Microservices kept simple

Know how your cluster (and apps) is behaving in real time.

AlertingUseful for knowing when to add more

nodes to your cluster.Prometheus, Grafana, Collectd, cAdvisor,

Fluentd

Telemetry

digitalocean.com

Page 39: Microservices kept simple

Automate the steps to get from a droplet to a functioning node on your cluster

Downscaling is important too

Terraform, Ansible, Chef, Puppet

Provisioning automation

digitalocean.com

Page 40: Microservices kept simple

digitalocean.com

Closing notes

Page 41: Microservices kept simple

digitalocean.com

Do the simplest thing you can do to get started.

Page 42: Microservices kept simple

digitalocean.com

All tools have pros and cons, consider the context you are in.

Page 43: Microservices kept simple

Thank you!

Page 44: Microservices kept simple

Questions?