Upgrade to Pro — share decks privately, control downloads, hide ads and more …

A Hitchhiker’s Guide to the Cloud Native Stack. #ContainerConf

A Hitchhiker’s Guide to the Cloud Native Stack. #ContainerConf

Cloud companies like Google, Twitter and Netflix have made the core building blocks of their infrastructure open source. As a result, their experience from several years is publicly available and everyone can now build cloud native applications – applications that run in the cloud reliably und scale almost arbitrarily. The individual open-source components have grown together to form something new: the cloud native stack. Cloud native applications follow three key principles: they are built and composed as microservices. They are packaged and distributed in containers. The containers are executed dynamically in the cloud. But which technology is best to build this kind of application? This talk will be your guidebook.

M.-Leander Reimer

November 16, 2016
Tweet

More Decks by M.-Leander Reimer

Other Decks in Programming

Transcript

  1. | ContainerConf 2016 | A Hitchhiker’s Guide to the Cloud

    Native Stack | @LeanderReimer #cloudnativenerd #qaware A HITCHHIKER’S GUIDE TO THE CLOUD NATIVE STACK 1
  2. | ContainerConf 2016 | A Hitchhiker’s Guide to the Cloud

    Native Stack | @LeanderReimer #cloudnativenerd #qaware Let’s talk about Cloud Native Applications 2
  3. CONTINUOUS
 DELIVERY & DEVOPS ANTIFRAGILITY HYPERSCALE 
 TRAFFIC, DATA, FEATURES

    OPEX SAVINGS
 (automation & utilization) CLOUD NATIVE APPLICATIONS DISRUPT INDUSTRIALIZE
  4. | ContainerConf 2016 | A Hitchhiker’s Guide to the Cloud

    Native Stack | @LeanderReimer #cloudnativenerd #qaware Design Prinzipien Cloud-nativer Anwendungen • Design for Performance: responsive; concurrency; efficiency. • Design for Automation: automate dev tasks & ops tasks. • Design for Resiliency: fault-tolerant; self-healing. • Design for Elasticity: dynamically scale; be reactive. • Design for Delivery: short roundtrips; automated delivery. • Design for Diagnosability: cluster-wide logs, traces, metrics. 4
  5. | ContainerConf 2016 | A Hitchhiker’s Guide to the Cloud

    Native Stack | @LeanderReimer #cloudnativenerd #qaware Maturity Model Cloud-nativer Anwendungen 5 https://www.opendatacenteralliance.org/docs/architecting_cloud_aware_applications.pdf Level 0: Virtualized Level 1: Loosely Coupled Level 2: Abstracted Level 3: Adaptive Cloud Native - Skaliert elastisch abhängig von Stimuli. - Dynamische Migration auf andere Infrastruktur
 ohne eine Service Downtime. Cloud Resilient - Fehler-tolerant und resilient entworfen. - Metriken und Monitoring eingebaut. - Runs anywhere. Infrastruktur agnostisch. Cloud Friendly - Besteht aus lose gekoppelten Diensten. - Dienste können über Namen gefunden werden. - 12-Factor App Principles. Cloud Ready - Keine Anforderungen an das Datei-System. - Läuft auf virtualisierter Hardware. - Self-contained, kann als Image ausgeführt werden.
  6. | ContainerConf 2016 | A Hitchhiker’s Guide to the Cloud

    Native Stack | @LeanderReimer #cloudnativenerd #qaware Die Anatomie des Cloud Native Stack 6 Application Platform Cloud Native App Cluster Orchestrator Applications Cluster Scheduler Containers Cluster Virtualization Resources Cluster Operating System Entkoppelt von physischer Hardware. Verwaltet Ressourcen für die Ausführung von Containern Führt Applikationen auf dem Cluster aus. Stellt Ablauf- Umgebung und APIs für Apps bereit.
  7. | ContainerConf 2016 | A Hitchhiker’s Guide to the Cloud

    Native Stack | @LeanderReimer #cloudnativenerd #qaware Cloud Native Stack mit Spring Cloud und DC/OS 8 Application Platform Cloud Native App Cluster Orchestrator Applications Cluster Scheduler Containers Cluster Virtualization Resources
  8. | ContainerConf 2016 | A Hitchhiker’s Guide to the Cloud

    Native Stack | @LeanderReimer #cloudnativenerd #qaware Cloud Native Stack mit Spring Cloud und K8S. 9 Application Platform Cloud Native App Cluster Orchestrator Applications Cluster Scheduler Containers Cluster Virtualization Resources
  9. | ContainerConf 2016 | A Hitchhiker’s Guide to the Cloud

    Native Stack | @LeanderReimer #cloudnativenerd #qaware Orchestration Composition Die 4 Schritte zur Cloud-nativen Anwendung 1. MICROSERVICES 2. CONTAINERIZATION 3. COMPOSITION 4. ORCHESTRATION 10 Containerization Microservices docker compose
  10. | ContainerConf 2016 | A Hitchhiker’s Guide to the Cloud

    Native Stack | @LeanderReimer #cloudnativenerd #qaware MICROSERVICES 11
  11. | ContainerConf 2016 | A Hitchhiker’s Guide to the Cloud

    Native Stack | @LeanderReimer #cloudnativenerd #qaware Zwitscher Microservice in 5 Minuten 12 Zwitscher Controller Zwitscher Repository /tweets ZwitscherServiceApp search(…)
  12. | ContainerConf 2016 | A Hitchhiker’s Guide to the Cloud

    Native Stack | @LeanderReimer #cloudnativenerd #qaware CONTAINERIZATION 13
  13. | ContainerConf 2016 | A Hitchhiker’s Guide to the Cloud

    Native Stack | @LeanderReimer #cloudnativenerd #qaware $ docker build -t zwitscher-service:1.0.1 . $ docker run --name zwitscher-service -d \ -p 8080:8080 zwitscher-service:1.0.1 $ docker tag zwitscher-service:1.0.1 hitchhikersguide/zwitscher-service:latest $ docker push hitchhikersguide/zwitscher-service Der Containerization Workflow mit Docker 14 3. Tag & Push 2. Run Dockerfile 1. Build
  14. | ContainerConf 2016 | A Hitchhiker’s Guide to the Cloud

    Native Stack | @LeanderReimer #cloudnativenerd #qaware Beispiel Dockerfile für Zwitscher Service 15 FROM qaware/alpine-k8s-ibmjava8:8.0-3.10
 MAINTAINER QAware GmbH <[email protected]>
 
 RUN mkdir -p /app
 
 COPY build/libs/zwitscher-service-1.0.1.jar /app/zwitscher-service.jar
 COPY src/main/docker/zwitscher-service.conf /app/
 
 EXPOSE 8080
 CMD /app/zwitscher-service.jar
  15. | ContainerConf 2016 | A Hitchhiker’s Guide to the Cloud

    Native Stack | @LeanderReimer #cloudnativenerd #qaware Wichtige Tips für den Umgang mit Docker • Kenne dein Base-Image! Auf die Größe kommt es an. • Ein Docker Build muss wiederholbar sein. • Jeder RUN Befehl erzeugt ein Layer. Nutze Mehrfachbefehle! • Entferne temporäre Dateien. • Veröffentliche wichtige Ports mit EXPOSE. • Definiere Umgebungs-Variablen für wichtige Parameter. • Nutze ein Image für alle Umgebungen. • Versioniere deine Images. • Verwende Tools zur QS von Dockerfiles und Images. 16
  16. | ContainerConf 2016 | A Hitchhiker’s Guide to the Cloud

    Native Stack | @LeanderReimer #cloudnativenerd #qaware COMPOSITION 17
  17. | ContainerConf 2016 | A Hitchhiker’s Guide to the Cloud

    Native Stack | @LeanderReimer #cloudnativenerd #qaware 18 Cluster-weite Konfiguration und Konsensus Überwachung und Fehler-Diagnose Geregelter Zugriff 
 auf Service 
 Endpoints von Außen Registrierung und Suche von Service Endpoints Laufzeit-Umgebung für Service Endpoints Resistenter Aufruf von anderen Service Endpoints
  18. | ContainerConf 2016 | A Hitchhiker’s Guide to the Cloud

    Native Stack | @LeanderReimer #cloudnativenerd #qaware 19 Zwitscher Controller Zwitscher Repository /tweets ZwitscherServiceApp /zwitscher-service/* Discovery Configure Actuator /admin/health Register Read K/V Get Services
  19. | ContainerConf 2016 | A Hitchhiker’s Guide to the Cloud

    Native Stack | @LeanderReimer #cloudnativenerd #qaware Beispiel docker-compose.yml 20 version: '2' services: zwitscher-consul: ... zwitscher-traefik: ... zwitscher-service: image: hitchhikersguide/zwitscher-service:1.0.1 environment: - CONSUL_HOST=zwitscher-consul - CONSUL_PORT=8500 - TWITTER_APP_ID=${TWITTER_APP_ID} - TWITTER_APP_SECRET=${TWITTER_APP_SECRET} depends_on: - zwitscher-consul links: - zwitscher-consul ports: - "8080:8080" networks: - zwitscher-net $ docker-compose -p zwitscher up -d $ docker-compose -p zwitscher ps $ docker-compose -p zwitscher logs -f $ docker-compose -p zwitscher down docker compose
  20. | ContainerConf 2016 | A Hitchhiker’s Guide to the Cloud

    Native Stack | @LeanderReimer #cloudnativenerd #qaware ORCHESTRATION 21
  21. | ContainerConf 2016 | A Hitchhiker’s Guide to the Cloud

    Native Stack | @LeanderReimer #cloudnativenerd #qaware 22 zwitscher-traefik Mesos DNS Marathon zwitscher-consul zwitscher-service Manage Manage Manage Resolve zwitscher-consul.marathon.mesos Ops
  22. | ContainerConf 2016 | A Hitchhiker’s Guide to the Cloud

    Native Stack | @LeanderReimer #cloudnativenerd #qaware 23 { "id": "zwitscher-service-hitchhikersguide", "instances": 3, "cpus": 0.5, "mem": 256, "container": { "type": "DOCKER", "docker": { "image": "hitchhikersguide/zwitscher-service:1.0.1", "network": "BRIDGE", "portMappings": [{ "containerPort": 0, "hostPort": 0, "protocol": "tcp" }] } }, "healthChecks": [{ "protocol": "HTTP", "path": "/admin/health", "intervalSeconds": 10, "portIndex": 0, "maxConsecutiveFailures": 3 }] }
  23. | ContainerConf 2016 | A Hitchhiker’s Guide to the Cloud

    Native Stack | @LeanderReimer #cloudnativenerd #qaware Keine Magie. Aber komplexe Technologie. • Building Distributed Systems is hard! • Der Cloud Native Stack macht die Komplexität beherrschbar. • Die hohe Abstraktion ist Segen und Fluch zugleich. • Entwickler und Architekten brauchen zusätzliche Skills und Know- How in etlichen neuen Technologien. 25
  24. | ContainerConf 2016 | A Hitchhiker’s Guide to the Cloud

    Native Stack | @LeanderReimer #cloudnativenerd #qaware Code und Artikel zum Nachlesen unter … • https://github.com/qaware/hitchhikers-guide-cloudnative • Der Cloud Stack: Mesos, Kubernetes und Spring Cloud 
 https://goo.gl/U5cJAU • Spring Cloud und Netflix OSS: Cloud-native Anwendungen bauen
 https://goo.gl/edNlUK • Cloud-native Anwendungen mit Kubernetes
 https://goo.gl/dVkoyR • Eine Einführung in Apache Mesos: Das Betriebsystem der Cloud
 https://goo.gl/7SnMZA 26
  25. | ContainerConf 2016 | A Hitchhiker’s Guide to the Cloud

    Native Stack | @LeanderReimer #cloudnativenerd #qaware 27 CompletableFuture<SoftwareIngenieurIn> ich = CompletableFuture.supplyAsync(() -> erfindergeist() .handwerksstolz() ); CompletableFuture<Projekthaus> qaware = CompletableFuture.supplyAsync(() -> professionalität() .lässigkeit() ); Erfolg start = qaware.thenCombine(ich, (i, q) -> i.sendeBewerbung(q)) .join(); Weiter Details unter http://www.qaware.de/karriere/#jobs
  26. | ContainerConf 2016 | A Hitchhiker’s Guide to the Cloud

    Native Stack | @LeanderReimer #cloudnativenerd #qaware 42. THE ANSWER TO LIFE, UNIVERSE, THE CLOUD AND EVERYTHING. 28