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

Steuermann an Bord - Kubernetes Hands-On

Steuermann an Bord - Kubernetes Hands-On

Nicolas Byl

March 30, 2017
Tweet

More Decks by Nicolas Byl

Other Decks in Technology

Transcript

  1. 1
    STEUERMANN AN
    BORD – KUBERNETES
    HANDS-ON
    JavaLand, 30.03.2016
    Nicolas Byl, codecentric AG

    View Slide

  2. 2 . 1
    EINFÜHRUNG

    View Slide

  3. 2 . 2
    Nicolas Byl
    Senior IT Consultant
    https://github.com/nbyl
    https://twitter.com/NicolasByl

    View Slide

  4. 2 . 3
    Agenda
    Wann? Was?
    09:00 Einführung
    Docker
    Kubernetes
    10:15 Kaffeepause
    10:45 Lab 1: kubectl
    12:45 Mittagessen

    View Slide

  5. 2 . 4
    Agenda (2)
    Wann? Was?
    13:30 Helm
    Lab 2: Helm Charts
    14:30 Kaffeepause
    15:00 Deis Workflow
    Lab 3: Deis Workflow
    Wrap-Up
    16:30 Ende

    View Slide

  6. 2 . 5
    Mission Statement
    Es gibt keine dummen
    Fragen!
    Hilfe zur Selbsthilfe

    View Slide

  7. View Slide

  8. 2 . 6
    3 . 1
    DOCKER

    View Slide

  9. View Slide

  10. 3 . 2

    View Slide

  11. 3 . 3

    View Slide

  12. 3 . 4

    View Slide

  13. 3 . 5

    View Slide

  14. 3 . 6
    3 . 7
    Dockerfile
    FROM java:8
    MAINTAINER Marcel Birkner
    ADD target/edmp-sample-app*.jar app.jar
    RUN bash -c 'touch /app.jar'
    ENTRYPOINT ["java","-jar","/app.jar"]}

    View Slide

  15. View Slide

  16. 3 . 8
    4 . 1
    KUBERNETES

    View Slide

  17. "Kubernetes is an open-source platform for automating
    deployment, scaling, and operations of application
    containers across clusters of hosts, providing container-
    centric infrastructure."

    View Slide

  18. 4 . 2
    portable: public, private, hybrid, multi-cloud
    extensible: modular, pluggable, hookable, composable
    self-healing: auto-placement, auto-restart, auto-
    replication, auto-scaling

    View Slide

  19. 4 . 3

    View Slide

  20. 4 . 4
    4 . 5
    Pods & Co.

    View Slide

  21. 4 . 6
    Pods

    View Slide

  22. 4 . 7
    Replication Controller

    P P
    P

    View Slide

  23. 4 . 8
    Deployment
    Kombination aus Pod und Replication
    Controller
    Einheit

    View Slide

  24. apiVersion: extensions/v1beta1
    kind: Deployment
    metadata:
    name: frontend
    spec:
    replicas: 3
    template:
    metadata:
    labels:
    app: guestbook
    tier: frontend
    spec:
    containers:
    - name: php-redis
    image: gcr.io/google-samples/gb-frontend:v4
    resources:
    requests:

    View Slide

  25. 4 . 9
    4 . 10
    Services

    View Slide

  26. 4 . 11
    Endpunkt für
    eine Menge von Pods
    einen externen
    Endpunkt
    Auflösung über
    DNS
    Umgebungsvariablen

    View Slide

  27. View Slide

  28. 4 . 12
    5 . 1
    LAB 0: SETUP

    View Slide

  29. 5 . 2
    Vorraussetzungen
    kubectl
    helm
    deis
    https://goo.gl/3YDCIe

    View Slide

  30. 5 . 3
    Konfiguration
    Teams bilden
    Clustername: teamX.kubeland.cc
    Konfigurationsdatei nach
    $HOME/.kube/config
    kubectl cluster-info

    View Slide

  31. View Slide

  32. 6 . 1
    6 . 2
    Business Model
    Real-Time Statistics as a Service

    View Slide

  33. 6 . 3
    Unser Potentieller Investor

    View Slide

  34. 7 . 1
    LAB 1: KUBECTL

    View Slide

  35. View Slide

  36. 8 . 1
    8 . 2
    Lasst und die Kunden jagen

    View Slide

  37. 9 . 1
    HELM

    View Slide

  38. 9 . 2
    Paket Manager
    Installation von komplexen Applikationen
    Repositories mit Kubernetes Artefakten
    Reproduzierbare Releases inklusive
    Rollback

    View Slide

  39. 9 . 3
    Architektur
    Server: tiller
    Client: helm
    CLI

    View Slide

  40. 9 . 4
    Konzept
    Installationsbeschreibung durch YAML-Templates
    Eigene Versionierung der Paketierung
    Bei Installation/Upgrade Ersetzung durch Standard oder
    vorgegebene Werte
    History von Deployments

    View Slide

  41. 9 . 5
    Beispiel
    helm init
    helm search redis
    [...]
    helm install stable/redis
    [...]
    helm install working-tiger stable/redis --set "image.version=3.2.8-r2"
    helm rollback working-tiger

    View Slide

  42. 10 . 1
    LAB 2: HELM

    View Slide

  43. View Slide

  44. 11 . 1
    Wir brauchen mehr Entwicker

    View Slide

  45. 11 . 2

    View Slide

  46. 12 . 1
    DEIS WORKFLOW

    View Slide

  47. 12 . 2
    Twelve-Factor Applications

    View Slide

  48. 12 . 3
    Codebase
    One codebase tracked in revision control, many deploys
    Dependencies
    Explicitly declare and isolate dependencies
    Config
    Store config in the environment
    Backing Services
    Treat backing services as attached resources
    Build, release, run
    Strictly separate build and run stages
    Processes
    Execute the app as one or more stateless processes

    View Slide

  49. 12 . 4
    Port binding
    Export services via port binding
    Concurrency
    Scale out via the process model
    Disposability
    Maximize robustness with fast startup and graceful shutdown
    Dev/prod parity
    Keep development, staging, and production as similar as possible
    Logs
    Treat logs as event streams
    Admin processes
    Run admin/management tasks as one-off processes

    View Slide

  50. View Slide

  51. 12 . 5
    12 . 6
    Architektur

    View Slide

  52. 12 . 7
    Struktur einer Deis Applikation

    View Slide

  53. 12 . 8
    Workflow

    View Slide

  54. 13 . 1
    LAB 3: DEIS
    WORKFLOW

    View Slide

  55. 14 . 1
    ENDE

    View Slide

  56. 14 . 2
    Cluster aufbauen
    minikube
    kops
    Tectonic

    View Slide

  57. 14 . 3
    Ausblick 1.6+
    RBAC
    Federation
    Dynamic Storage
    Provisioning

    View Slide

  58. 14 . 4
    Links
    https://kubernetes.io
    https://helm.sh
    https://deis.com
    https://www.cncf.io
    https://www.openshift.com/promotions/kubernetes.html
    https://github.com/ramitsurana/awesome-kubernetes

    View Slide

  59. 14 . 5
    The End
    @NicolasByl
    Copyright 2017

    View Slide