Slide 1

Slide 1 text

Christian Köberl Container Orchestration

Slide 2

Slide 2 text

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

Slide 3

Slide 3 text

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

Slide 4

Slide 4 text

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

Slide 5

Slide 5 text

Simple Deployment SSH into machine – docker run myapp • Very simple • BUT what about • Failure – who/what restarts the container? • Load Balancing • Scaling • Updates • …

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

Source: http://www.cargolaw.com/2011nightmare_mv_rena.html

Slide 8

Slide 8 text

Why Container Orchestration? • High Availability • Running on multiple hosts • (Auto-)Scaling • Load Balancing • Rolling Upgrades • Storage management • Monitoring • Authentication & Authorization

Slide 9

Slide 9 text

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

Slide 10

Slide 10 text

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

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

Container Orchestration - Additional Features • Resource Management • CPU (GPU) / Memory • (Persistent) Volumes • Configuration / Secret Management • Distributed Job Scheduling (CRON) • Container Registry • …

Slide 13

Slide 13 text

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

Slide 14

Slide 14 text

Competing Systems Kubernetes Mesos Docker Datacenter

Slide 15

Slide 15 text

Production-Grade Container Orchestration

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

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

Slide 18

Slide 18 text

Demo 1 - Wekan • Deploying Wekan 1. Deploy MongoDB with Volume 2. Deploy Wekan application

Slide 19

Slide 19 text

K8s – Logical View Namespace Service Pod Container Container Pod Container Container ReplicaSet Deployment Pod Container Volume ReplicaSet Deployment Service Secret ConfigMap

Slide 20

Slide 20 text

Kubernetes - Concepts • Workloads • Pod • Deployment • ReplicaSet (former Replication Controller) • StatefulSet – for legacy apps • Job / CronJob • Service • Volume • Configuration • ConfigMap • Secret

Slide 21

Slide 21 text

Kubernetes - Objects + REST API • All objects represented in YAML or JSON • REST API for all objects • Command Line and UI talk to REST API

Slide 22

Slide 22 text

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

Slide 23

Slide 23 text

Red Hat® OpenShift is a container application platform that brings Docker and Kubernetes to the enterprise.

Slide 24

Slide 24 text

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

Slide 25

Slide 25 text

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

Slide 26

Slide 26 text

OpenShift – Enterprise Kubernetes • SELinux with RHEL, CentOS or Atomic • Container running as non-root • Network Isolation between Namespaces • Automatic Security Updates via ImageStream/Builds

Slide 27

Slide 27 text

https://learn.openshift.com

Slide 28

Slide 28 text

Local Environment • Kubernetes - minikube • minikube start • Starts k8s cluster in VM • OpenShift • minishift same as minikube • oc cluster up Runs cluster in Docker containers

Slide 29

Slide 29 text

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

Slide 30

Slide 30 text

Thanks! Questions? github.com/derkoe / @derkoe Source: https://www.docker.com/community-edition