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

Can I have Mesos and Kubernetes?

Can I have Mesos and Kubernetes?

Talk at London Mesos User Group, see also http://www.meetup.com/London-Mesos-User-Group/events/224555822/

The demo is available as well, here: https://gist.github.com/mhausenblas/07c03d4230a5e6ec3b46

Michael Hausenblas

September 24, 2015
Tweet

More Decks by Michael Hausenblas

Other Decks in Technology

Transcript

  1. © 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
  2. © 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
  3. © 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
  4. © 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
  5. © 2015 Mesosphere, Inc. Kubernetes: replication controllers • constitutes a

    control loop • ensures a desired state (x pods running) • scoped by selector 8
  6. © 2015 Mesosphere, Inc. Kubernetes: services • compensate for dynamics

    of pods • provides a stable VIP (through proxy) • access policy: load-balanced or headless 9
  7. © 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
  8. © 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
  9. © 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
  10. © 2015 Mesosphere, Inc. Let's talk about workloads* … 14

    *) kudos to Timothy St. Clair (@timothysc) for this batch streaming PaaS MapReduce
  11. © 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
  12. © 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
  13. © 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
  14. © 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
  15. © 2015 Mesosphere, Inc. We're hiring … 29 San Francisco

    New York Hamburg https://mesosphere.com/careers/
  16. © 2015 Mesosphere, Inc. Q & A • @mhausenblas •

    mhausenblas.info • @mesosphere • mesosphere.io/product 30