Continuously Delivery in Kubernetes

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

Transcript of Continuously Delivery in Kubernetes

Continuous Delivery in KubernetesSandeep Parikh@crcsmnkySolutions ArchitectGoogle Cloud Platform

Why Is This ImportantBulletproof process to go from code to production

Centralized, repeatable building/tagging/pushing

Iterate quickly and reliably

Hands off my kubectl

Continuous Integration

TestCode Commit Push TestBuild

The ideal development flow

Continuous Integration

TestCode Commit Push TestBuild

The ideal development flow

TestD’oh!Code Commit Push Test

Crap!Build

Whoops!

The real development flow

Continuous Delivery

TestBuild Deploy

Testing

Staging

Continuous Deployment

DeployApproveDeliver Profit

Why Continuous?Fail fast

I broke the build!

Blame fast

Who broke the build?

Deliver faster

Better software in customers hands!

Tools

Jenkins

Kubernetes Cluster (GKE)

Kubernetes Cluster

Node 1 Node 3Node 2

Kubernetes Cluster (GKE)

Jenkins Leader

Node 1 Node 3Node 2

Jenkins Leader

Kubernetes Cluster (GKE)

Jenkins Service

Node 1 Node 3Node 2

Jenkins Leader

Jenkins Service

Kubernetes Cluster (GKE)

Jenkins Builder

Node 1 Node 3Node 2

Jenkins Leader

Jenkins Builder

Jenkins Builder

Jenkins Builder

Jenkins Builder

Jenkins Service

Jenkins Builder

Kubernetes Cluster (GKE)

Jenkins Proxy

Node 1 Node 3Node 2

Jenkins Leader

Jenkins Builder

Jenkins Builder

Jenkins Builder

Jenkins Builder

Jenkins Service

Jenkins Builder

nginx

Kubernetes Cluster (GKE)

Jenkins Proxy Service

Node 1 Node 3Node 2

Jenkins Leader

Jenkins Builder

Jenkins Builder

Jenkins Builder

Jenkins Builder

Jenkins Service

Jenkins Builder

nginxnginx Service

Microservices

Kubernetes Cluster (GKE)

Microservices

Node 2Node 1

Backend

Frontend Frontend

Backend Service

Frontend

Frontend Service

Backend Backend

Microservices & NamespacesVirtual clusters backed by the same physical cluster

Divide cluster resources by different use cases

Supports quotas for managing resources

Test, Staging, Production, etc.

Pods

Time

Microservices & Rolling UpdateReplace Replication Controller A with Replication Controller B by updating one Pod at a time.

A

B

A

B

AB A

B

A

B

A

B

Workflow

Kubernetes Workflow

CreatePushPackage Expose

Mapping To JenkinsWorkflow plugin, Freestyle doesn’t fit

Define a flexible, extensible, script-based CD pipeline

Groovy for scripting actions

Supports human input/approval

Workflow

Repo

Kubernetes Cluster (GKE)Github

Jenkins

µservice

µservice

Default Staging

Production

Workflow

Repo

Kubernetes Cluster (GKE)Github

Jenkins

µservice

µservice

Default Staging

Production1

Push1

Workflow

Repo

Kubernetes Cluster (GKE)Github

Jenkins

µservice

µservice

Default Staging

Production1 2

Push

Build

1

2

Workflow

Repo

Kubernetes Cluster (GKE)Github

Jenkins

µservice

µservice

Default Staging

Production1 2

3

Push

Build

Clone

1

2

3

Workflow

Repo

Kubernetes Cluster (GKE)Github

Jenkins

µservice

µservice

Default Staging

Production1 2

3

4

Push

Build

Clone

Stage

1

2

3

4

Workflow

Repo

Kubernetes Cluster (GKE)Github

Jenkins

µservice

µservice

Default Staging

Production1 2

3

5

4

Push

Build

Clone

Stage

Approve

1

2

3

4

5

Workflow

Repo

Kubernetes Cluster (GKE)Github

Jenkins

µservice

µservice

Default Staging

Production1 2

3

5

4

Push

Build

Clone

Stage

Approve

Deploy

1

2

3

4

5

6

6

DemoCome find me after the talk and I

promise I’ll run it live :)

Shout Out

Give Evan Brown (@evanbrown) a high-five next time you see him. He’s

super smart and got this whole thing working.