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

Kubernetify All The Things!

Steve Sloka
January 08, 2016

Kubernetify All The Things!

Good tooling today exists to spin up containerized environments with Docker on a single host and tear down just as fast. The difficulty is when trying to deploy across two or more servers. Kubernetes is an open source project to manage a cluster of Linux containers as a single system and solves just that problem. This talk will outline all of the components of the Kubernetes system leave attendees with enough knowledge to spin up their own cluster and deploy at scale. #codemash

Steve Sloka

January 08, 2016
Tweet

More Decks by Steve Sloka

Other Decks in Technology

Transcript

  1. OVERVIEW ▸ Overview ▸ Background of Kubernetes ▸ k8s Level

    Concepts ▸ DEMO!!! (On a Pi cluster! —————————————————> ▸ Even More Demo ▸ More Demo ———————————————> ▸ Summary
  2. KUBERNETES ▸ open-source platform for automating deployment, scaling, and operations

    of application containers ▸ Servers 2-N ▸ Open Sourced by Google 2014 ▸ github.com/kubernetes/kubernetes ▸ Written in Go ▸ #GIFEE (Google-like Infrastructure for Everyone Else)
  3. GOOGLE EXPERIENCE ‣ Google has been using containers for over

    a decade ‣ 2 BILLON Per Week! (With a “B”) ‣ Everything at Google runs in a container
  4. “HELMSMAN OF A SHIP” ▸ lean: lightweight, simple, accessible ▸

    extensible: modular, pluggable, hookable, composable, toolable ▸ portable: public, private, hybrid, multi cloud ▸ self-healing: auto-placement, auto-restart, auto- replication
  5. ARCHITECTURE Master: Node(s): ETCD API SERVER CONTROLLER MANAGER KUBELET PROXY

    SCHEDULER CONTAINER ENGINE CADVISOR SOFTWARE DEFINED NETWORK ADDONS
  6. POD

  7. SCHEDULES PODS TO RUN ON NODES ▸global ▸best fit chosen

    based on pod requirements ▸allows for over-commit ▸pluggable
  8. CREATE PODS Desired: Actual: POD POD POD POD POD POD

    ACTION IS TO CREATE 3 PODS ——>
  9. REPLICATION CONTROLLER ▸Pod template ▸Docker image(s) ▸Labels ▸CPU / Memory

    ▸Replicas ▸Volume Mounts ▸Define in JSON || YAML
  10. REPLICATION CONTROLLERS VOLUMES ▸ emptyDir ▸ hostPath ▸ gcePersistentDisk ▸

    awsElasticBlockStore ▸ nfs ▸ persistentVolumeClaim ▸ flocker ▸ glusterfs ▸ rbd ▸ gitRepo ▸ secret ▸ iscsi
  11. KUBERNETES SAMPLE NGINX NGINX LOAD BALANCER API API API API

    LOAD BALANCER NGINX DB LOAD BALANCER K8S SERVICE K8S SERVICE K8S SERVICE NGINX.NAMESPACE.SVC.K8S.LOCAL API.NAMESPACE.SVC.K8S.LOCAL DB.NAMESPACE.SVC.K8S.LOCAL
  12. SERVICE DISCOVERY FOR PODS ▸proxy runs on each node ▸virtual

    IP per service ▸dns address ▸[serviceName].[namespace].svc.k8s.local ▸dynamic “pods” based on label queries ▸pods are auto-injected with environment variables
  13. PARTITION RESOURCES ▸A mechanism to partition resources created by users

    into a logically named group ▸Allows for work to be done in isolation ▸Each namespace is given its own: 1.resources (pods, services, replication controllers, etc.) 2.policies (who can or cannot perform actions in their namespace) 3.constraints (this namespace is allowed this much quota, etc.)
  14. AUTOSCALER ▸allows the number of pods in a replication controller

    or deployment to scale automatically based on observed CPU utilization
  15. WHAT IS A DAEMON SET? ▸Ensure that all (or some)

    nodes run a copy of a pod ▸Examples: ▸running a cluster storage daemon (glusterd, ceph) ▸running a logs collection daemon on every node (fluentd or logstash) ▸running a node monitoring daemon on every node (Prometheus Node Exporter, collectd, New Relic agent, or Ganglia gmond)
  16. WHAT IS A JOB? ▸ Creates one or more pods

    and ensures that a specified number of them successfully terminate