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

Docker orchestration with Kubernetes

Docker orchestration with Kubernetes

Support for my talk at the AWS UG Munich Meetup (April 2015)

Antoine Cotten

April 15, 2015
Tweet

More Decks by Antoine Cotten

Other Decks in Technology

Transcript

  1. AWS/CLOUD COMPUTING UG MUNICH APRIL MEETUP Docker orchestration with Kubernetes

    Managing containers at scale */koo-ber-nay’-tace/ *
  2. AWS/CLOUD COMPUTING UG MUNICH APRIL MEETUP Who I am Antoine

    Cotten Technical operations engineer @ Freeletics GmbH What I do • Virtualisation, private clouds • Automation, conf management • Docker orchestration • Continuous integration
  3. AWS/CLOUD COMPUTING UG MUNICH APRIL MEETUP What this talk is

    not “about Docker” Contributor’s point of view Comparison with other container orchestrators
  4. AWS/CLOUD COMPUTING UG MUNICH APRIL MEETUP What it is Introduction

    to Google Kubernetes Live demo Experience sharing on AWS integration End-user oriented
  5. AWS/CLOUD COMPUTING UG MUNICH APRIL MEETUP Efficiency Reduce deploy overhead

    Boost scaling times provision VM / EC2 deploy OS / AMI config mngmt fail? no deploy app yes 14’
  6. The realities of Docker in production When the puzzle pieces

    don’t quite fit http://blog.heavybit.com/blog/2015/3/23/dockermeetup
  7. AWS/CLOUD COMPUTING UG MUNICH APRIL MEETUP Recipe for composing a

    distributed app Composition put together parts of application Scheduling run each bit on appropriate machine Networking ensure everyone can talk to each other Storage persist data
  8. AWS/CLOUD COMPUTING UG MUNICH APRIL MEETUP Why Kubernetes? Orchestration Service

    discovery Load balancing Storage drivers Configuration management
  9. AWS/CLOUD COMPUTING UG MUNICH APRIL MEETUP Node { "kind": "Node",

    "apiVersion": "v1beta3", "metadata": { "name": "ip-172-20-0-10.eu-west-1.compute.internal", "selfLink": "/api/v1beta1/nodes/ip-172-20-0-10.eu-west-1.compute.internal", "uid": "2b6e26fa-e350-11e4-87e9-0aa01ffbf345", "resourceVersion": "5954", "creationTimestamp": "2015-04-15T09:16:59Z" }, "spec": { "externalID": "i-755d0e93" }, "status": { "capacity": { "cpu": "2", "memory": "4046840Ki" }, "conditions": [ { "type": "Ready", "status": "True", "lastHeartbeatTime": "2015-04-15T11:55:16Z", "lastTransitionTime": "2015-04-15T10:58:00Z", "reason": "kubelet is posting ready status" } ], "addresses": [ { "type": "LegacyHostIP", "address": "172.20.0.10" } ], "nodeInfo": { "machineID": "046c50ecad79db790335c77454f7a66f", "systemUUID": "EC26CFE0-6753-82CA-40BC-D325E6710CD3", "bootID": "24ba1fdf-9072-4a4a-9c60-d619db66a312", "kernelVersion": "3.13.0-46-generic", "osImage": "Ubuntu 14.04.2 LTS", "containerRuntimeVersion": "docker://Unknown", "kubeletVersion": "v0.15.0", "KubeProxyVersion": "v0.15.0" } } }
  10. AWS/CLOUD COMPUTING UG MUNICH APRIL MEETUP Pod collocated group of

    Docker containers shared volumes, shared network created individually… …but usually scaled using a replication controller Node pod cont cont cont
  11. AWS/CLOUD COMPUTING UG MUNICH APRIL MEETUP Pod { "kind": "Pod",

    "apiVersion": "v1beta3", "metadata": { "name": "redis-master-5bch6", "selfLink": "/api/v1beta1/pods/redis-master-5bch6?namespace=default", "creationTimestamp": "2015-04-15T12:05:23Z", "labels": { "name": "redis-master" } }, "spec": { "volumes": null, "containers": [ { "name": "master", "image": "dockerfile/redis", "ports": [ { "containerPort": 6379, "protocol": "TCP" } ], } ], "restartPolicy": "Always", "host": "ip-172-20-0-10.eu-west-1.compute.internal" }, "status": { "phase": "Running", "podIP": "10.244.1.17", "containerStatuses": [ { "name": "master", "state": { "running": { "startedAt": "2015-04-15T12:05:27Z" } }, "ready": true, "restartCount": 0, "image": "dockerfile/redis", } ] } }
  12. AWS/CLOUD COMPUTING UG MUNICH APRIL MEETUP Node Node Node Node

    Replication controller manage lifecycle of pods enforce number of running pods across cluster rolling updates Replication controller pod pod pod pod pod
  13. AWS/CLOUD COMPUTING UG MUNICH APRIL MEETUP RC { "kind": "ReplicationController",

    "apiVersion": "v1beta3", "metadata": { "name": "redis-master", "selfLink": "/api/v1beta1/replicationControllers/redis-master?namespace=default", "creationTimestamp": "2015-04-15T12:05:23Z", "labels": { "name": "redis-master" } }, "spec": { "replicas": 1, "selector": { "name": "redis-master" }, "template": { "metadata": { "labels": { "name": "redis-master" } }, "spec": { "volumes": null, "containers": [ { "name": "master", "image": "dockerfile/redis", "ports": [ { "containerPort": 6379, "protocol": "TCP" } ] } ], "restartPolicy": "Always" } } }, "status": { "replicas": 1 } }
  14. AWS/CLOUD COMPUTING UG MUNICH APRIL MEETUP Service provide name and

    address for a set of pods can integrate with local DNS act as basic load balancers… …or create external load-balancers via cloud-provider integration Service pod pod pod pod pod
  15. AWS/CLOUD COMPUTING UG MUNICH APRIL MEETUP SE { "kind": "Service",

    "apiVersion": "v1beta3", "metadata": { "name": "redis-master", "namespace": "default", "selfLink": "/api/v1beta1/services/redis-master?namespace=default", "uid": "b20bac8e-e367-11e4-87e9-0aa01ffbf345", "resourceVersion": "6227", "creationTimestamp": "2015-04-15T12:05:23Z", "labels": { "name": "redis-master" } }, "spec": { "ports": [ { "name": "redis", "protocol": "TCP", "port": 6379, "targetPort": 6379 } ], "selector": { "name": "redis-master" }, "portalIP": "10.0.59.191", "sessionAffinity": "None" }, "status": {} }
  16. AWS/CLOUD COMPUTING UG MUNICH APRIL MEETUP rc Exemple Guestbook app

    frontend (pod) frontend (pod) frontend (service) redis-master (pod) redis-slave (pod) redis-master (service) redis-slave (service) redis-slave (pod) rc
  17. AWS/CLOUD COMPUTING UG MUNICH APRIL MEETUP Kube up 1. Creates

    instances 2. Runs Salt 3. Runs add ons 4. Configures workstation $ export KUBERNETES_PROVIDER=aws $ export KUBE_AWS_ZONE=eu-west-1a $ export MINION_SIZE=t2.medium $ export NUM_MINIONS=2 $ ./kube-up.sh Ubuntu 14.04 Manual network config Not much control
  18. AWS/CLOUD COMPUTING UG MUNICH APRIL MEETUP Cloudformation Cloud-config Limited Unsecure

    Cloud-config Works great with CoreOS Easy to re-use Need to rely on configuration management to make it fully functional * Ansible * Puppet-on-Coreos (https://github.com/jumanjihouse/puppet-on-coreos) +