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

Kubernetes - Changing the way we build platforms

Mark Wolfe
September 22, 2015

Kubernetes - Changing the way we build platforms

Presented at docker meetup in Melbourne 23/09/2015

Mark Wolfe

September 22, 2015
Tweet

More Decks by Mark Wolfe

Other Decks in Technology

Transcript

  1. Kubernetes? • Inspired by an internal project at Google, called

    Borg • Contributors from Google, Mesos and more • 1.0 release a month or so ago
  2. Containers • Unix processes not lightweight Virtual Machines • Application

    + Dependencies = image • Runtime environment (cgroups, namespaces, environment variables)
  3. • Build applications in a dedicated build container or CI

    • Ship build artifacts, not build environments • Rails app container with build tools ~900MB • Rails app container without build tools ~300MB • Go service without build tools ~15MB • Cattle not Pets! Containers
  4. • Container management, scheduling, and service discovery. • API driven

    application management • Agents monitor endpoints for state changes (real-time) • Controllers enforce desired state • Resources (nodes, applications, services) Kubernetes
  5. Kubernetes • High level concepts • node • pod •

    scheduler • replication • service
  6. Scheduler • Schedules pods to run on nodes. • Global

    scheduler for long running jobs • Best fit chosen based on pod requirements • Pluggable
  7. Replication Controller • Manages a replicated set of pods. •

    Creates pods from a template • Ensures desired number of pods are running • Online resizing
  8. Replication Controller • Manages a replicated set of pods. •

    Creates pods from a template • Ensures desired number of pods are running • Online resizing
  9. Service • Service discovery for pods. • Proxy runs on

    each node • Virtual IP per service (avoid port collisions) • Basic round-robin algorithm • Dynamic backends based on label queries
  10. Example Pod apiVersion: v1 kind: Pod metadata: labels: db: rethinkdb

    role: admin name: rethinkdb-admin spec: containers: - image: gcr.io/google_containers/rethinkdb:1.16.0_1 name: rethinkdb env: - name: POD_NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace ports: - containerPort: 8080 name: admin-port volumeMounts: - mountPath: /data/rethinkdb_data name: rethinkdb-storage volumes: - name: rethinkdb-storage emptyDir: {}
  11. Example Service apiVersion: v1 kind: Service metadata: labels: db: rethinkdb

    name: rethinkdb-admin spec: ports: - port: 8080 targetPort: 8080 type: LoadBalancer selector: db: rethinkdb role: admin
  12. Transparency • Logging • ELK (Elastic Search, Logstash, Kibana) •

    Metrics • InfluxDB and Grafana • Tracing • Twitter Zipkin
  13. Cloud Providers • Kubernetes Supports • Google Cloud Compute and

    Container • AWS, being used by Samsung and Others • Openstack • Azure
  14. Links • Kubernetes Site • AWS Setup • CoreOS Kubernetes

    Vagrant • Kubernetes Rails Deployment • http://fabric8.io/