Shifting Left With Cloud Native CI/CD QCon San Francisco 2019 - - PowerPoint PPT Presentation

shifting left with cloud native ci cd
SMART_READER_LITE
LIVE PREVIEW

Shifting Left With Cloud Native CI/CD QCon San Francisco 2019 - - PowerPoint PPT Presentation

Shifting Left With Cloud Native CI/CD QCon San Francisco 2019 @bobcatwilson @tektoncd Christie Wilson MY CAT Lead Engineer @ Google Tekton Co-Creator ME @bobcatwilson @tektoncd Make Mistakes! @bobcatwilson @tektoncd Rockstars Heroes


slide-1
SLIDE 1

@tektoncd @bobcatwilson

Shifting Left With Cloud Native CI/CD

QCon San Francisco 2019

slide-2
SLIDE 2

@tektoncd @bobcatwilson

Christie Wilson

Lead Engineer @ Google Tekton Co-Creator

MY CAT ME

slide-3
SLIDE 3

@tektoncd @bobcatwilson

Make Mistakes!

slide-4
SLIDE 4

@tektoncd @bobcatwilson

Rockstars Heroes Ninjas ... Janitors

slide-5
SLIDE 5

@tektoncd @bobcatwilson

Can’t have success without failure

slide-6
SLIDE 6

@tektoncd @bobcatwilson

Cloud Native CI/CD can make failure easier and cheaper

slide-7
SLIDE 7

@tektoncd @bobcatwilson

Agenda

  • What is Cloud Native?
  • What is Cloud Native CI/CD?
  • What is shifting left?
  • What is Tekton?
  • Demo!
  • What’s next for Tekton?
slide-8
SLIDE 8

@tektoncd @bobcatwilson

What is Cloud Native?

slide-9
SLIDE 9

@tektoncd @bobcatwilson

What is Cloud Native?

}

Microservices in containers

Images / Containers

Dynamically orchestrated Optimized resource utilization }

Kubernetes

slide-10
SLIDE 10

@tektoncd @bobcatwilson

wut?

slide-11
SLIDE 11

@tektoncd @bobcatwilson

Images/Containers

  • A binary and all of its dependencies
  • Containers share an OS
  • Run as resource isolated processes

Non-cloud native equivalent:

slide-12
SLIDE 12

@tektoncd @bobcatwilson

Kubernetes

  • Platform for managing containers
  • Abstracts away the underlying hardware

○ Computing ○ Networking ○ Storage

Non-cloud native equivalent:

  • People + wikis
  • Build your own!
  • Machine under your desk
slide-13
SLIDE 13

@tektoncd @bobcatwilson

A Few Kubernetes Concepts

slide-14
SLIDE 14

@tektoncd @bobcatwilson

Pod + Node

  • Node = machine you run stuff on

○ Could be a physical machine or VM

  • Pod = 1 or more containers

○ Run on the same pod

Non-cloud native equivalent:

  • Node -> Host machine
  • Pod -> Bunch of stuff you run together

○ e.g. My python process + supervisord + some proxy service

slide-15
SLIDE 15

@tektoncd @bobcatwilson

Yet Another Markup Language

slide-16
SLIDE 16

@tektoncd @bobcatwilson

Moar complicated

slide-17
SLIDE 17

@tektoncd @bobcatwilson

2008 complexity

slide-18
SLIDE 18

@tektoncd @bobcatwilson

Cloud Native complexity

slide-19
SLIDE 19

@tektoncd @bobcatwilson

Cloud Native complexity

  • Start with a webserver
  • End up with Kubernetes + Istio

+ Knative + Helm + Spinnaker* There is a lot to grok here and it’s constantly changing!

* Istio: Stuff for services to talk to each other Helm: Kubernetes package manager Knative: Serverless platform on Kubernetes Spinnaker: Control plane for deployment

slide-20
SLIDE 20

@tektoncd @bobcatwilson

Agenda

  • What is Cloud Native?
  • What is Cloud Native CI/CD?
  • What is shifting left?
  • What is Tekton?
  • Demo!
  • What’s next for Tekton?
slide-21
SLIDE 21

@tektoncd @bobcatwilson

What is CI/CD?

slide-22
SLIDE 22

@tektoncd @bobcatwilson

What is CI?

Literally integrating code together continually

Continuous Integration

slide-23
SLIDE 23

@tektoncd @bobcatwilson

Software Supply Chain

  • How does my code get from

source to running in prod?

  • What pieces are involved?
  • CI/CD = build, test + deploy
slide-24
SLIDE 24

@tektoncd @bobcatwilson

Cloud Native CI/CD

The Definitive* Definition

* aka defined by me

1. Serverless 2. Specs and standards 3. Reusable components 4. Infrastructure agnostic 5. Config as code

slide-25
SLIDE 25

@tektoncd @bobcatwilson

Cloud Native CI/CD

  • 1. Serverless
  • 2. Specs and standards
  • 3. Reusable components
  • 4. Infrastructure agnostic
  • 5. Config as code
slide-26
SLIDE 26

@tektoncd @bobcatwilson

Serverless CI/CD

  • Scaling up and down resources

as needed

  • You specify what you want to

run, freed of the much of responsibility to manage the underlying resources

slide-27
SLIDE 27

@tektoncd @bobcatwilson

Serverless CI/CD

  • Don’t need to waste resources
  • No need for monolithic

execution

slide-28
SLIDE 28

@tektoncd @bobcatwilson

Cloud Native CI/CD

  • 1. Serverless
  • 2. Specs and standards
  • 3. Reusable components
  • 4. Infrastructure agnostic
  • 5. Config as code
slide-29
SLIDE 29

@tektoncd @bobcatwilson

Specs & Standards

Doesn’t have to be perfect, just good enough & widely used

  • Part of what makes k8s so cool

is that it’s a spec we can all agree on

slide-30
SLIDE 30

@tektoncd @bobcatwilson

Specs & Standards

Infinite extensibility!

  • Any k8s resource can be

manipulated (e.g. with controllers, admission webhooks)

  • Anything built on k8s can be

manipulated with k8s tools

slide-31
SLIDE 31

@tektoncd @bobcatwilson

Cloud Native CI/CD

  • 1. Serverless
  • 2. Specs and standards
  • 3. Reusable components
  • 4. Infrastructure agnostic
  • 5. Config as code
slide-32
SLIDE 32

@tektoncd @bobcatwilson

Reusable components

Do we need another Slack notification plugin?

  • Write it once, use it again and

and again

  • Kubernetes is itself a building

block, that enables the creation

  • f more building blocks
slide-33
SLIDE 33

@tektoncd @bobcatwilson

Cloud Native CI/CD

  • 1. Serverless
  • 2. Specs and standards
  • 3. Reusable components
  • 4. Infrastructure agnostic
  • 5. Config as code
slide-34
SLIDE 34

@tektoncd @bobcatwilson

Use your own infra

Infrastructure agnostic

  • A kubernetes pod is a

kubernetes pod

  • If you can deploy to prod kube,

it should be possible to deploy to your kube

  • Use the same config!
slide-35
SLIDE 35

@tektoncd @bobcatwilson

Use your own infra

Shift left

  • The sooner you fail the better!
  • Perform testing earlier in your

lifecycle

  • Why not do it before the code

is pushed!

slide-36
SLIDE 36

@tektoncd @bobcatwilson

Use your own infra

Parity

  • Make the complexity of

kubernetes worth it!

  • Pre-kube, it was nearly

impossible for me to setup a production like environment on my own machine

slide-37
SLIDE 37

@tektoncd @bobcatwilson

Cloud Native CI/CD

  • 1. Serverless
  • 2. Specs and standards
  • 3. Infrastructure agnostic
  • 4. Reusable components
  • 5. Config as code
slide-38
SLIDE 38

@tektoncd @bobcatwilson

Config as Code

Even the YAML

slide-39
SLIDE 39

@tektoncd @bobcatwilson

Learning & Debugging

Fail easily!

  • As our systems get more

complicated, we need to be able to learn faster

  • We need to be able to look at

what the system are doing

slide-40
SLIDE 40

@tektoncd @bobcatwilson

Debugging = Learning

slide-41
SLIDE 41

@tektoncd @bobcatwilson

The faster you can learn, the faster you can deliver value

slide-42
SLIDE 42

@tektoncd @bobcatwilson

slide-43
SLIDE 43

@tektoncd @bobcatwilson

How do we debug?

  • By poking and prodding the

thing

  • Looking at what it’s doing
  • Changing it, seeing what

happens

slide-44
SLIDE 44

@tektoncd @bobcatwilson

Agenda

  • What is Cloud Native?
  • What is Cloud Native CI/CD?
  • What is shifting left?
  • What is Tekton?
  • Demo!
  • What’s next for Tekton?
slide-45
SLIDE 45

@tektoncd @bobcatwilson

Shifting Left

slide-46
SLIDE 46

@tektoncd @bobcatwilson

Software development

slide-47
SLIDE 47

@tektoncd @bobcatwilson

Cost of defects

slide-48
SLIDE 48

@tektoncd @bobcatwilson

Shift Left

Fail earlier!

There WILL be defects

  • Test earlier!
  • Catch failures earlier!
slide-49
SLIDE 49

@tektoncd @bobcatwilson

Shift Left

slide-50
SLIDE 50

@tektoncd @bobcatwilson

Shifting Left with Cloud Native

slide-51
SLIDE 51

@tektoncd @bobcatwilson

Agenda

  • What is Cloud Native?
  • What is Cloud Native CI/CD?
  • What is shifting left?
  • What is Tekton?
  • Demo!
  • What’s next for Tekton?
slide-52
SLIDE 52

@tektoncd @bobcatwilson

slide-53
SLIDE 53

@tektoncd @bobcatwilson

Tekton is Cloud Native CI/CD

Tekton is a Cloud Native CI/CD building block!

slide-54
SLIDE 54

@tektoncd @bobcatwilson

The CDF

slide-55
SLIDE 55

@tektoncd @bobcatwilson

Contributors from:

  • Google
  • CloudBees
  • Red Hat
  • IBM
  • Salesforce
  • Puppet
  • … and more!

New contributor friendly!

slide-56
SLIDE 56

@tektoncd @bobcatwilson

Porcelain vs Plumbing

Toilet vs. Plumbing Underneath

slide-57
SLIDE 57

@tektoncd @bobcatwilson

Who is Tekton for?

Developers building CI/CD systems End users that want DIY All users that want a catalog of reusable CI/CD

Now! Now! Watch this Space

slide-58
SLIDE 58

@tektoncd @bobcatwilson

CRDs

  • Extending kubernetes

with custom types

  • Controllers act on

Resources

  • = CI/CD platform on

Kubernetes

Custom Resource Definitions

slide-59
SLIDE 59

@tektoncd @bobcatwilson

  • Is actually a container spec (k8s type)
  • Container image +

○ Environment variables ○ Arguments ○ Volumes ○ etc.

Steps

slide-60
SLIDE 60

@tektoncd @bobcatwilson

  • New CRD
  • Sequence of steps
  • Run in sequential order
  • Run on the same k8s node

Task CRD

slide-61
SLIDE 61

@tektoncd @bobcatwilson

  • Express Tasks order

○ Sequentially ○ Concurrently ○ (Graph)

  • Execute Tasks on different nodes
  • Link inputs and outputs

Pipeline CRD

slide-62
SLIDE 62

@tektoncd @bobcatwilson

Runtime CRDs

  • Instances of Pipeline/Task:

○ PipelineRun ○ TaskRun

  • PipelineResource

○ Runtime info like image registry, git repo, etc.

slide-63
SLIDE 63

@tektoncd @bobcatwilson

Tekton Pipeline CRDs

slide-64
SLIDE 64

@tektoncd @bobcatwilson

PipelineResources + Software Supply Chain

  • Typed artifacts moving through your supply chain

PipelineResources

slide-65
SLIDE 65

@tektoncd @bobcatwilson

But I want to make PipelineRun whenever I open a Pull Request?

slide-66
SLIDE 66

@tektoncd @bobcatwilson

Tekton Triggers CRDs

slide-67
SLIDE 67

@tektoncd @bobcatwilson

Cloud Native CI/CD Tekton

Serverless Serverless execution Specs and standards Tekton API Infrastructure agnostic Containers are the building block Reusable components + Config as Code Tasks, Pipelines, PipelineResources, TriggerTemplates, TriggerBindings, EventListeners

slide-68
SLIDE 68

@tektoncd @bobcatwilson

Agenda

  • What is Cloud Native?
  • What is Cloud Native CI/CD?
  • What is shifting left?
  • What is Tekton?
  • Demo!
  • What’s next for Tekton?
slide-69
SLIDE 69

@tektoncd @bobcatwilson

Tekton Demo

CI/CD config living alongside the code Ran it on my cluster! Used kubernetes tools Reproducible Serverless execution

slide-70
SLIDE 70

@tektoncd @bobcatwilson

Agenda

  • What is Cloud Native?
  • What is Cloud Native CI/CD?
  • What is shifting left?
  • What is Tekton?
  • Demo!
  • What’s next for Tekton?
slide-71
SLIDE 71

@tektoncd @bobcatwilson

Tekton: Roadmap

2019 Q3

  • Tekton Triggers 0.1

2020 Q1

  • Tekton Pipelines Beta

2020 +

  • Catalog!
  • Manual approvals, notifjcations,
  • ther cool advanced CI/CD stufg
slide-72
SLIDE 72

@tektoncd @bobcatwilson

Join in!

  • tekton.dev
  • github.com/tektoncd/pipeline
  • github.com/tektoncd/community
  • CDF Summit at Kubecon NA (Nov 18)

cds2019.sched.com

events.linuxfoundation.org/events/kubecon-cloudn ativecon-north-america-2019/co-located-events/

  • @tektoncd on Twitter!
slide-73
SLIDE 73

@tektoncd @bobcatwilson

Software we think we should be making Software we actually make

Nailed it!

Thanks!

slide-74
SLIDE 74

@tektoncd @bobcatwilson

Sources

  • Richard Montañez, inventor of flaming hot cheetos:

www.cnbc.com/2018/03/27/a-janitor-invented-flamin-hot-cheetos-and-became

  • a-pepsico-exec.html
  • What is serverless: martinfowler.com/articles/serverless.html
  • Building a Debugging Mindset:

www.slideshare.net/InfoQ/building-a-debugging-mindset

  • Learning is the most important skill:

twitter.com/ASpittel/status/1101165138361479169

  • Tekton: github.com/tektoncd/pipeline