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

2016 DevOps Summit Taipei - CICD with Kubernetes

Ray Tsang
August 18, 2016

2016 DevOps Summit Taipei - CICD with Kubernetes

Ray Tsang

August 18, 2016
Tweet

More Decks by Ray Tsang

Other Decks in Technology

Transcript

  1. @saturnism @googlecloud #kubernetes “ ” SRE is what happens when

    you ask a software engineer to design and run operations. Ben Treynor Sloss 24x7 VP, Google
  2. @saturnism @googlecloud #kubernetes Package & Deployment application.ear app.war helloworld-service.jar guestbook-service.jar

    apache-xyz.jar application.war /... helloworld-service.jar guestbook-service.jar apache-xyz.jar
  3. @saturnism @googlecloud #kubernetes Machine app.war / app.ear Application Server Kernel

    Shell / CLI / Tools Machine app.war / app.ear Application Server Kernel Shell / CLI / Tools Machine app.war / app.ear Application Server Kernel Shell / CLI / Tools
  4. @saturnism @googlecloud #kubernetes job hello_world = { runtime = {

    cell = 'ic' } // Cell (cluster) to run in binary = '.../hello_world_webserver' // Program to run args = { port = '%port%' } // Command line parameters requirements = { // Resource requirements ram = 100M disk = 100M cpu = 0.1 } replicas = 5 // Number of tasks } 10000 Developer View
  5. @saturnism @googlecloud #kubernetes web browsers BorgMaster link shard UI shard

    BorgMaster link shard UI shard BorgMaster link shard UI shard BorgMaster link shard UI shard Scheduler borgcfg web browsers scheduler Borglet Borglet Borglet Borglet Config file BorgMaster link shard UI shard persistent store (Paxos) Binary Developer View What just happened?
  6. @saturnism @googlecloud #kubernetes Hello world! Hello world! Hello world! Hello

    world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Image by Connie Zhou Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world!
  7. @saturnism @googlecloud #kubernetes Kubernetes Greek for “Helmsman”; also the root

    of the words “governor” and “cybernetic” • Infrastructure for containers • Schedules, runs, and manages containers on virtual and physical machines • Platform for automating deployment, scaling, and operations • Inspired and informed by Google’s experiences and internal systems • 100% Open source, written in Go
  8. @saturnism @googlecloud #kubernetes web browsers Scheduler kubectl web browsers scheduler

    Kubelet Kubelet Kubelet Kubelet Config file Kubernetes Master Container Image Developer View What just happened?
  9. @saturnism @googlecloud #kubernetes Challenges Which host machine(s) should each service

    run on? Avoid port conflicts? How does the application code find the Guest Book service? How do we keep all of these service running? What happens if a host machine has trouble? Are the services healthy? How do we scale when load changes? Run this in another environment? QA, dev, another cloud, your servers?
  10. @saturnism @googlecloud #kubernetes Developer View spec: containers: - name: myservice

    image: myservice resources: limits: memory: "128Mi" cpu: "0.1" ports: - containerPort: 3306 protocol: TCP replicas: 1 10000
  11. @saturnism @googlecloud #kubernetes Group of containers Live and die together

    Shared network interface Shared volumes Unique Routable IP Pod App Log Collector Pods ...
  12. @saturnism @googlecloud #kubernetes Pod IPs are routable • Docker default

    is private IP Pods can reach each other without NAT • even across nodes No brokering of port numbers This is a fundamental requirement • several SDN solutions Inter-Pods Networking
  13. @saturnism @googlecloud #kubernetes Label anything Name-value pair Make your own

    Pod App Log Collector Labels ... type = Frontend version = 1.0
  14. @saturnism @googlecloud #kubernetes Replication Controller Replicas → 2 Pod frontend

    Pod App Log Collector ... type = Frontend version = 1.0 Pod App Log Collector ... type = Frontend version = 1.0 Replication Controllers
  15. @saturnism @googlecloud #kubernetes Replication Controller Replicas → 1 Pod App

    Log Collector ... type = Frontend version = 1.0 Replication Controllers
  16. @saturnism @googlecloud #kubernetes Replication Controllers node 1 f0118 node 3

    node 4 node 2 d9376 b0111 a1209 Replication Controller - Desired = 4 - Current = 4
  17. @saturnism @googlecloud #kubernetes Replication Controllers node 1 f0118 node 3

    node 4 node 2 Replication Controller - Desired = 4 - Current = 4 d9376 b0111 a1209
  18. @saturnism @googlecloud #kubernetes Replication Controllers node 1 f0118 node 3

    node 4 Replication Controller - Desired = 4 - Current = 3 b0111 a1209
  19. @saturnism @googlecloud #kubernetes Replication Controllers node 1 f0118 node 3

    node 4 Replication Controller - Desired = 4 - Current = 4 b0111 a1209 c9bad
  20. @saturnism @googlecloud #kubernetes Replication Controller Replicas → 2 Pod frontend

    Pod type = Frontend version = 1.0 Pod type = Frontend version = 1.0 Services Service Label selectors: version = 1.0 type = Frontend
  21. @saturnism @googlecloud #kubernetes Pod frontend Pod type = Frontend version

    = 1.0 Pod type = Frontend version = 1.0 Services Service Label selectors: version = 1.0 type = Frontend Pod type = Frontend version = 2.0
  22. @saturnism @googlecloud #kubernetes Pod frontend Pod type = Frontend version

    = 1.0 Pod type = Frontend version = 1.0 Services Service Label selectors: type = Frontend Pod type = Frontend version = 2.0