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

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.

Avatar for Christian Köberl

Christian Köberl

September 26, 2017
Tweet

More Decks by Christian Köberl

Other Decks in Technology

Transcript

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

    Very simple • BUT what about • Failure – who/what restarts the container? • Load Balancing • Scaling • Updates • …
  2. Why Container Orchestration? • High Availability • Running on multiple

    hosts • (Auto-)Scaling • Load Balancing • Rolling Upgrades • Storage management • Monitoring • Authentication & Authorization
  3. 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
  4. 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
  5. 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
  6. Container Orchestration - Additional Features • Resource Management • CPU

    (GPU) / Memory • (Persistent) Volumes • Configuration / Secret Management • Distributed Job Scheduling (CRON) • Container Registry • …
  7. 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
  8. 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
  9. Demo 1 - Wekan • Deploying Wekan 1. Deploy MongoDB

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

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

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

    in YAML or JSON • REST API for all objects • Command Line and UI talk to REST API
  13. 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
  14. 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
  15. 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
  16. OpenShift – Enterprise Kubernetes • SELinux with RHEL, CentOS or

    Atomic • Container running as non-root • Network Isolation between Namespaces • Automatic Security Updates via ImageStream/Builds
  17. Local Environment • Kubernetes - minikube • minikube start •

    Starts k8s cluster in VM • OpenShift • minishift same as minikube • oc cluster up Runs cluster in Docker containers
  18. 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