Top Banner
Vier Deployments für ein Halleluja Michael Bruns Karlsruher Entwicklertag, 04.06.2019 Aus dem Leben eines Softwaretherapeuten
48

für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

May 25, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

Vier Deploymentsfür ein Halleluja

Michael Bruns Karlsruher Entwicklertag, 04.06.2019

Aus dem Lebeneines Softwaretherapeuten

Page 2: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

› Real-life conversation from a project:

› Manager: “We need Microservices!”

› Me: “Ok. Why?”

› Manager: “Err…”

› Me: “Did you at least talk to Dev and Ops?”

› Manager: “Err…”

2Vier Deployments für ein Halleluja

Let’s start with a story...

Page 3: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

› Real-life conversation from a project:

› Me: “Can we operate the VMs with our team?”

› Manager: “No, the Ops team does that.”

› Me: “Can we shift people from the Ops team to our team?”

› Manager: “No.”

› Me: “Ok… Then I need to talk to the Ops team.”

› Manager: “You can’t, they’re too busy with their roadmap.”

3Vier Deployments für ein Halleluja

Let’s start with a story...

Page 4: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

› Real-life conversation from a project:

› Me: “We need two small VMs, one per data center.”

› Ops: “We don’t do it that way. You’ll get three perdata-center, 64 GB RAM and 6 CPUs each.”

› Me: “What?! Well, alright... Is it possible to get themby this afternoon?”

› Ops: “Nah, average delivery time is eight weeks.”

4Vier Deployments für ein Halleluja

Let’s start with a story...

Page 5: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

5Vier Deployments für ein Halleluja

Please allow me to introduce myself:

› Software developer, architect, therapist, teamlead, ...

› Loves boring solutions

› Twitter: @der_miggel

Michael Bruns

inovex GmbH

Page 6: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

6Vier Deployments für ein Halleluja

Example architecture from a project

AuthRegistration PlayoutEPG Recording

Users Streaming

......

ThirdParty

...

Page 7: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

7Vier Deployments für ein Halleluja

How do people use it?

20:15

› Anybody who likes working at 20:15every day?

› Including and especially on weekends?

Page 8: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

› Q: How many people watched Tatort on 27 May 2018?

› A: 12.00m

› Q: What’s the market share of this?

› A: 37.8%

8Vier Deployments für ein Halleluja

A short quiz

(Source: http://bit.ly/2S2Ya4v)

Page 9: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

› Don’t build a platform, use one: AWS, Azure, GCP, ...

› Use what’s already there

› Add shared stuff (e.g. JVM, nginx) to base image (AMI)

› Leave the rest to the services

9Vier Deployments für ein Halleluja

How did we build it?

Page 10: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

› Foster DevOps, i.e. tear down all political and technological barriers

› Make infrastructure reproducible

› Choose the right tool for the job:Terraform, GitLab CI, Prometheus, …

10Vier Deployments für ein Halleluja

How did we build it?

Page 11: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

11Vier Deployments für ein Halleluja

Use the right tool for the job...

...and use it wisely!

Page 12: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

› Infrastructure as Code

› Independent of provider (AWS, Azure, OpenStack, …)

› Reproducible

› Multi-cloud strategy is possible

› https://www.terraform.io/

12Vier Deployments für ein Halleluja

Terraform

Page 13: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

› Continuous Integration & Deployment

› Pipelines

› Stages, environments, variables, tags, …

› Easy integration of runners

13Vier Deployments für ein Halleluja

GitLab CI

Page 14: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

14Vier Deployments für ein Halleluja

The whole pipeline

Local GitRepo

GitLabRepo

GitLab CI Build(Gradle,

Leiningen, …)

GitLab CIDeployment

(Terraform)

Dev

GitLab CIDeployment(Terraform)

GitLab CIDeployment(Terraform)

Preview Prod

auto auto

manually / auto manually

GitLab CITests

auto

GitLab CITests

auto

Page 15: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

› Launch Configuration for services

› Automatic scaling of services based on

› Network/CPU usage

› Number of requests

› Schedules

15Vier Deployments für ein Halleluja

Automatic scaling

Page 16: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

16Vier Deployments für ein Halleluja

Automatic scaling - Example on AWS

Page 17: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

› Fact 1: If 500 customers record a show, 500 copies of the show have to be made

› Fact 2: Shows are recorded 10 minutes “too long”

› Q: Which two shows put the highest load on the recording backend because they overlapped?

› A: Der Bachelor and Ich bin ein Star, holt mich hier raus

17Vier Deployments für ein Halleluja

Another short quiz

Page 18: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

› Loosely coupled, small services

› Isolated from each other

› Supposed to fit into your head

› But what if they don’t just because of the sheer number of services?!

18Vier Deployments für ein Halleluja

“Micro”services

Page 19: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

19Vier Deployments für ein Halleluja

Microservices - Some anti-patterns

(Source: https://www.flickr.com/photos/frans16611/9138604666)

The more the merrier

Page 20: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

20Vier Deployments für ein Halleluja

Microservices - Some anti-patterns

Microservices as the panacea

Page 21: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

21Vier Deployments für ein Halleluja

Microservices - Some anti-patterns

(Source: https://pxhere.com/en/photo/1364310)

Microservices as the goal of a project

Page 22: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

22Vier Deployments für ein Halleluja

Microservices - Some anti-patterns

(Source: https://pxhere.com/de/photo/181542)

Scattershot approach

Page 23: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

23Vier Deployments für ein Halleluja

Microservices - Some anti-patterns

(Source: https://funnycrazyanimals.blogspot.com/2009/01/crash-landing-duck-in-snow-pic.html)

Flying before you learned to walk

Page 24: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

› You will get automatic scaling

› You will get continuous delivery

› You will get a better distribution

24Vier Deployments für ein Halleluja

Unmaintainable monolith in the cloud

(of errors)

(of a big ball of mud)

(of the stuff you already

didn’t know how to debug before and which you now can’t even find because you aren’t writing the logs to a central store yet and once the machine is gone all logs are gone and now you sit in your office yelling and…)

Page 25: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

25Vier Deployments für ein Halleluja

Source: https://twitter.com/davecheney/status/1125288279044120576

Diagram of two microservices

and their shared database

Page 26: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

Don’t put your unmaintainable monolith

into the cloud and expect things to get better!

26Vier Deployments für ein Halleluja

Most important advice

Page 27: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

27Vier Deployments für ein Halleluja

Just deploy it to Kubernetes!

Source: https://twitter.com/ryanhuber/status/1108498814854283264

Page 28: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

28Vier Deployments für ein Halleluja

The Turducken - Creation

http://www.seriouseats.com/2012/11/the-food-lab-the-ulimate-turducken.html

Page 29: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

29Vier Deployments für ein Halleluja

The Turducken - Result

http://www.seriouseats.com/2012/11/the-food-lab-the-ulimate-turducken.html

Page 30: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

› Kubernetes & Docker is a cloud in the cloud

› It adds several layers of abstraction

› You should prepare the interior first, and add the outer layers when you know how the interior works

› It takes an experienced person to handle it

30Vier Deployments für ein Halleluja

The Turducken - My two cents on containers

Page 31: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

31Vier Deployments für ein Halleluja

Source: https://twitter.com/QuinnyPig/status/1121462122741940226

Page 32: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

› A lot of the things I talked about so farare just tools

› A fool with a tool is still a fool

› Tools won’t fix your people issues

32Vier Deployments für ein Halleluja

The bad news

Page 33: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

› 2%: Because they want fame

› 8%: Because they want money

› 12%: Because they want to have fun when coding

› 78%: Because they want to interact with people

33Vier Deployments für ein Halleluja

Why do people become developers?

F A K E !

Page 34: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

› Talk to each other

› Take responsibility

› Don’t point your finger at someone

› Don’t fall into this trap:“Weeks of coding can save you hours of planning!”

34Vier Deployments für ein Halleluja

The social aspects

Page 35: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

35Vier Deployments für ein Halleluja

Source: https://twitter.com/davecheney/status/1125288279044120576

Page 36: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

› Firefighter for bugs or urgent issues

› Take turns

› Create an easy way to notify theperson in charge (e.g. @firefighter)

› Don’t be afraid to ask for help

36Vier Deployments für ein Halleluja

Share the operational load

Page 37: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

› Be open for constant change

› However, don’t change everything just because you can

› Sometimes legacy is not necessarily a bad thing

› Some changes might have consequences you don’t expect

37Vier Deployments für ein Halleluja

Embrace change

Page 38: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

› Create a central board to request improvements

› Let the team make decisions which improvements are

most important

› Accept if the others think that your suggestion isn’t useful

38Vier Deployments für ein Halleluja

Track change

Page 39: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

› Repeat these sentences ten times every day:

› We are not Netflix

› We are not Google

› We are not Facebook

› We are not Spotify

39Vier Deployments für ein Halleluja

The Mantra

Page 40: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

› Don’t build a single point of failure

› Couple your services not as loosely as possible,

but as loosely as feasible

› Do you really need Kafka, Event Sourcing, CQRS, Service Mesh, …?

40Vier Deployments für ein Halleluja

Coupling services

Page 41: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

› ALARM! ALAHAARM!

› Send alarms to Slack/Teams/…

› Use tools like Grafana to reviewchanges in the load, requests etc.

41Vier Deployments für ein Halleluja

Monitor your services

Page 42: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

“One common anti-pattern when introducing DevOps to an organization is to assign someone the role of 'DevOps' or to call a team a 'DevOps team'. Doing so perpetuates the kinds of silos that DevOps aims to break down and prevents DevOps culture and practices from spreading and being adopted by the wider organization.”

(Rouan Wilsenach, https://martinfowler.com/bliki/DevOpsCulture.html)

42Vier Deployments für ein Halleluja

DevOps - How not to do it

Page 43: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

› There’s this one person constantly calling me at the most awkward times because something isn’t working:

44Vier Deployments für ein Halleluja

The fear of DevOps

› But my mum’s phone not working the way she wants it to work has nothing to do with DevOps!

Of course this isn’t really my mum!And her calls are perfectly fine.

Page 44: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

45Vier Deployments für ein Halleluja

Another real-life conversation

› Dev 1: “We need to update service X to fix issue Y.”

› Dev 2: “Meh. We haven’t touched it for ages. We haven’t

updated the CI pipeline. I have absolutely no idea if the deployment still works. Dev 3 built this in 2015 and he’s on vacation.”

› That’s not DevOps, that’s DevOops

Page 45: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

46Vier Deployments für ein Halleluja

One final note...

➔ ➔

Page 46: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

› Wear a helmet when riding your bike, i.e.:

› Expect failure

› The person to trust least is you

› Accept help

48Vier Deployments für ein Halleluja

One final note...

Page 47: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

Vielen Dank

Michael Bruns

inovex GmbH

Ludwig-Erhard-Allee 6

76131 Karlsruhe

[email protected]: @der_miggel

Page 48: für ein Halleluja Vier Deployments...› You will get automatic scaling › You will get continuous delivery › You will get a better distribution Vier Deployments für ein Halleluja

› Inspiration for anti-patterns: https://microservices.io//microservices/general/2018/11/04/potholes-in-road-from-monolithic-hell.html

51Vier Deployments für ein Halleluja

Links