Container Orchestration - Kubernetes and OpenShift

Container Orchestration - Kubernetes and OpenShift

Running Docker Containers in production brings several challenges. Container orchestration tools and platforms provide solutions for them. We will look at Kubernetes - the leader in container orchestration - to understand the concepts and how to deploy applications. OpenShift adds additional features to Kubernetes, which makes it a full PaaS solution for the enterprise.

Dc57623510db9e48b093fb4c19f5c749?s=128

Christian Köberl

September 26, 2017
Tweet

Transcript

  1. Christian Köberl Container Orchestration

  2. Christian Köberl Software Architect / Developer Develops web apps since

    1999
  3. Linux Containers Source: https://www.redhat.com/de/containers/whats-a-linux-container

  4. Docker Source: https://docs.docker.com/opensource/ways/meetups/

  5. Simple Deployment SSH into machine – docker run myapp •

    Very simple • BUT what about • Failure – who/what restarts the container? • Load Balancing • Scaling • Updates • …
  6. None
  7. Source: http://www.cargolaw.com/2011nightmare_mv_rena.html

  8. Why Container Orchestration? • High Availability • Running on multiple

    hosts • (Auto-)Scaling • Load Balancing • Rolling Upgrades • Storage management • Monitoring • Authentication & Authorization
  9. Scheduler Container Orchestration Scheduler Node 1 Node 2 Node 3

    Run 3 instances of MyApp Distributed Database Container Engine Container Engine Container Engine Run Postgres where backup=yes backup=yes Postgres MyApp MyApp MyApp
  10. Network Container Orchestration Node 1 Node 2 Node 3 Container

    Engine Container Engine Container Engine Postgres MyApp MyApp MyApp 172.16.0.2 172.16.0.3 192.168.0.12 10.40.1.12 10.40.1.13 10.40.1.14
  11. Service Discovery / Load Balancing Container Orchestration Node 1 Node

    2 Node 3 Container Engine Container Engine Container Engine Postgres MyApp MyApp MyApp myapp:80 myapp:80 myapp:80 (External) Load Balancer myapp.domain.com
  12. Container Orchestration - Additional Features • Resource Management • CPU

    (GPU) / Memory • (Persistent) Volumes • Configuration / Secret Management • Distributed Job Scheduling (CRON) • Container Registry • …
  13. With good Container Orchestration your whole data center will look

    like a single server with endless resources. > Data center operating system https://www.oreilly.com/ideas/why-the-data-center-needs-an-operating-system
  14. Competing Systems Kubernetes Mesos Docker Datacenter

  15. Production-Grade Container Orchestration

  16. None
  17. Abhishek Verma, Luis Pedrosa, Madhukar R. Korupolu, David Oppenheimer, Eric

    Tune, John Wilkes: Large-scale cluster management at Google with Borg, https://research.google.com/pubs/pub43438.html Google's BORG Kuberntes Master Kubelet Kubelet Kubelet Kubelet etcd Kubernetes YAML/JSON
  18. Demo 1 - Wekan • Deploying Wekan 1. Deploy MongoDB

    with Volume 2. Deploy Wekan application
  19. K8s – Logical View Namespace Service Pod Container Container Pod

    Container Container ReplicaSet Deployment Pod Container Volume ReplicaSet Deployment Service Secret ConfigMap
  20. Kubernetes - Concepts • Workloads • Pod • Deployment •

    ReplicaSet (former Replication Controller) • StatefulSet – for legacy apps • Job / CronJob • Service • Volume • Configuration • ConfigMap • Secret
  21. Kubernetes - Objects + REST API • All objects represented

    in YAML or JSON • REST API for all objects • Command Line and UI talk to REST API
  22. Service apiVersion: v1 kind: Service metadata: labels: app: wekandb version:

    "3.4" name: wekandb namespace: wekan spec: ports: - name: tcp-27017 port: 27017 protocol: TCP targetPort: 27017 selector: app: wekandb version: "3.4" sessionAffinity: None type: ClusterIP
  23. Red Hat® OpenShift is a container application platform that brings

    Docker and Kubernetes to the enterprise.
  24. Demo 2 - Angular Heroes • Deploy Angular Spring Heroes

    • Angular Heroes Tutorial App • Spring Boot Backend • https://github.com/porscheinformatik/angular-spring-heroes • Update Code • GitHub Webhook triggers build
  25. OpenShift – Kubernetes PaaS • ImageStreams • Automatically Update Images

    / Deployments • Builds / Pipelines • Build from Source/Binary • Build via S2I or Docker (or custom) • Jenkins Pipeline Integration • Routes – integrated LB (HAProxy) • Templates • Blueprint for whole application
  26. OpenShift – Enterprise Kubernetes • SELinux with RHEL, CentOS or

    Atomic • Container running as non-root • Network Isolation between Namespaces • Automatic Security Updates via ImageStream/Builds
  27. https://learn.openshift.com

  28. Local Environment • Kubernetes - minikube • minikube start •

    Starts k8s cluster in VM • OpenShift • minishift same as minikube • oc cluster up Runs cluster in Docker containers
  29. Kubernetes Ecosystem • Lot's of cloud providers, biggest include Google,

    IBM, Microsoft • Different PaaS solutions: Deis, OpenShift, Kel, … • Helm • Kubernetes package manager • Installs whole application + dependencies
  30. Thanks! Questions? github.com/derkoe / @derkoe Source: https://www.docker.com/community-edition