microservices · 2019. 1. 18. · microservices 2018 2. devops introduction — devops is a...

19
Microservices DevOps Microservices 2018 1

Upload: others

Post on 01-Oct-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Microservices · 2019. 1. 18. · Microservices 2018 2. DevOps Introduction — DevOps is a software engineering practice that aims at unifying software development (Dev) and software

MicroservicesDevOps

Microservices 2018 1

Page 2: Microservices · 2019. 1. 18. · Microservices 2018 2. DevOps Introduction — DevOps is a software engineering practice that aims at unifying software development (Dev) and software

Content

1. DevOps Introduction2. Pipeline (continuous integration / continuous delivery /

continuous deployment)3. Popular CI Tools4. Infrastructure as Code

Microservices 2018 2

Page 3: Microservices · 2019. 1. 18. · Microservices 2018 2. DevOps Introduction — DevOps is a software engineering practice that aims at unifying software development (Dev) and software

DevOps Introduction

— DevOps is a software engineering practice that aims at unifying software development (Dev) and software operation (Ops)— People, processes and tools— working together— to enable continuous delivery of

value— to the end users— fast(er)

Cultural change requiredWe just focus on the software delivery process process!

Microservices 2018 3

Page 4: Microservices · 2019. 1. 18. · Microservices 2018 2. DevOps Introduction — DevOps is a software engineering practice that aims at unifying software development (Dev) and software

DevOps - Challenges

— development vs. operation— agile vs. stability— a lot iterations— a lot of releases— monitoring of all services— code quality

Microservices 2018 4

Page 5: Microservices · 2019. 1. 18. · Microservices 2018 2. DevOps Introduction — DevOps is a software engineering practice that aims at unifying software development (Dev) and software

Goals

The goals of DevOps span the entire delivery pipeline.- Improved deployment frequency- Faster time to market- Lower failure rate of new releases- Shortened lead time between fixes- Faster mean time to recovery- Easier onboarding for new developers

Dev: Create Change, Add or modify features

Ops: Create stability, Create or enhance services

Microservices 2018 5

Page 6: Microservices · 2019. 1. 18. · Microservices 2018 2. DevOps Introduction — DevOps is a software engineering practice that aims at unifying software development (Dev) and software

Plan

— general project management tasks— backlog — documentation— scrum planning— Retrospectives— use mvp's – don't develop the hole software without test! (from

lean startup)— event storming, story mappingMicroservices 2018 6

Page 7: Microservices · 2019. 1. 18. · Microservices 2018 2. DevOps Introduction — DevOps is a software engineering practice that aims at unifying software development (Dev) and software

Code

— coding with git (hopefully not with svn anymore)— code reviews

Microservices 2018 7

Page 8: Microservices · 2019. 1. 18. · Microservices 2018 2. DevOps Introduction — DevOps is a software engineering practice that aims at unifying software development (Dev) and software

build

— Continuous Integration— different build tools for your project— package manager

Microservices 2018 8

Page 9: Microservices · 2019. 1. 18. · Microservices 2018 2. DevOps Introduction — DevOps is a software engineering practice that aims at unifying software development (Dev) and software

test

— Code coverage report— automatic test — acceptance testing— Integration testing

Microservices 2018 9

Page 10: Microservices · 2019. 1. 18. · Microservices 2018 2. DevOps Introduction — DevOps is a software engineering practice that aims at unifying software development (Dev) and software

release

— Packaging like building a jar or a docker container— Pre-Deployment-Staging— Release automation

Microservices 2018 10

Page 11: Microservices · 2019. 1. 18. · Microservices 2018 2. DevOps Introduction — DevOps is a software engineering practice that aims at unifying software development (Dev) and software

deploy

— configuration— production staging— Infrastructure as a Code (IaaC)

Microservices 2018 11

Page 12: Microservices · 2019. 1. 18. · Microservices 2018 2. DevOps Introduction — DevOps is a software engineering practice that aims at unifying software development (Dev) and software

operate

— logging— tracing— exception handling— performance monitoring— support / service desk— feature toggles— metrics Microservices 2018 12

Page 13: Microservices · 2019. 1. 18. · Microservices 2018 2. DevOps Introduction — DevOps is a software engineering practice that aims at unifying software development (Dev) and software

DevOps Pipelines

Microservices 2018 13

Page 14: Microservices · 2019. 1. 18. · Microservices 2018 2. DevOps Introduction — DevOps is a software engineering practice that aims at unifying software development (Dev) and software

Automate Almost Everything for Microservice

— The build— database change (flyway) or Events when Event Sourced— deployment to test/staging/production environments— tests— monitoring / remediation plans— Infrastructure as code— Service discovery, DNS, Load Balancing, Auto Scaling, …

Your continuous deployment pipeline should be a model of your process for getting software from version control into the hands of your users.Microservices 2018 14

Page 15: Microservices · 2019. 1. 18. · Microservices 2018 2. DevOps Introduction — DevOps is a software engineering practice that aims at unifying software development (Dev) and software

Popular Pipeline Tools

— Circle CI— Travis CI— GitLab CI— Bamboo— Codeship— Jenkins

Microservices 2018 15

Page 16: Microservices · 2019. 1. 18. · Microservices 2018 2. DevOps Introduction — DevOps is a software engineering practice that aims at unifying software development (Dev) and software

Circle CI Sample

— In Exercise 1 we will use circle ci version: 2jobs: build: docker: # use the docker executor type; machine and macos executors are also supported - image: circleci/node:4.8.2 # the primary container, where your job's commands are run steps: - checkout # check out the code in the project directory - run: echo "hello world" # run the `echo` command

Microservices 2018 16

Page 17: Microservices · 2019. 1. 18. · Microservices 2018 2. DevOps Introduction — DevOps is a software engineering practice that aims at unifying software development (Dev) and software

Infrastructure as Code - History

— In the past, administrators have taken care of each server for its entire lifecycle

— Every server was kind a „piece of art“— Every server hosted a large number of

services— To be able to restore a server,

administrators created full backups of every server (e.g. the /etc directory of Linux servers)

Microservices 2018 17

Page 18: Microservices · 2019. 1. 18. · Microservices 2018 2. DevOps Introduction — DevOps is a software engineering practice that aims at unifying software development (Dev) and software

Introduction - Intro

— Define the configuration of your whole infrastructure as code— Whenever you don’t need a server any more delete it and

restore it if needed (only data backup and code is required)— It’s easy (and required) to put all your infrastructure code into a

version control system— Test your infrastructure code as you test your program code!— New servers can be bootstrapped full-/ or semi-automatic— It doesn’t matter if you’re building a Docker container or if

you’re installing a virtual or physical server – infrastructure code may be applied to all of them

— Focused on managing a large number of servers (instead Microservices 2018 18

Page 19: Microservices · 2019. 1. 18. · Microservices 2018 2. DevOps Introduction — DevOps is a software engineering practice that aims at unifying software development (Dev) and software

IaC Fundamentals

— Server or agent collects facts about target system— Configuration may be applied multiple times leading to the

same result (means no change if not necessary)— Process of applying configuration may be forced — Configuration describes a desired state of a machine

(configuration files, installed packages, existence of users, running services, … )

— Most of the systems abstract the concrete operating system (e.g. the concrete package manager)

— Most of the systems are resource orientated to describe (Packages, Files, Users/Groups, Services)

Microservices 2018 19