für ein halleluja vier deployments...› you will get automatic scaling › you will get continuous...
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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/1.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/2.jpg)
› 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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/3.jpg)
› 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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/4.jpg)
› 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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/5.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/6.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/7.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/8.jpg)
› 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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/9.jpg)
› 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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/10.jpg)
› 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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/11.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/12.jpg)
› 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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/13.jpg)
› 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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/14.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/15.jpg)
› 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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/16.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/17.jpg)
› 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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/18.jpg)
› 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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/19.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/20.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/21.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/22.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/23.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/24.jpg)
› 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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/25.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/26.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/27.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/28.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/29.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/30.jpg)
› 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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/31.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/32.jpg)
› 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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/33.jpg)
› 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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/34.jpg)
› 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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/35.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/36.jpg)
› 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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/37.jpg)
› 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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/38.jpg)
› 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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/39.jpg)
› 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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/40.jpg)
› 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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/41.jpg)
› 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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/42.jpg)
“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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/43.jpg)
› 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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/44.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/45.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/46.jpg)
› 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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/47.jpg)
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](https://reader033.vdocuments.mx/reader033/viewer/2022042303/5ece60b730baae06585bbeb0/html5/thumbnails/48.jpg)
› 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