Slide 1

Slide 1 text

Can I have Mesos *and* Kubernetes? Michael Hausenblas | London Mesos User Group | 2015-09-24

Slide 2

Slide 2 text

© 2015 Mesosphere, Inc. 2

Slide 3

Slide 3 text

© 2015 Mesosphere, Inc. What is Kubernetes? • open source container orchestration system • scheduling apps onto nodes + scaling • manages apps to match declared intentions • based on Google's internal cluster managers such as Borg 3

Slide 4

Slide 4 text

© 2015 Mesosphere, Inc. Kubernetes architecture 4

Slide 5

Slide 5 text

© 2015 Mesosphere, Inc. Kubernetes concepts • container—sealed application package (Docker) • pod—small group of tightly coupled containers • labels—identifying metadata attached to objects (pods, services, etc.) • selector—query against labels, producing a set result • controller—control loop driving current state towards desired state • service—set of pods that work together (incl. proxy/load balancer) 5

Slide 6

Slide 6 text

© 2015 Mesosphere, Inc. Kubernetes: pods • unit of scheduling • data sharing between its containers • shared mount point (volumes) • shared network namespace (same IP, see each other on localhost) 6

Slide 7

Slide 7 text

© 2015 Mesosphere, Inc. Kubernetes: labels & selectors • arbitrary metadata (in key-value format) attached to any API object • used for grouping, queryable by selectors • examples • pods managed by a replication controller • nodes capabilities for scheduling 7

Slide 8

Slide 8 text

© 2015 Mesosphere, Inc. Kubernetes: replication controllers • constitutes a control loop • ensures a desired state (x pods running) • scoped by selector 8

Slide 9

Slide 9 text

© 2015 Mesosphere, Inc. Kubernetes: services • compensate for dynamics of pods • provides a stable VIP (through proxy) • access policy: load-balanced or headless 9

Slide 10

Slide 10 text

© 2015 Mesosphere, Inc. Kubernetes: cluster-wide services • monitoring (e.g.: cAdvisor + InfluxDB + Heapster) • logging (e.g.: fluentd + ES + Kibana) • DNS (e.g.: skydns + kube2sky) • all of the above can be replaced by custom solutions (GCP, AWS, etc.) 10

Slide 11

Slide 11 text

© 2015 Mesosphere, Inc. Kubernetes: example pods apiVersion: v1 kind: Pod metadata: name: mysql labels: name: mysql spec: containers: - resources: limits : cpu: 0.5 image: mysql name: mysql env: - name: MYSQL_ROOT_PASSWORD value: yourpassword ports: - containerPort: 3306 name: mysql volumeMounts: - name: mysql-persistent-storage mountPath: /var/lib/mysql volumes: - name: mysql-persistent-storage gcePersistentDisk: pdName: mysql-disk fsType: ext4 11 apiVersion: v1 kind: Pod metadata: name: wordpress labels: name: wordpress spec: containers: - image: wordpress name: wordpress env: - name: WORDPRESS_DB_PASSWORD value: yourpassword ports: - containerPort: 80 name: wordpress volumeMounts: - name: wordpress-persistent-storage mountPath: /var/www/html volumes: - name: wordpress-persistent-storage gcePersistentDisk: pdName: wordpress-disk fsType: ext4 MySQL Wordpress

Slide 12

Slide 12 text

© 2015 Mesosphere, Inc. Kubernetes: example services apiVersion: v1 kind: Service metadata: labels: name: mysql name: mysql spec: ports: - port: 3306 selector: name: mysql 12 apiVersion: v1 kind: Service metadata: labels: name: wpfrontend name: wpfrontend spec: ports: - port: 80 selector: name: wordpress type: LoadBalancer MySQL Wordpress

Slide 13

Slide 13 text

© 2015 Mesosphere, Inc. 13 Kubernetes + Mesos

Slide 14

Slide 14 text

© 2015 Mesosphere, Inc. Let's talk about workloads* … 14 *) kudos to Timothy St. Clair (@timothysc) for this batch streaming PaaS MapReduce

Slide 15

Slide 15 text

© 2015 Mesosphere, Inc. Kubernetes + Mesos 15 https://github.com/kubernetes/kubernetes/blob/release-1.0/contrib/mesos/docs/architecture.md

Slide 16

Slide 16 text

© 2015 Mesosphere, Inc. Kubernetes + Mesos 16 https://github.com/kubernetes/kubernetes/blob/release-1.0/contrib/mesos/docs/architecture.md

Slide 17

Slide 17 text

© 2015 Mesosphere, Inc. Benefits • Node-level auto-scaling • Dynamic partitioning: co-location of Kubernetes with other services such as Spark, Chronos, Cassandra, etc. on the same cluster • Independence from special network infrastructure • Mesosphere DCOS specific: • High Availability • Easy installation • Easy maintenance 17

Slide 18

Slide 18 text

© 2015 Mesosphere, Inc. Use Cases • Kubernetes: 100% containerized workloads (cloud-native apps) • Mesos/Marathon: containerized & non-containerized workloads • Kubernetes+Mesos: hybrid workloads • legacy apps/microservices integration • state-less + analytical workloads 18

Slide 19

Slide 19 text

© 2015 Mesosphere, Inc. 19 $ demo

Slide 20

Slide 20 text

20 © 2015 Mesosphere, Inc.

Slide 21

Slide 21 text

21 © 2015 Mesosphere, Inc.

Slide 22

Slide 22 text

© 2015 Mesosphere, Inc. DCOS CE Architecture 22 https://docs.mesosphere.com/getting-started/dcosarchitecture/

Slide 23

Slide 23 text

© 2015 Mesosphere, Inc. Demo: hybrid workload 23 gen.sh distributed kernel orchestration application

Slide 24

Slide 24 text

© 2015 Mesosphere, Inc. 24 See also …

Slide 25

Slide 25 text

© 2015 Mesosphere, Inc. Scheduling at Google • Borg: http://research.google.com/pubs/pub43438.html • The Google Stack: http://j.mp/google-stack 25

Slide 26

Slide 26 text

© 2015 Mesosphere, Inc. Kubernetes • http://kubernetes.io/v1.0/docs/ • https://docs.mesosphere.com/services/kubernetes/ • http://kubernetes.io/v1.0/docs/design/architecture.html 26

Slide 27

Slide 27 text

© 2015 Mesosphere, Inc. Kubernetes + Mesos • https://youtu.be/yEwCehwPV98 — Crossing the Streams: Leveraging Kubernetes Services From Other Mesos Frameworks and Vice Versa by Timothy St. Clair, MesosCon Seattle 2015 • https://github.com/mesosphere/kubernetes-mesos 27

Slide 28

Slide 28 text

© 2015 Mesosphere, Inc. Kubernetes + Mesos • https://github.com/kubernetes/kubernetes/blob/release-1.0/contrib/mesos/ docs/architecture.md • http://kubernetes.io/v1.0/docs/getting-started-guides/mesos.html • https://github.com/jeffmendoza/kubernetes/blob/gh-pages/solutions/ mesosphere.md 28

Slide 29

Slide 29 text

© 2015 Mesosphere, Inc. We're hiring … 29 San Francisco New York Hamburg https://mesosphere.com/careers/

Slide 30

Slide 30 text

© 2015 Mesosphere, Inc. Q & A • @mhausenblas • mhausenblas.info • @mesosphere • mesosphere.io/product 30