Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA ....

68
Services for All @MELANIECEBULA / SEPT 2018 / ONS EUROPE How to Empower Engineers (with Kubernetes)

Transcript of Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA ....

Page 1: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

Services for All

@MELANIECEBULA / SEPT 2018 / ONS EUROPE

How to Empower Engineers (with Kubernetes)

Page 2: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

1. A brief history of configuration at Airbnb

2. Generating Kubernetes files

3. Creating a kubectl wrapper

4. Extending and customizing Kubernetes

5. Beyond Kubernetes

Outline

@MELANIECEBULA

Page 3: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

@MELANIECEBULA

Page 4: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

81k 191+ 5 milcountriescities homes

What is airbnb?AN ONLINE MARKETPLACE FOR SHARING HOMES AND EXPERIENCES

@MELANIECEBULA

Page 5: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

Who am I?

@MELANIECEBULA

Page 6: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

A BRIEF HISTORY

Page 7: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

MONOLITH LO C

0

1000000

2000000

3000000

4000000

2009 2010 2011 2012 2013 2014 2015 2016 2017 2018

😳

Why Microservices? @MELANIECEBULA

Page 8: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

ENGINEERING TE AM

0

250

500

750

1000

2009 2010 2011 2012 2013 2014 2015 2016 2017 2018

😲

Why Microservices? @MELANIECEBULA

Page 9: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

S CALING CONTINUOUS DELIVERY

Why Microservices? @MELANIECEBULA

Page 10: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

Why Microservices?

Deploys per week (all apps, all environments)

@MELANIECEBULA

Page 11: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

Why Microservices?

Monolith production deploys per week

@MELANIECEBULA

Page 12: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

120,000production deploys

per year

Why Microservices? @MELANIECEBULA

Page 13: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

Monolith

UI

Splitting the Monolith

Global services

Load Balancer

API Gateway

Server Side Rendering

Data services

@MELANIECEBULA

Page 14: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

Splitting the Monolith

UI

Global services

Load Balancer

API Gateway

Server Side Rendering

Data services

@MELANIECEBULA

Page 15: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

Standardize Service CreationNO SNOWFLAKES

@MELANIECEBULA

Page 16: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

Standardize Service Creation

OKAY BUT HOW?

@MELANIECEBULA

Page 17: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

CONFIGURATION IS KEY

Page 18: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

Evolution of Configuration Management

Manually configuring boxes

Automating configuration of applications with Chef

Automating configuration and orchestration of containerized applications with Kubernetes

@MELANIECEBULA

Page 19: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

KUBERNETES OUT-OF-THE-BOX

Page 20: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

• immutable, reproducible containers

• designed for a microservices architecture

• human-readable format

• declarative

• efficient scheduling

• extensible API

What Makes Kubernetes Awesome

@MELANIECEBULA

Page 21: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

• significant set up cost

• complex configuration and concepts

• tooling is not developer friendly

• open issues

What Makes Kubernetes NOT Awesome

@MELANIECEBULA

Page 22: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

GENERATING KUBERNETES FILES

Page 23: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

P

kubernetes

@MELANIECEBULA

kubectl apply

Production Deployment

Canary Deployment

Production ConfigMap

Canary ConfigMap

Production Service

Canary Service

kubernetes config files

kubernetes cluster

Page 24: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

kubernetes

lots of boilerplate

repetitive by environment

IS REPETITIVE

@MELANIECEBULA

kubectl apply

Production Deployment

Canary Deployment

Production ConfigMap

Canary ConfigMap

Production Service

Canary Service

kubernetes config files

kubernetes cluster

Page 25: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

Project

Apps

Containers

Files

Volumes

Dockerfile

kube-gen

generatekubectl apply

Production Deployment

Canary Deployment

Production ConfigMap

Canary ConfigMap

Production Service

Canary Service

kubernetes cluster

@MELANIECEBULA

Page 26: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

Project

Apps

Containers

Files

Volumes

Dockerfile

kube-gen

generatekubectl apply

Production Deployment

Canary Deployment

Production ConfigMap

Canary ConfigMap

Production Service

Canary Service

kubernetes cluster

kube-gen!@MELANIECEBULA

Page 27: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

@MELANIECEBULA

Project

Apps

Containers

Files

Volumes

Dockerfile

kube-gen

generate

Page 28: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

kube-gen THE PROJECT FILE

@MELANIECEBULA

Project

Apps

Containers

Files

Volumes

Dockerfile

What are the basic attributes of my project?

Page 29: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

kube-gen THE PROJECT FILE

# under _infra/kube/kube-gen.yml

version: 5.1.0

project:

name: bonk

environments:

production:

params:

replicas: 10

port: 6585

staging:

params:

replicas: 2

port: 6586

users:

melanie_cebula

@MELANIECEBULA

Project

Apps

Containers

Files

Volumes

Dockerfile

Page 30: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

kube-gen THE PROJECT FILE

# under _infra/kube/kube-gen.yml

version: 5.1.0

project:

name: bonk

environments:

production:

params:

replicas: 10

port: 6585

staging:

params:

replicas: 2

port: 6586

users:

melanie_cebula

@MELANIECEBULA

Project

Apps

Containers

Files

Volumes

Dockerfile

becomes an admin role binding file!

Page 31: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

kube-gen GENERATED ADMIN

ROLEBINDING FILE

@MELANIECEBULA

Project

Apps

Containers

Files

Volumes

Dockerfile

# under generated/bonk/bonk-production/admin-role-binding.yml

apiVersion: rbac.authorization.k8s.io/v1

kind: RoleBinding

metadata:

creationTimestamp: null

name: bonk—production-admin-role-binding

namespace: bonk-production

roleRef:

apiGroup: rbac.authorization.k8s.io

kind: ClusterRole

name: admin

subjects:

- kind: User

name: melanie_cebula

Page 32: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

kube-gen THE PROJECT FILE

# under _infra/kube/kube-gen.yml

version: 5.1.0

project:

name: bonk

environments:

production:

params:

replicas: 10

port: 6585

staging:

params:

replicas: 2

port: 6586

users:

melanie_cebula

@MELANIECEBULA

Project

Apps

Containers

Files

Volumes

Dockerfile

environments can be accessed by all the

other files!

Page 33: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

• different concepts map to different yaml files under _infra/kube

• environment params defined in the project are accessed with go templating:

• ex: {{ .Env.Params.replicas }}

kube-gen TEMPLATE VARIABLES

# under _infra/kube/apps/bonk.yml

workload:

deployment:

replicas: {{ .Env.Params.replicas }}

strategy:

rollingUpdate

@MELANIECEBULA

Project

Apps

Containers

Files

Volumes

Dockerfile

Page 34: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

kube-gen TEMPLATE VARIABLES

# under _infra/kube/apps/bonk.yml

workload:

deployment:

replicas: {{ .Env.Params.replicas }}

strategy:

rollingUpdate

@MELANIECEBULA

Project

Apps

Containers

Files

Volumes

Dockerfile

from the project file!

• {{ }} signals go templating

• kube-gen will generate all the files for the different environments, and replace each .Env.Params.replicas with the appropriate value from the project file

• ex: staging has 2 replicas, production has 10 replicas

Page 35: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

kube-gen APP FILES

@MELANIECEBULA

Project

Apps

Containers

Files

Volumes

Dockerfile

What kind of workload?

bonk-

web

bonk-

worker

bonk-

cron

example workloads

Page 36: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

kube-gen APP FILES

@MELANIECEBULA

Project

Apps

Containers

Files

Volumes

Dockerfile

# under _infra/kube/apps/bonk-web.yml

workload:

deployment:

{{ if eq .Env.Name “development” }}

strategy:

rollingUpdate:

maxUnavailable: 1

{{ else }}

autoscaling:

minReplicas: {{ .Env.Params.minReplicas }}

maxReplicas: {{ .Env.Params.maxReplicas }}

{{ end }}

Page 37: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

kube-gen COMP ONENTS

@MELANIECEBULA

Project

Apps

Containers

Files

Volumes

Dockerfile

Which shared components to use?

nginx secrets statsd

example components

Page 38: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

kube-gen COMP ONENTS

@MELANIECEBULA

Main Container

Containers

Main App

Volumes

Files

Dockerfile

nginx component

• common patterns are abstracted into a component

• apps enable components

• component yaml merged into project

• may require params to be set

• may set default params

Page 39: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

kube-gen CONTAINER FILES

@MELANIECEBULA

Project

Apps

Containers

Files

Volumes

Dockerfile

What does the container need?

Page 40: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

kube-gen CONTAINER FILES

@MELANIECEBULA

Project

Apps

Containers

Files

Volumes

Dockerfile

• image to use

• command and args to run

• ENV variables to pass in

• resource requests and limits for container

• file and volume mounts used by this container

Page 41: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

kube-gen OTHER FILES

@MELANIECEBULA

Project

Apps

Containers

Files

Volumes

Dockerfile

These can be mounted into your containers

Page 42: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

kube-gen OTHER FILES

@MELANIECEBULA

Project

Apps

Containers

Files

Volumes

DockerfileThe main Dockerfile for the

project (installs needed dependencies)

Page 43: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

KUBECTL WRAPPER

Page 44: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

kubernetes

@MELANIECEBULA

kubectl apply

Production Deployment

Canary Deployment

Production ConfigMap

Canary ConfigMap

Production Service

Canary Service

kubernetes config files

kubernetes cluster

Page 45: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

kubectl IS VERBOSE

@MELANIECEBULA

kubectl apply

Production Deployment

Canary Deployment

Production ConfigMap

Canary ConfigMap

Production Service

Canary Service

kubernetes config files

kubernetes cluster

verbose

repetitive by namespace

Page 46: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

k tool KUBECTL WRAPPER

@MELANIECEBULA

k tool kubectl apply

Production Deployment

Canary Deployment

Production ConfigMap

Canary ConfigMap

Production Service

Canary Service

kubernetes config files

kubernetes cluster

Page 47: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

k tool THE ALL PURP OSE CLI WRAPPER

@MELANIECEBULA

Page 48: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

• Runs in the project home directory: $ cd /path/to/bonk $ k status

• Environment variables for arguments:

$ k status ENV=staging $ export ENV=staging $ k status

• Prints the command that it will execute: $ k status ENV=staging

kubectl get pods --namespace=bonk-staging

k tool USES ENV VARS

@MELANIECEBULA

Page 49: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

• k generate transforms kube-gen files to kubernetes files

• k build performs docker build and docker push with tags

• k deploy creates namespace, applies/replaces kubernetes files, sleeps and checks deployment status

• can chain commands; ex: k all

k tool SIMPLIFIES BUILD AND DEPLOYS

@MELANIECEBULA

Page 50: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

• defaults to random pod, main container:

$ k ssh ENV=staging• specify particular pod, specific container:

$ k logs ENV=staging POD=… CONTAINER=statsd-proxy• k diagnose: shows status and logs for each failing

container of your pod, and shows failure events•

k tool A DEBUG GING TO OL

@MELANIECEBULA

Page 51: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

EXTENDING KUBERNETES

Page 52: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

• admission controller:

- require project ownership (via annotations)

- prevent namespace creation under incorrect cluster

- prevent deployment of objects with known security holes

• deployment pruner:

- automatically rotate old pods

- rotates over-provisioned availability zones

@MELANIECEBULA

Extending Kubernetes WITH CUSTOM CONTROLLERS

Page 53: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

• it is a common anti-pattern for clients of a service to not retry on connection failures

• as a k8s service deploys, requests may be sent to terminating pods and cause a spike in 500s

• use graceful termination to mitigate this

@MELANIECEBULA

Extending Kubernetes WITH GRACEFUL TERMINATION

Page 54: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

@MELANIECEBULA

Extending Kubernetes WITH GRACEFUL TERMINATION

# under _infra/kube/apps/bonk.yml

# wait up to 180 seconds before “kill -9” the pods

terminationGracePeriodSeconds: 180

# under _infra/kube/containers/container.yml

# wait up to 120 seconds before shutting down

lifecycle:

preStop:

exec:

command:

- /bin/sleep

- “120”

Page 55: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

@MELANIECEBULA

Extending Kubernetes WITH GRACEFUL TERMINATION

# under _infra/kube/apps/bonk.yml

# wait up to 180 seconds before “kill -9” the pods

terminationGracePeriodSeconds: 180

# under _infra/kube/containers/container.yml

# wait up to 120 seconds before shutting down

lifecycle:

preStop:

exec:

command:

- /bin/sleep

- “120”

this gives our service discovery container time

to mark this pod as unhealthy

Page 56: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

@MELANIECEBULA

Extending Kubernetes WITH GRACEFUL TERMINATION

# under _infra/kube/apps/bonk.yml

# wait up to 180 seconds before “kill -9” the pods

terminationGracePeriodSeconds: 180

# under _infra/kube/containers/container.yml

# wait up to 120 seconds before shutting down

lifecycle:

preStop:

exec:

command:

- /bin/sleep

- “120”

you can do more sophisticated server shutdown here too!

Page 57: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

@MELANIECEBULA

Extending Kubernetes WITH GRACEFUL TERMINATION

# under _infra/kube/apps/bonk.yml

# wait up to 180 seconds before “kill -9” the pods

terminationGracePeriodSeconds: 180

# under _infra/kube/containers/container.yml

# wait up to 120 seconds before shutting down

lifecycle:

preStop:

exec:

command:

- /bin/sleep

- “120”

after the preStop command finishes, the

containers have an additional 60sec to exit

gracefully

Page 58: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

BEYOND KUBERNETES

Page 59: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

Creating a new service (before)@MELANIECEBULA

Page 60: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

Everything about a service should be in one place, and managed with one

process.

Page 61: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

Everything you need to know about your service can be found in one place

• All configuration lives in _infra alongside project code • Edit code and configuration with one pull request • Easy to add new configuration • Configuration statically validated as part of CI

Configuration LIVES IN ONE PLACE

@MELANIECEBULA

Page 62: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

What we support:

• kube-gen files • continuous integration files (with containers) • documentation (markdown) • databag secrets and keys • development (legacy) • AWS IAM roles • internal tool configuration (UI/UX) • legacy service discovery configuration • project ownership and metadata • .. and more!

Configuration LIVES IN ONE PLACE

@MELANIECEBULA

Page 63: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

A single deploy process for every change

Write code and config under your project

Open a PR and merge your code to master

Deploy all changes atomically

Develop DeployMerge

@MELANIECEBULA

Page 64: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

GENERATING SERVICE BOILERPLATE

Page 65: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

• generators make best practices the default

• collection of config generators and language-specific generators

• uses thor for better control (update, review, commit)

• set up a “hello world” service with just one command

Reduce service boilerplateWITH GENERATORS!

@MELANIECEBULA

Page 66: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

Reduce time to “hello world”

2 weeks 2 minutes

@MELANIECEBULA

Page 67: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting

• Store configuration alongside project code

• Abstract away your infrastructure with generators

• Abstract away complex tooling with a wrapper CLI

• Configuration and tools should set defaults

• Standardize on one process for storing and applying configuration changes

Takeaways@MELANIECEBULA

Page 68: Services for All · Why Microservices? Monolith production deploys per week @MELANIECEBULA . 120,000 production deploys per year Why Microservices? @MELANIECEBULA . Monolith UI Splitting