microservices und docker - w3ldocker-Ökosystem docker hub docker swarm kubernetes und openshift...

32
Microservices und Docker

Upload: others

Post on 25-May-2020

129 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Microservices und Docker - W3LDocker-Ökosystem Docker Hub Docker swarm Kubernetes und OpenShift Native Unterstützung in AWS, Azure und Goolge Cloud Windows und Linux Linux-Container

Microservices und Docker

Page 2: Microservices und Docker - W3LDocker-Ökosystem Docker Hub Docker swarm Kubernetes und OpenShift Native Unterstützung in AWS, Azure und Goolge Cloud Windows und Linux Linux-Container

2

Agenda

Einführung in Microservices

Vor- und Nachteile

DevOps

Docker

Microsofts Referenzbeispiel

Fazit

Page 3: Microservices und Docker - W3LDocker-Ökosystem Docker Hub Docker swarm Kubernetes und OpenShift Native Unterstützung in AWS, Azure und Goolge Cloud Windows und Linux Linux-Container

3

Einführung Was sind Microservices?

Page 4: Microservices und Docker - W3LDocker-Ökosystem Docker Hub Docker swarm Kubernetes und OpenShift Native Unterstützung in AWS, Azure und Goolge Cloud Windows und Linux Linux-Container

4

Wer setzt auf Microservices?

Page 5: Microservices und Docker - W3LDocker-Ökosystem Docker Hub Docker swarm Kubernetes und OpenShift Native Unterstützung in AWS, Azure und Goolge Cloud Windows und Linux Linux-Container

5

Definition

The term "Microservice Architecture" has sprung up over the last few years to describe a particular way of designing software applications as suites of independently deployable services. While there is no precise

definition of this architectural style, there are certain common characteristics around organization around business capability,

automated deployment, intelligence in the endpoints, and decentralized control of languages and data.

Martin Fowler; https://martinfowler.com/articles/microservices.html

Microservices sind ein Architekturmuster der Informationstechnik, bei dem komplexe Anwendungssoftware aus unabhängigen Prozessen komponiert

wird, die untereinander mit sprachunabhängigen Programmierschnittstellen kommunizieren. Die Dienste sind weitgehend entkoppelt und erledigen eine

kleine Aufgabe. So ermöglichen sie einen modularen Aufbau von Anwendungssoftware.

https://de.wikipedia.org/wiki/Microservices

Page 6: Microservices und Docker - W3LDocker-Ökosystem Docker Hub Docker swarm Kubernetes und OpenShift Native Unterstützung in AWS, Azure und Goolge Cloud Windows und Linux Linux-Container

6

Was wollen wir erreichen?

Page 7: Microservices und Docker - W3LDocker-Ökosystem Docker Hub Docker swarm Kubernetes und OpenShift Native Unterstützung in AWS, Azure und Goolge Cloud Windows und Linux Linux-Container

7

Philosophie

Fachliche Services (Single Resposibility)

Lose Kopplung

Domain-driven-design / Bounded-Context

1 Team (5 bis 7 Entwickler)

Fachlicher Nutzen im Vordergrund

Eine Persistenzschicht

Hoher Freiheitsgrad in der Technologiewahl

Technologie ist versteckt (REST)

Autarkes publizieren

Dezentral

Hochgradig skalierbar

Diskussionspunkte: Fullstack und Größe

Page 8: Microservices und Docker - W3LDocker-Ökosystem Docker Hub Docker swarm Kubernetes und OpenShift Native Unterstützung in AWS, Azure und Goolge Cloud Windows und Linux Linux-Container

8

Microservices

App1

https://goo.gl/MyYg4W

App1 App2 Fotofilter

Benutzerverwaltung

Kommentare

Page 9: Microservices und Docker - W3LDocker-Ökosystem Docker Hub Docker swarm Kubernetes und OpenShift Native Unterstützung in AWS, Azure und Goolge Cloud Windows und Linux Linux-Container

9

Viele „neue“ Komponenten

Dezentrales Logging

ElasticSearch, Fluentd, Kibana…

KeyValue-Datenbanken für Caches

REDIS, Memcached

MessageBus-Systeme für Kommunikation

RabbitMQ

LoadBalancer

Service Discovery

Monitoring

Icinga, AppMetric, Grafana

Authentifizierung und Autorisierung

(Geschäfts)Prozesse

Page 10: Microservices und Docker - W3LDocker-Ökosystem Docker Hub Docker swarm Kubernetes und OpenShift Native Unterstützung in AWS, Azure und Goolge Cloud Windows und Linux Linux-Container

10

Nachteile von Microservices (i.V. zu Monolithen)

Erheblicher Infrastrukturaufwand

Logging, Monitoring usw.

Völlig neue Probleme

Netzwerklatenzen

Resilienz

Art der Softwareentwicklung ändert sich

Testen wird komplexer und aufwändiger

Versionierung und „zerfleddern“ der Landschaft

Deployment

Session-Handling

Dezentrale Kommunikation

Viele kleine, neue Infrastrukturkomponenten

Page 11: Microservices und Docker - W3LDocker-Ökosystem Docker Hub Docker swarm Kubernetes und OpenShift Native Unterstützung in AWS, Azure und Goolge Cloud Windows und Linux Linux-Container

11

Vorteile von Microservices (i.V. zu Monolithen)

Neue fachliche Anforderungen schnell umsetzen

Teams arbeiten autark

passt perfekt zur agilen Entwicklung

Geringere Einarbeitungszeit

Unabhängige Skalierung

Dienste können passgenau (automatisch) skaliert

werden

Kein Overhead wie bei Monolithen

Bessere Ausnutzung bestehender Ressourcen

Schnelle Adaption neuer Technologien möglich

.NET Core, NodeJS, neuste Java-Version...

Architektur bleibt langfristig stabiler (vgl. mit Monolithen)

Page 12: Microservices und Docker - W3LDocker-Ökosystem Docker Hub Docker swarm Kubernetes und OpenShift Native Unterstützung in AWS, Azure und Goolge Cloud Windows und Linux Linux-Container

12

DevOps

Page 13: Microservices und Docker - W3LDocker-Ökosystem Docker Hub Docker swarm Kubernetes und OpenShift Native Unterstützung in AWS, Azure und Goolge Cloud Windows und Linux Linux-Container

13

Was ist DevOps?

Analyse Design Entwicklung QS Release Depoy Betrieb Messung / Monitoring

Continuous Integration Integration

Agile Entwicklung

Continuous Delivery

DevOps

Page 14: Microservices und Docker - W3LDocker-Ökosystem Docker Hub Docker swarm Kubernetes und OpenShift Native Unterstützung in AWS, Azure und Goolge Cloud Windows und Linux Linux-Container

14

Feedbackschleifen

Check-in trigger

Feedback: Build-Fehler

Check-in trigger löst aus

Feedback: Unit-Test schlägt fehl

Check-in trigger löst aus baut

Feedback: erfolgreich auf http://qs-stage deployed

Page 15: Microservices und Docker - W3LDocker-Ökosystem Docker Hub Docker swarm Kubernetes und OpenShift Native Unterstützung in AWS, Azure und Goolge Cloud Windows und Linux Linux-Container

15

Staging-Umgebungen

ENTW-Umgebung

Staging-Umgebung

Produktivumgebung

Develop Release Master

QS-Umgebung

feature/w

feature/x

feature/y

feature/z

V1.0

V1.0rc1

feature/v

Page 16: Microservices und Docker - W3LDocker-Ökosystem Docker Hub Docker swarm Kubernetes und OpenShift Native Unterstützung in AWS, Azure und Goolge Cloud Windows und Linux Linux-Container

16

Docker

Page 17: Microservices und Docker - W3LDocker-Ökosystem Docker Hub Docker swarm Kubernetes und OpenShift Native Unterstützung in AWS, Azure und Goolge Cloud Windows und Linux Linux-Container

17

Deployment-Hölle

Entwicklungs-VM

Testserver Prodsystem Staging-system

Vertriebs-laptop

On Premise

Frontend ??? ??? ??? ??? ??? ???

Identity service & DB

??? ??? ??? ??? ??? ???

Catalog service & DB

??? ??? ??? ??? ??? ???

Ordering service & DB

??? ??? ??? ??? ??? ???

Basket service & DB

??? ??? ??? ??? ??? ???

Marketing service & DB

MySQL MSSQL MSSQL MSSQL MySQL ???

EventBus RabbitMQ RabbitMQ Azure

ServiceBus Azure

ServiceBus RabbitMQ ???

Page 18: Microservices und Docker - W3LDocker-Ökosystem Docker Hub Docker swarm Kubernetes und OpenShift Native Unterstützung in AWS, Azure und Goolge Cloud Windows und Linux Linux-Container

18

Docker vs. virtuelle Maschinen

https://goo.gl/8fPPf1

Infrastruktur

Betriebssystem

Hypervisor

Gast-OS

Gast-OS

Gast-OS

Konfiguration

Monitoring

Libs

App

Libs

App

Libs

App

Infrastruktur

Betriebssystem

Docker-Engine

Libs

App

Libs

App

Libs

App

Page 19: Microservices und Docker - W3LDocker-Ökosystem Docker Hub Docker swarm Kubernetes und OpenShift Native Unterstützung in AWS, Azure und Goolge Cloud Windows und Linux Linux-Container

19

Wie funktioniert Docker?

https://goo.gl/8fPPf1

Bibliotheken

App

Bibliotheken App

Debian + Tomcat + Java

Docker Engine

Debian + Apache + PHP

Bibliotheken

App

Debian + Apache + PHP

Bibliotheken

App

Debian + Apache + PHP

Bibliotheken

App

Mappe Port 80 intern auf 80 extern Mappe /wwwroot auf c:\c2\shop Erstelle Netzwerk für C1 und C2

Dockerfile Docker-compose.yml

Page 20: Microservices und Docker - W3LDocker-Ökosystem Docker Hub Docker swarm Kubernetes und OpenShift Native Unterstützung in AWS, Azure und Goolge Cloud Windows und Linux Linux-Container

20

Wie funktioniert Docker?

https://goo.gl/8fPPf1

Dockerfile

Betriebssystem

Docker

Betriebssystem

Docker

Conta

iner A

Conta

iner B

Conta

iner C

Conta

iner A

Imageconverter v1.2

- Java 8

- Imagemagick 6.9.9

Imageconverter v0.9

- Java 6

- Imagemagick 5.2.1

Page 21: Microservices und Docker - W3LDocker-Ökosystem Docker Hub Docker swarm Kubernetes und OpenShift Native Unterstützung in AWS, Azure und Goolge Cloud Windows und Linux Linux-Container

21

Deployment-Hölle

Entwicklungs-VM

Testserver Prodsystem Staging-system

Vertriebs-laptop

On Premise

Frontend ??? ??? ??? ??? ??? ???

Identity service & DB

??? ??? ??? ??? ??? ???

Catalog service & DB

??? ??? ??? ??? ??? ???

Ordering service & DB

??? ??? ??? ??? ??? ???

Basket service & DB

??? ??? ??? ??? ??? ???

Marketing service & DB

MySQL MSSQL MSSQL MSSQL MySQL ???

EventBus RabbitMQ RabbitMQ Azure

ServiceBus Azure

ServiceBus RabbitMQ ???

Page 22: Microservices und Docker - W3LDocker-Ökosystem Docker Hub Docker swarm Kubernetes und OpenShift Native Unterstützung in AWS, Azure und Goolge Cloud Windows und Linux Linux-Container

22

Deployment-Hölle

Entwicklungs-VM

Testserver Prodsystem Staging-system

Vertriebs-laptop

On Premise

Frontend

Identity service & DB

Catalog service & DB

Ordering service & DB

Basket service & DB

Marketing service & DB

EventBus

Page 23: Microservices und Docker - W3LDocker-Ökosystem Docker Hub Docker swarm Kubernetes und OpenShift Native Unterstützung in AWS, Azure und Goolge Cloud Windows und Linux Linux-Container

23

Docker-Ökosystem

Docker Hub

Docker swarm

Kubernetes und OpenShift

Native Unterstützung in AWS, Azure und Goolge Cloud

Windows und Linux

Linux-Container laufen überall

Windows

… Microsoft .NET Core läuft überall!

Page 24: Microservices und Docker - W3LDocker-Ökosystem Docker Hub Docker swarm Kubernetes und OpenShift Native Unterstützung in AWS, Azure und Goolge Cloud Windows und Linux Linux-Container

24

Ein Beispiel von Microsoft

Page 25: Microservices und Docker - W3LDocker-Ökosystem Docker Hub Docker swarm Kubernetes und OpenShift Native Unterstützung in AWS, Azure und Goolge Cloud Windows und Linux Linux-Container

25

Microsofts Referenzbeispiel

https://goo.gl/MyYg4W 25 Prozesse!

Page 26: Microservices und Docker - W3LDocker-Ökosystem Docker Hub Docker swarm Kubernetes und OpenShift Native Unterstützung in AWS, Azure und Goolge Cloud Windows und Linux Linux-Container

26

Microsofts Referenzbeispiel

https://goo.gl/MyYg4W

Page 27: Microservices und Docker - W3LDocker-Ökosystem Docker Hub Docker swarm Kubernetes und OpenShift Native Unterstützung in AWS, Azure und Goolge Cloud Windows und Linux Linux-Container

27

Von der Testumgebung in die Produktivumgebung

https://goo.gl/MyYg4W

Page 28: Microservices und Docker - W3LDocker-Ökosystem Docker Hub Docker swarm Kubernetes und OpenShift Native Unterstützung in AWS, Azure und Goolge Cloud Windows und Linux Linux-Container

28

Visual Studio Projektmappe

https://goo.gl/MyYg4W

Page 29: Microservices und Docker - W3LDocker-Ökosystem Docker Hub Docker swarm Kubernetes und OpenShift Native Unterstützung in AWS, Azure und Goolge Cloud Windows und Linux Linux-Container

29

Fazit

Microservices lösen Probleme

Skalierbarkeit der Applikation

Skalierbarkeit des Entwicklungsprozesses

Technologieunabhängigkeit

Und schaffen neue

Erheblich (!) komplexere Infrastruktur

Viel neues Wissen und Erfahrung notwendig

Microservices-Hype erinnert an NoSQL-Datenbanken

Sinnvolles, neues Architekturmuster

Page 30: Microservices und Docker - W3LDocker-Ökosystem Docker Hub Docker swarm Kubernetes und OpenShift Native Unterstützung in AWS, Azure und Goolge Cloud Windows und Linux Linux-Container

30

Literatur

eBooks von Microsoft

https://github.com/dotnet-

architecture/eShopOnContainers

microservices.io

Buchempfehlungen

Microservice Patterns; Chris Richardson; Manning-

Verlag

Building Microservices; Sam Newman; O‘Reilly-Verlag

Page 31: Microservices und Docker - W3LDocker-Ökosystem Docker Hub Docker swarm Kubernetes und OpenShift Native Unterstützung in AWS, Azure und Goolge Cloud Windows und Linux Linux-Container

31

Weitere Bildquellen

TODO

https://www.google.de

https://amazon.de

https://twitter.com

https://docker.com

https://www.zalando.de

https://www.netflix.com/de

https://www.otto.de

https://git-scm.com/

https://www.spotify.com/de/

https://soundcloud.com

https://ebay.de

https://nunit.org

https://www.seleniumhq.org/

https://twitter.com/laurelcomics/status/604037071917826050

Page 32: Microservices und Docker - W3LDocker-Ökosystem Docker Hub Docker swarm Kubernetes und OpenShift Native Unterstützung in AWS, Azure und Goolge Cloud Windows und Linux Linux-Container

32

Dr. Hendrik Neumann

Leiter Competence Center BPS

Tel. 0231/61804143

Mail: [email protected]

Vielen Dank!

W3L AG

[email protected]

2019