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

Kubecon: Continuously Delivering Microservices in Kubernetes

Kubecon: Continuously Delivering Microservices in Kubernetes

Sandeep Parikh

November 10, 2015
Tweet

More Decks by Sandeep Parikh

Other Decks in Technology

Transcript

  1. Continuous Delivery in Kubernetes
    Sandeep Parikh
    @crcsmnky
    Solutions Architect
    Google Cloud Platform

    View Slide

  2. Why Is This Important
    Bulletproof process to go from code to production
    Centralized, repeatable building/tagging/pushing
    Iterate quickly and reliably
    Hands off my kubectl

    View Slide

  3. Continuous Integration
    Test
    Code Commit Push Test
    Build
    The ideal development flow

    View Slide

  4. Continuous Integration
    Test
    Code Commit Push Test
    Build
    The ideal development flow
    Test
    D’oh!
    Code Commit Push
    Test
    Crap!
    Build
    Whoops!
    The real development flow

    View Slide

  5. Continuous Delivery
    Test
    Build Deploy
    Testing
    Staging

    View Slide

  6. Continuous Deployment
    Deploy
    Approve
    Deliver Profit

    View Slide

  7. Why Continuous?
    Fail fast
    I broke the build!
    Blame fast
    Who broke the build?
    Deliver faster
    Better software in customers hands!

    View Slide

  8. Tools

    View Slide

  9. Jenkins

    View Slide

  10. Kubernetes Cluster (GKE)
    Kubernetes Cluster
    Node 1 Node 3
    Node 2

    View Slide

  11. Kubernetes Cluster (GKE)
    Jenkins Leader
    Node 1 Node 3
    Node 2
    Jenkins
    Leader

    View Slide

  12. Kubernetes Cluster (GKE)
    Jenkins Service
    Node 1 Node 3
    Node 2
    Jenkins
    Leader
    Jenkins
    Service

    View Slide

  13. Kubernetes Cluster (GKE)
    Jenkins Builder
    Node 1 Node 3
    Node 2
    Jenkins
    Leader
    Jenkins
    Builder
    Jenkins
    Builder
    Jenkins
    Builder
    Jenkins
    Builder
    Jenkins
    Service
    Jenkins
    Builder

    View Slide

  14. Kubernetes Cluster (GKE)
    Jenkins Proxy
    Node 1 Node 3
    Node 2
    Jenkins
    Leader
    Jenkins
    Builder
    Jenkins
    Builder
    Jenkins
    Builder
    Jenkins
    Builder
    Jenkins
    Service
    Jenkins
    Builder
    nginx

    View Slide

  15. Kubernetes Cluster (GKE)
    Jenkins Proxy Service
    Node 1 Node 3
    Node 2
    Jenkins
    Leader
    Jenkins
    Builder
    Jenkins
    Builder
    Jenkins
    Builder
    Jenkins
    Builder
    Jenkins
    Service
    Jenkins
    Builder
    nginx
    nginx
    Service

    View Slide

  16. Microservices

    View Slide

  17. View Slide

  18. Kubernetes Cluster (GKE)
    Microservices
    Node 2
    Node 1
    Backend
    Frontend Frontend
    Backend
    Service
    Frontend
    Frontend
    Service
    Backend Backend

    View Slide

  19. Microservices & Namespaces
    Virtual clusters backed by the same physical cluster
    Divide cluster resources by different use cases
    Supports quotas for managing resources
    Test, Staging, Production, etc.

    View Slide

  20. Pods
    Time
    Microservices & Rolling Update
    Replace Replication Controller A with Replication Controller B by updating one Pod
    at a time.
    A
    B
    A
    B
    A
    B A
    B
    A
    B
    A
    B

    View Slide

  21. Workflow

    View Slide

  22. Kubernetes Workflow
    Create
    Push
    Package Expose

    View Slide

  23. Mapping To Jenkins
    Workflow plugin, Freestyle doesn’t fit
    Define a flexible, extensible, script-based CD pipeline
    Groovy for scripting actions
    Supports human input/approval

    View Slide

  24. Workflow
    Repo
    Kubernetes Cluster (GKE)
    Github
    Jenkins
    µservice
    µservice
    Default Staging
    Production

    View Slide

  25. Workflow
    Repo
    Kubernetes Cluster (GKE)
    Github
    Jenkins
    µservice
    µservice
    Default Staging
    Production
    1
    Push
    1

    View Slide

  26. Workflow
    Repo
    Kubernetes Cluster (GKE)
    Github
    Jenkins
    µservice
    µservice
    Default Staging
    Production
    1 2
    Push
    Build
    1
    2

    View Slide

  27. Workflow
    Repo
    Kubernetes Cluster (GKE)
    Github
    Jenkins
    µservice
    µservice
    Default Staging
    Production
    1 2
    3
    Push
    Build
    Clone
    1
    2
    3

    View Slide

  28. Workflow
    Repo
    Kubernetes Cluster (GKE)
    Github
    Jenkins
    µservice
    µservice
    Default Staging
    Production
    1 2
    3
    4
    Push
    Build
    Clone
    Stage
    1
    2
    3
    4

    View Slide

  29. Workflow
    Repo
    Kubernetes Cluster (GKE)
    Github
    Jenkins
    µservice
    µservice
    Default Staging
    Production
    1 2
    3
    5
    4
    Push
    Build
    Clone
    Stage
    Approve
    1
    2
    3
    4
    5

    View Slide

  30. Workflow
    Repo
    Kubernetes Cluster (GKE)
    Github
    Jenkins
    µservice
    µservice
    Default Staging
    Production
    1 2
    3
    5
    4
    Push
    Build
    Clone
    Stage
    Approve
    Deploy
    1
    2
    3
    4
    5
    6
    6

    View Slide

  31. Demo
    Come find me after the talk and I
    promise I’ll run it live :)

    View Slide

  32. Shout Out
    Give Evan Brown (@evanbrown) a high-five next time you see him. He’s
    super smart and got this whole thing working.

    View Slide

  33. Questions, Comments
    @crcsmnky
    Repo
    https://github.com/GoogleCloudPlatform/continuous-deployment-on-kubernetes
    Docs
    Automated Image Builds with Jenkins, Packer, and Kubernetes
    Distributed Load Testing using Kubernetes
    Real-time data analysis with Kubernetes, Google Cloud Pub/Sub, and BigQuery
    Real-time data analysis with Kubernetes, Redis, and BigQuery
    Resources

    View Slide