46
Monoliths to Microservices Practical Tips For CI, CD and DevOps in the Microservices world @dwmkerr Dave Kerr Senior Expert, McKinsey & Company

Monoliths To Microservices - Practical Tips For CI, CD And DevOps in the Microservice World

Embed Size (px)

Citation preview

Monoliths to MicroservicesPractical Tips For CI, CD and DevOps in the Microservices world

@dwmkerr

Dave Kerr

Senior Expert, McKinsey & Company

Who am I?

@dwmkerr

I am a technology consultant.

@dwmkerr

Which is closer to this…

@dwmkerr

What am I going to talk about?

@dwmkerr

The Project.

@dwmkerr

…or ‘come back WebSphere, all is forgiven’.

2016 – new digital banking

application launched to critical

acclaim

@dwmkerr

Digital garage setup, experienced

product team, streets paved with

gold.

@dwmkerr

An effective product

team will rapidly surface

technological and organisational

issues.

@dwmkerr

I once caught a monolith

thiiiiiiiis big

Solution

Rebuild

Stack

Refresh

105 people

60 devs

5 tech leads

2 architects

9 months

React Native

Node.js

Kubernetes

GraphQL

DevOps 2.0

Hiring

Overhaul

New HR processes

> 50 new hires

Sometimes there are no easy answers…

Extensive

Training

Backend

Frontend

Scrum / Agile

PMO

Let’s talk about this…

@dwmkerr

Our vision is to replace large complicated systems

with small and simple unitsMobile Web

Monolith

Integrator ESB SC

CI/

CD

Art

efa

cts

AP

M

Logs

Core

Card

man

agem

ent

Tran

sfer

s

Frau

d

ATM

sw

itch

Inte

rban

k sw

itch

File

Man

agem

ent

…etc…

Map

/R

edu

ce

…etc…

Spar

k

Data lake

Internal Gateway

API Gateway

Bill paymentsProfile &

preferencesReferralsP2P payments

2FA, TX signing, soft-

Token

Contacts & groups

StatementsDevice

management

CardsIdentity

managementNotifications &

inboxAccounts

& transfers

Mobile Web

Existing server applications

Enterprise integration

Core platforms & databases

Service zones

Devops zone

Analytics zone

ExistingRetired New

Don’t forget to mix in some

People were nervous about all of

the changes…

@dwmkerr

@dwmkerr

Hic sunt dracones.…practical tips for devops in the microservice world…

Tip: Keep pipelines simple

@dwmkerr

Tip: Keep pipelines simple.

Build: turn code into artifacts

Deploy: put artifacts somewhere

@dwmkerr

Source

http://www.dwmkerr.com/simple-continuous-integration-for-docker-images/

Tip: Keep pipelines simple... by embracing make.

Step 1: rip out logic from your build system to create primitive

commands

@dwmkerr

Tip: Keep pipelines simple... by embracing make.

Step 2: call primitive commands from your build system

@dwmkerr

Tip: Keep pipelines simple... by embracing make.

Step 3: when things get complicated, put them into ./scripts

@dwmkerr

Tip: Keep pipelines simple... by embracing make.

Demo

github.com/dwmkerr/beautifully-simple-app-ci

@dwmkerr

Tip: Craft Dockerfiles for your

projects

@dwmkerr

Tip: Craft Dockerfiles for your projects

A project’s baseline image for a Node 8 microservice. Handles: build-time proxies, NPM registry, non-root users,

version tracking and allows the base OS to be changed. This Dockerfile is sneaky – no file system changes, only

instructions for later builds!

Tip: Craft Dockerfiles for your projects

Tip: Craft Dockerfiles for your projects

Demo

github.com/dwmkerr/docker-dynamodb

@dwmkerr

@dwmkerr

Tip: Use the sandbox…and share your toys!

Tip: Use the sandbox

Code Sample

github.com/dwmkerr/terraform-aws-openshift

@dwmkerr

Tip: Use the sandbox

Demo

github.com/dwmkerr/terraform-aws-openshift

@dwmkerr

@dwmkerr

Don’t forget to share your toys!

…it’ll help you find bugs, get more ideas and build a group to

collaborate with.

@dwmkerr

…one more thing…

@dwmkerr

Don’t forget to fall madly in love

with Terraform!

@dwmkerr

Tip: Make a microservice manifest

…say that fast five times…

Tip: Make a microservice manifest

Tip: Make a microservice manifest

Tip: The developer’s machine

comes first

@dwmkerr

Tip: The developer’s machine comes first

• Never sacrifice developer experience

• Use docker-compose liberally

• You should be able to deploy to production from anyone’s machine, as long

as they have credentials

@dwmkerr

Tip: Co-locate code and

deployment configuration

@dwmkerr

Tip: Co-locate microservice code & deployment config

• jenkins / circle / gitlab / whatever

• k8s / openshift / swarm / whatever

• src / test

• README!

@dwmkerr

Tip: Co-locate microservice code & deployment config

If I change the logic for my

healthcheck, does my config change?

@dwmkerr

Tip: Love the shell

@dwmkerr

@dwmkerr

npm install -g tldr

…if I can leave you with one gift

github.com/dwmkerr/effective-shell

Thanks!A lot of this stuff is on my blog and GitHub.

@dwmkerr

dwmkerr.com

github.com/dwmkerr

linkedin.com/in/dwmkerr