effective devops - velocity new york 2015

152
Effec%ve Devops: Collabora'on and Tools Jennifer Davis & Katherine Daniels @beerops @sigje #effec/vedevops 1

Upload: jennifer-davis

Post on 13-Apr-2017

1.734 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Effective Devops - Velocity New York 2015

Effec%ve'Devops:Collabora'on)and)Tools

Jennifer'Davis'&'Katherine'Daniels

✨ @beerops(@sigje(#effec/vedevops✨ 1

Page 2: Effective Devops - Velocity New York 2015

Jennifer'Davis• So$ware)Engineer,)Chef)So$ware

• Co2author)of)"Effec8ve)Devops"

• Founder)of)CoffeeOps

• DevOpsDays)Silicon)Valley)Organizer

✨ @beerops(@sigje(#effec/vedevops✨ 2

Page 3: Effective Devops - Velocity New York 2015

Katherine)Daniels• Senior(Opera,ons(Engineer,(Etsy

• Co4author(of("Effec,ve(Devops"

• DevopsDays(NYC(Organizer

• Ship(Show(Podcast(Co4host

✨ @beerops(@sigje(#effec/vedevops✨ 3

Page 4: Effective Devops - Velocity New York 2015

Communica)on• Jennifer(DavisTwi/er:(@sigjeEmail:([email protected]

• Katherine(DanielsTwi/er:(@beeropsEmail:([email protected]

Twi$er:(#effec,vedevops

✨ @beerops(@sigje(#effec/vedevops✨ 4

Page 5: Effective Devops - Velocity New York 2015

Feedback• Construc*ve-feedback

• What-did-you-find-helpful?

• What-would-you-like-to-see-more/less-of?

• Was-there-anything-you-found-unclear?

✨ @beerops(@sigje(#effec/vedevops✨ 5

Page 6: Effective Devops - Velocity New York 2015

Schedule• Introduc*on+to+teams,+devops+principles

• 10:30911:00am+Morning+Break+9+Su?on+Complex

• Visualiza*on+of+work,+Git,+Infrastructure+automa*on

• 12:3091:30pm+Lunch+9+Americas+Halls+1+&+2

✨ @beerops(@sigje(#effec/vedevops✨ 6

Page 7: Effective Devops - Velocity New York 2015

Schedule• Tes%ng(infrastucture(automa%on(and(other(changes

• 3:0073:30pm(A:ernoon(Break(7(Su>on(Complex

• Measuring,(monitoring,(and(wrap7up

• Ignites:(Beekman(Parlor((with(Katherine)

✨ @beerops(@sigje(#effec/vedevops✨ 7

Page 8: Effective Devops - Velocity New York 2015

Network(Connec,vity

Network(Name:(VelocityAccess(Code:((none)

Local&Downloads:&h.p://10.10.32.101

✨ @beerops(@sigje(#effec/vedevops✨ 8

Page 9: Effective Devops - Velocity New York 2015

Expecta(ons• Safe&space&to&share&experiences,&learn&from&each&other

• Code&of&Conduct

• Learn&effec9ve&workflows&for&using&and&tes9ng&source&control&and&configura9on&management

✨ @beerops(@sigje(#effec/vedevops✨ 9

Page 10: Effective Devops - Velocity New York 2015

Team%Introduc.ons

• Meet%your%team!

• What%are%mo/va/ons?%What%are%current%beliefs?%What%are%current%skills?%Gaps%in%skills?

Time:&20&minutes

✨ @beerops(@sigje(#effec/vedevops✨ 10

Page 11: Effective Devops - Velocity New York 2015

What%is%Devops

✨ @beerops(@sigje(#effec/vedevops✨ 11

Page 12: Effective Devops - Velocity New York 2015

What%is%Devops

Cultural'movement'that'seeks'to:

• change(how(individuals(work,

• value(the(diversity(of(work(done,

• develop(conscious(decisions(in(accelera8on,

• plan(for(scale,(and

• measure(the(effect(of(social(and(technical(change.

✨ @beerops(@sigje(#effec/vedevops✨ 12

Page 13: Effective Devops - Velocity New York 2015

Folk%Models• general(popularly(understood(meaning(par2cular(to(a(socio4cultural(grouping(but(which(has(not(been(formally(defined(or(standardized.

✨ @beerops(@sigje(#effec/vedevops✨ 13

Page 14: Effective Devops - Velocity New York 2015

Why$Devops?

✨ @beerops(@sigje(#effec/vedevops✨ 14

Page 15: Effective Devops - Velocity New York 2015

High%Performing%Devops%Teams

are$more$agile

30X$more$frequent$deployments

8000X$faster$lead$-mes$than$peers

2014%PuppetLabs%State%of%DevOps%Survey

✨ @beerops(@sigje(#effec/vedevops✨ 15

Page 16: Effective Devops - Velocity New York 2015

High%Performing%Devops%Teams

are$more$reliable

2X#change#success#rate

12X$faster$mean$-me$to$recovery$(MTTR)

2014%PuppetLabs%State%of%DevOps%Survey

✨ @beerops(@sigje(#effec/vedevops✨ 16

Page 17: Effective Devops - Velocity New York 2015

Five%Pillars%of%Effec0ve%Devops

• Collabora(on

• Hiring

• Affinity

• Tools

• Scaling

✨ @beerops(@sigje(#effec/vedevops✨ 17

Page 18: Effective Devops - Velocity New York 2015

Collabora'on• Individuals+Working+Together

✨ @beerops(@sigje(#effec/vedevops✨ 18

Page 19: Effective Devops - Velocity New York 2015

Hiring• Choosing)Individuals

✨ @beerops(@sigje(#effec/vedevops✨ 19

Page 20: Effective Devops - Velocity New York 2015

Affinity• From&Individuals&to&Teams

✨ @beerops(@sigje(#effec/vedevops✨ 20

Page 21: Effective Devops - Velocity New York 2015

Tools• Accelerators+of+Culture

✨ @beerops(@sigje(#effec/vedevops✨ 21

Page 22: Effective Devops - Velocity New York 2015

Scaling• Evolu'on,*growth*and*advancement*of*the*organiza'on

✨ @beerops(@sigje(#effec/vedevops✨ 22

Page 23: Effective Devops - Velocity New York 2015

Collabora'on)and)Tools

✨ @beerops(@sigje(#effec/vedevops✨ 23

Page 24: Effective Devops - Velocity New York 2015

Recognizing)your)Devops)Narra3ve

✨ @beerops(@sigje(#effec/vedevops✨ 24

Page 25: Effective Devops - Velocity New York 2015

The$Devops$Compact• shared(mutual(understanding

• established(boundaries

✨ @beerops(@sigje(#effec/vedevops✨ 25

Page 26: Effective Devops - Velocity New York 2015

Team• Common&purpose

• Defined&beliefs

• Empowered

✨ @beerops(@sigje(#effec/vedevops✨ 26

Page 27: Effective Devops - Velocity New York 2015

Careless'Conversa+ons'(inspired'by'Alan'Cyment)

• Pair&up

• Select&one&person&to&go&first.

• For&one&minute,&speaker&talks&about&something&passionate&about.&Listener&stays&seated,&quiet,&and&acts&disinterested.

• Switch&roles&and&repeat.

• Repeat&un@l&both&people&have&done&this&twice.

Time:&5&minutes✨ @beerops(@sigje(#effec/vedevops✨ 27

Page 28: Effective Devops - Velocity New York 2015

Careless'Conversa+ons

• How%does%it%feel%not%to%be%listened%to?

• How%does%it%feel%to%ignore%someone?

✨ @beerops(@sigje(#effec/vedevops✨ 28

Page 29: Effective Devops - Velocity New York 2015

Cul$va$ng)Empathy

• Collect(stories

• Listen

• Circle(back

✨ @beerops(@sigje(#effec/vedevops✨ 29

Page 30: Effective Devops - Velocity New York 2015

Smarter'Teams'Build'Be/er'Value1

• Lots&of&Communica/on

• Contribute&equally&to&team's&discussions

• Theory&of&Mind

• Increased&diversity

1"Engel,"David"et"al."'Reading"The"Mind"In"The"Eyes"Or"Reading"Between"The"Lines?"Theory"Of"Mind"Predicts"CollecCve"Intelligence"Equally"Well"Online"And"FaceIToIFace'."PLoS"ONE"9.12"(2014):"e115212."Web."26"May"2015.

✨ @beerops(@sigje(#effec/vedevops✨ 30

Page 31: Effective Devops - Velocity New York 2015

A"life"becomes"meaningful"when"one"sees"himself"or"herself"as"an"actor"within"the"context"of"a"story.

!!"George"Howard

✨ @beerops(@sigje(#effec/vedevops✨ 31

Page 32: Effective Devops - Velocity New York 2015

Small%vs%Large%teams• Large'teams'+'roles'may'be'highly'segregated

• Small'teams'+'one'person'may'be'responsible'for'many'roles

✨ @beerops(@sigje(#effec/vedevops✨ 32

Page 33: Effective Devops - Velocity New York 2015

Cri$cal(Habits(for(Teams• Code&Review

• Pairing

✨ @beerops(@sigje(#effec/vedevops✨ 33

Page 34: Effective Devops - Velocity New York 2015

Code%Review• Max%90%minutes%in%one%se0ng

✨ @beerops(@sigje(#effec/vedevops✨ 34

Page 35: Effective Devops - Velocity New York 2015

Pairing• Agile'so*ware'development

• 2'people'work'together'on'1'worksta8on

• Driver':'writes'code

• Observer':'reviews'each'line

• Roles'switch'frequently

✨ @beerops(@sigje(#effec/vedevops✨ 35

Page 36: Effective Devops - Velocity New York 2015

Types&of&Pairing• Expert(expert

• Expert(novice

• Novice(novice

✨ @beerops(@sigje(#effec/vedevops✨ 36

Page 37: Effective Devops - Velocity New York 2015

Visualiza(on+of+Work• Bug/issue)queue

• Kanban

✨ @beerops(@sigje(#effec/vedevops✨ 37

Page 38: Effective Devops - Velocity New York 2015

Factors(for(Success• Management)buy)in

• Training

• Minimize)'pushing'

• Team)sync

✨ @beerops(@sigje(#effec/vedevops✨ 38

Page 39: Effective Devops - Velocity New York 2015

Workflow

Work%that%is

• orchestrated

• repeatable

• organized

• moves4from4one4state4to4another

✨ @beerops(@sigje(#effec/vedevops✨ 39

Page 40: Effective Devops - Velocity New York 2015

WIP• Work&in&Progress

• work&that&has&had&money&or&people&applied&to&it.

✨ @beerops(@sigje(#effec/vedevops✨ 40

Page 41: Effective Devops - Velocity New York 2015

Work%Iden*fica*on• name

• start)date

• end)date

• current)state

• descrip/on

• priority

✨ @beerops(@sigje(#effec/vedevops✨ 41

Page 42: Effective Devops - Velocity New York 2015

Task%Handling• What&is&it?

• Can&you&do&anything&with&it?

• What&is&the&next&step?

✨ @beerops(@sigje(#effec/vedevops✨ 42

Page 43: Effective Devops - Velocity New York 2015

Projects• Same&requirements&as&a&task

• Larger&in&scope

• May&be&comprised&of&more&than&one&task

✨ @beerops(@sigje(#effec/vedevops✨ 43

Page 44: Effective Devops - Velocity New York 2015

Interrupts• Non%planned%work%that%comes%in

• customer%request

• incident

• request%for%help%from%coworker

• single%point%of%knowledge%(you)%work

• high%priority%task%push%from%manager

✨ @beerops(@sigje(#effec/vedevops✨ 44

Page 45: Effective Devops - Velocity New York 2015

Blocked(work• Work&that&can&progress&no&further:

• dependent&teams&5&blocked&by&external&team

• insufficiently&qualified&request&5&blocked&by&requester

• dependent&on&SPOK&5&blocked&by&team

• Bme&dependent

✨ @beerops(@sigje(#effec/vedevops✨ 45

Page 46: Effective Devops - Velocity New York 2015

Team%Exercise

Discuss&with&your&team:

• What&is&the&difference&between&a&task&and&a&project?

• Do&you&have&interrupts?&What&are&they?

• How&do&you&determine&when&work&is&done?

Time:&15&minutes

✨ @beerops(@sigje(#effec/vedevops✨ 46

Page 47: Effective Devops - Velocity New York 2015

Kanban• Start&with&what&you&do&now

• Agree&to&incremental,&evolu7onary&change

• Respect

• Everyone&is&a&leader

✨ @beerops(@sigje(#effec/vedevops✨ 47

Page 48: Effective Devops - Velocity New York 2015

Kanban%Prac)ces• Visualize

• Limit-WIP

• Manage-flow

• Make-policies-explicit

• Implement-feedback-loops

✨ @beerops(@sigje(#effec/vedevops✨ 48

Page 49: Effective Devops - Velocity New York 2015

Visualize• Intent

• Alignment

• Coherence

✨ @beerops(@sigje(#effec/vedevops✨ 49

Page 50: Effective Devops - Velocity New York 2015

Limit%WIP• Pull%(don't%push)

✨ @beerops(@sigje(#effec/vedevops✨ 50

Page 51: Effective Devops - Velocity New York 2015

Manage&Flow• Monitor/measure/report

• Incremental2change

✨ @beerops(@sigje(#effec/vedevops✨ 51

Page 52: Effective Devops - Velocity New York 2015

Make%Policies%Explicit• Document*processes

• Group*signoff

✨ @beerops(@sigje(#effec/vedevops✨ 52

Page 53: Effective Devops - Velocity New York 2015

Implement(Feedback(Loops• Collabora(on

• Retrospec(ves

✨ @beerops(@sigje(#effec/vedevops✨ 53

Page 54: Effective Devops - Velocity New York 2015

Devops'Tools• Establish*local*development*environment

• Version*control

• Manual*7>*Automa:on*7>*Con:nuous

• Ar:facts

• Infrastructure

• Sandbox

✨ @beerops(@sigje(#effec/vedevops✨ 54

Page 55: Effective Devops - Velocity New York 2015

Local&Development&Environment&(LDE)• Consistent)set)of)tools)across)the)team

• Ability)to)quickly)onboard)new)engineers

✨ @beerops(@sigje(#effec/vedevops✨ 55

Page 56: Effective Devops - Velocity New York 2015

Provisioned*Node*,*LDE• AWS%instance%node

• Chef%DK

• Test%Kitchen

• Ruby

• ChefSpec,%ServerSpec

• Git

✨ @beerops(@sigje(#effec/vedevops✨ 56

Page 57: Effective Devops - Velocity New York 2015

Configura)on*Management• Process(of(iden-fying,(managing,(monitoring,(and(audi-ng(a(product(through(its(en-re(life(including(the(processes,(documenta-on,(people,(tools,(so8ware,(and(systems.

✨ @beerops(@sigje(#effec/vedevops✨ 57

Page 58: Effective Devops - Velocity New York 2015

Version(Control• Records)changes)to)files)or)sets)of)files)stored)within)the)system

• Enable)revisions

• Integrity)checking

• Collabora<on

✨ @beerops(@sigje(#effec/vedevops✨ 58

Page 59: Effective Devops - Velocity New York 2015

Ar#fact(Repository• Secure

• Trusted

• Stable

• Accessible

• Versioned

✨ @beerops(@sigje(#effec/vedevops✨ 59

Page 60: Effective Devops - Velocity New York 2015

Introduc)on*to*Lab*1Lab$1

User:&chefPassword:&chef

✨ @beerops(@sigje(#effec/vedevops✨ 60

Page 61: Effective Devops - Velocity New York 2015

Lab$1

Lab$1

Time:&15&minutes

✨ @beerops(@sigje(#effec/vedevops✨ 61

Page 62: Effective Devops - Velocity New York 2015

Introduc)on*to*Lab*2Lab$2

✨ @beerops(@sigje(#effec/vedevops✨ 62

Page 63: Effective Devops - Velocity New York 2015

Lab$2

Lab$2

Time:&15&minutes

✨ @beerops(@sigje(#effec/vedevops✨ 63

Page 64: Effective Devops - Velocity New York 2015

Welcome'Back• git%review%

✨ @beerops(@sigje(#effec/vedevops✨ 64

Page 65: Effective Devops - Velocity New York 2015

git$pull

git$pull$REMOTE

✨ @beerops(@sigje(#effec/vedevops✨ 65

Page 66: Effective Devops - Velocity New York 2015

git$push$remote$branch• transfer)commits)from)a)local)repo)to)a)remote)repo.

• counterpart)to)git)fetch

✨ @beerops(@sigje(#effec/vedevops✨ 66

Page 67: Effective Devops - Velocity New York 2015

Infrastructure• Aggregate(of(applica/ons,(configura/ons,(access(control,(data,(compute(nodes,(network,(storage,(processes,(and(people.

✨ @beerops(@sigje(#effec/vedevops✨ 67

Page 68: Effective Devops - Velocity New York 2015

Infrastructure+Automa/on• Systems(that(reduce(the(burden(on(people(to(manage(services(and(increase(the(quality,(accuracy(and(precision(of(a(service(to(the(consumers(of(a(service

✨ @beerops(@sigje(#effec/vedevops✨ 68

Page 69: Effective Devops - Velocity New York 2015

Infrastructure+Automa/on+Tools• Chef

• Puppet

• Ansible

• Salt

• CFEngine

✨ @beerops(@sigje(#effec/vedevops✨ 69

Page 70: Effective Devops - Velocity New York 2015

Introduc)on*to*Chef

✨ @beerops(@sigje(#effec/vedevops✨ 70

Page 71: Effective Devops - Velocity New York 2015

Resources• Ingredients+of+infrastructure

• Basic+building+blocks

✨ @beerops(@sigje(#effec/vedevops✨ 71

Page 72: Effective Devops - Velocity New York 2015

Resource(Declara,on

RESOURCETYPE "RESOURCE_NAME" do PARAMETER PARAMETER_VALUEend

✨ @beerops(@sigje(#effec/vedevops✨ 72

Page 73: Effective Devops - Velocity New York 2015

Example(Resource(Type(1(package

A"package"to"be"installed:

package "httpd" do action :installend

✨ @beerops(@sigje(#effec/vedevops✨ 73

Page 74: Effective Devops - Velocity New York 2015

Example(Resource(Type(1(service

A"service"that"should"be"started:

service "httpd" do supports :restart => :true action [:enable, :start]end

✨ @beerops(@sigje(#effec/vedevops✨ 74

Page 75: Effective Devops - Velocity New York 2015

Resources

A"resource"is"a"statement"of"policy"that:

• Describes)the)desired)state)for)an)element

• Specifies)a)resource)type888such)as)package,)template,)or)service

• Lists)addi;onal)details)(also)known)as)parameters),)as)necessary

• Are)grouped)into)recipes

✨ @beerops(@sigje(#effec/vedevops✨ 75

Page 76: Effective Devops - Velocity New York 2015

Recipes• Collec'on)of)ordered)resources

• Combina'on)of)ruby)and)Chef)DSL

✨ @beerops(@sigje(#effec/vedevops✨ 76

Page 77: Effective Devops - Velocity New York 2015

Cookbooks• Thema'c

• Collec'on-of-recipes-and-other-suppor'ng-files

✨ @beerops(@sigje(#effec/vedevops✨ 77

Page 78: Effective Devops - Velocity New York 2015

Roles• Abstrac)on,describing,func)on,of,system

• Name

• Descrip)on

• Run,list,(ordered,list,of,recipes,and,roles)

✨ @beerops(@sigje(#effec/vedevops✨ 78

Page 79: Effective Devops - Velocity New York 2015

Run$List• Ordered&list&of&recipes&and&roles

• Specific&to&a&node

✨ @beerops(@sigje(#effec/vedevops✨ 79

Page 80: Effective Devops - Velocity New York 2015

Nodes• Machine)(virtual,)physical,)cloud)server,)or)other)device))that)is)managed)by)Chef

✨ @beerops(@sigje(#effec/vedevops✨ 80

Page 81: Effective Devops - Velocity New York 2015

Environments• Abstrac)on,models,workflow

• Name

• Descrip)on

• Cookbook,version,pinning

✨ @beerops(@sigje(#effec/vedevops✨ 81

Page 82: Effective Devops - Velocity New York 2015

Supermarket• Community*site*with*a*number*of*cookbooks

• Read*before*using*in*your*environment

✨ @beerops(@sigje(#effec/vedevops✨ 82

Page 83: Effective Devops - Velocity New York 2015

Chef%DK• Chef&development&kit

• Includes&a&number&of&u8li8es&and&so9ware&to&facilitate&cookbook&crea8on

• Free&download&off&of&the&website

✨ @beerops(@sigje(#effec/vedevops✨ 83

Page 84: Effective Devops - Velocity New York 2015

Berkshelf• Dependency)management

• Included)with)Chef)DK

✨ @beerops(@sigje(#effec/vedevops✨ 84

Page 85: Effective Devops - Velocity New York 2015

Test%Kitchen• Included)with)Chef)DK

• Sandbox)automa8on

• Test)harness

✨ @beerops(@sigje(#effec/vedevops✨ 85

Page 86: Effective Devops - Velocity New York 2015

Test%Kitchen• Execute(code(on(one(or(more(pla1orms

• Driver(plugins(suppor7ng(various(cloud(and(virtualiza7on(providers

✨ @beerops(@sigje(#effec/vedevops✨ 86

Page 87: Effective Devops - Velocity New York 2015

.kitchen.yml• driver

• provisioner

• pla-orms

• suites

✨ @beerops(@sigje(#effec/vedevops✨ 87

Page 88: Effective Devops - Velocity New York 2015

.kitchen.yml,driver• virtualiza*on-or-cloud-provider

Example:)vagrant,)docker

✨ @beerops(@sigje(#effec/vedevops✨ 88

Page 89: Effective Devops - Velocity New York 2015

.kitchen.yml,provisioner• applica'on*to*configure*the*node

Example:)chef_zero

✨ @beerops(@sigje(#effec/vedevops✨ 89

Page 90: Effective Devops - Velocity New York 2015

.kitchen.yml,pla/orms• target'opera*ng'systems

Example:)centos/6.5

✨ @beerops(@sigje(#effec/vedevops✨ 90

Page 91: Effective Devops - Velocity New York 2015

.kitchen.yml,suites• target'configura-ons

Example:

name:default run_list: - recipe[apache::default] attributes:

✨ @beerops(@sigje(#effec/vedevops✨ 91

Page 92: Effective Devops - Velocity New York 2015

Kitchen(commands((1/2)• kitchen)init

• kitchen)list

• kitchen)create

• kitchen)converge

✨ @beerops(@sigje(#effec/vedevops✨ 92

Page 93: Effective Devops - Velocity New York 2015

Kitchen(commands((2/2)• kitchen)verify

• kitchen)destroy

• kitchen)test

✨ @beerops(@sigje(#effec/vedevops✨ 93

Page 94: Effective Devops - Velocity New York 2015

Docker• Images

• Registries

• Containers

✨ @beerops(@sigje(#effec/vedevops✨ 94

Page 95: Effective Devops - Velocity New York 2015

Introduc)on*to*Lab*3Lab$3

✨ @beerops(@sigje(#effec/vedevops✨ 95

Page 96: Effective Devops - Velocity New York 2015

Lab$3

Time:&30&minutes

✨ @beerops(@sigje(#effec/vedevops✨ 96

Page 97: Effective Devops - Velocity New York 2015

✨ @beerops(@sigje(#effec/vedevops✨ 97

Page 98: Effective Devops - Velocity New York 2015

Managing&Risk• Test

• Small*frequent*releases

✨ @beerops(@sigje(#effec/vedevops✨ 98

Page 99: Effective Devops - Velocity New York 2015

Lin$ng• Ensure(code(adheres(to(styles(and(conven2ons

• Weave(expecta2ons(into(development

• Encourages(collabora2on

✨ @beerops(@sigje(#effec/vedevops✨ 99

Page 100: Effective Devops - Velocity New York 2015

Tes$ng• Documen)ng+objec)ves+and+intent

• Measuring+"done"

✨ @beerops(@sigje(#effec/vedevops✨ 100

Page 101: Effective Devops - Velocity New York 2015

Code%Correctness• foodcri(c

• rubocop

✨ @beerops(@sigje(#effec/vedevops✨ 101

Page 102: Effective Devops - Velocity New York 2015

Integra(on*Tests• ServerSpec

✨ @beerops(@sigje(#effec/vedevops✨ 102

Page 103: Effective Devops - Velocity New York 2015

Rubocop• Ruby&linter

• Ruby&style&guide

• Included&with&ChefDK

✨ @beerops(@sigje(#effec/vedevops✨ 103

Page 104: Effective Devops - Velocity New York 2015

Rubocop'Example$ rubocop cookbooks/COOKBOOK1 cookbooks/COOKBOOK2 cookbooks/COOKBOOK4

✨ @beerops(@sigje(#effec/vedevops✨ 104

Page 105: Effective Devops - Velocity New York 2015

Reading(Rubocop(OutputInspecting 8 filesCWCWCCCC

• ."means"that"the"file"contains"no"issues

• C"means"a"issue"with"conven2on

• W"means"a"warning

• E"means"an"error

• F"means"an"fatal"error✨ @beerops(@sigje(#effec/vedevops✨ 105

Page 106: Effective Devops - Velocity New York 2015

Disabling)Rubocop)cops

Any$configura,on$in$.rubocop.yml$is$disabled.

To#disable#string#literals:

StringLiterals: Enabled: false

✨ @beerops(@sigje(#effec/vedevops✨ 106

Page 107: Effective Devops - Velocity New York 2015

Foodcri'c• Chef&linter

• Chef&style&guide

• Included&with&ChefDK

✨ @beerops(@sigje(#effec/vedevops✨ 107

Page 108: Effective Devops - Velocity New York 2015

Foodcri'c(Example

$ foodcritic cookbooks/setup

✨ @beerops(@sigje(#effec/vedevops✨ 108

Page 109: Effective Devops - Velocity New York 2015

Reading(Foodcri-c(OutputFC008: Generated cookbook metadata needs updating: ./metadata.rb:2

✨ @beerops(@sigje(#effec/vedevops✨ 109

Page 110: Effective Devops - Velocity New York 2015

ServerSpec• Tests&to&verify&servers&func0onality

• Resource&types

• Package,&service,&user,&and&many&others

• Integrates&with&Test&Kitchen

• h?p://serverspec.org

✨ @beerops(@sigje(#effec/vedevops✨ 110

Page 111: Effective Devops - Velocity New York 2015

ServerSpec'Generic'Form

describe "<subject>" do it "<description>" do expect(thing).to eq result endend

✨ @beerops(@sigje(#effec/vedevops✨ 111

Page 112: Effective Devops - Velocity New York 2015

ServerSpec'Poten,al'Tests• Is$the$service$running?

• Is$the$port$accessible?

• Is$the$expected$content$being$served?

✨ @beerops(@sigje(#effec/vedevops✨ 112

Page 113: Effective Devops - Velocity New York 2015

ServerSpec'Example

describe 'apache' do it "is installed" do expect(package 'httpd').to be_installed end it "is running" do expect(service 'httpd').to be_running endend

✨ @beerops(@sigje(#effec/vedevops✨ 113

Page 114: Effective Devops - Velocity New York 2015

Reading(ServerSpec(Outputapp::default httpd service is running

Finished in 0.26429 seconds (files took 0.7166 seconds to load)1 example, 0 failures

✨ @beerops(@sigje(#effec/vedevops✨ 114

Page 115: Effective Devops - Velocity New York 2015

✨ @beerops(@sigje(#effec/vedevops✨ 115

Page 116: Effective Devops - Velocity New York 2015

Introduc)on*to*Lab*4Lab$4

✨ @beerops(@sigje(#effec/vedevops✨ 116

Page 117: Effective Devops - Velocity New York 2015

Lab$4

Time:&30&minutes

✨ @beerops(@sigje(#effec/vedevops✨ 117

Page 118: Effective Devops - Velocity New York 2015

Introduc)on*to*Lab*5Lab$4

✨ @beerops(@sigje(#effec/vedevops✨ 118

Page 119: Effective Devops - Velocity New York 2015

Lab$5

Time:&20&minutes

✨ @beerops(@sigje(#effec/vedevops✨ 119

Page 120: Effective Devops - Velocity New York 2015

Test,&Monitor,&or&Diagnos/c2

1. Where'is'it'going'to'run?

2. When'is'it'going'to'run?

3. How'o4en'will'it'run?

4. Who'is'going'to'consume'the'result?

5. What'is'the'en;ty'going'to'do'with'it?

2"Lam,"Yvonne."'Sysadvent:"Day"5"6"How"To"Talk"About"Monitors,"Tests,"And"DiagnosCcs'."Sysadvent.blogspot.com."N.p.,"2014."Web."26"May"2015.

✨ @beerops(@sigje(#effec/vedevops✨ 120

Page 121: Effective Devops - Velocity New York 2015

Measuring*Impact*and*Value*of*Change

✨ @beerops(@sigje(#effec/vedevops✨ 121

Page 122: Effective Devops - Velocity New York 2015

Impact'of'Change

✨ @beerops(@sigje(#effec/vedevops✨ 122

Page 123: Effective Devops - Velocity New York 2015

Impact'on'Availability

• Overall(site/app(availability

• Individual(service(availability

✨ @beerops(@sigje(#effec/vedevops✨ 123

Page 124: Effective Devops - Velocity New York 2015

Availability)Monitoring

• Up$me:

• Pingdom,/Moni$s,/Uptrends,/etc

• Ver$cal/Line/Technology:

• Availability/a?er/deploys/changes

✨ @beerops(@sigje(#effec/vedevops✨ 124

Page 125: Effective Devops - Velocity New York 2015

✨ @beerops(@sigje(#effec/vedevops✨ 125

Page 126: Effective Devops - Velocity New York 2015

Even%nator

✨ @beerops(@sigje(#effec/vedevops✨ 126

Page 127: Effective Devops - Velocity New York 2015

✨ @beerops(@sigje(#effec/vedevops✨ 127

Page 128: Effective Devops - Velocity New York 2015

Service'Availability

• Nagios:)Service/level)monitoring)and)aler5ng

• Nagios/herald:)Alert)context

• OpsWeekly:)Historical)alert)data

✨ @beerops(@sigje(#effec/vedevops✨ 128

Page 129: Effective Devops - Velocity New York 2015

Nagios

✨ @beerops(@sigje(#effec/vedevops✨ 129

Page 130: Effective Devops - Velocity New York 2015

define command { command_name check_mongodb_query command_line $USER1$/nagios-plugin-mongodb/check_mongodb.py -H $HOSTADDRESS$ -A $ARG1$ -P $ARG2$ -W $ARG3$ -C $ARG4$ -q $ARG5$}

define service { use generic-service hostgroup_name Mongo Servers service_description Mongo Connect Check check_command check_mongodb!connect!27017!2!4}

✨ @beerops(@sigje(#effec/vedevops✨ 130

Page 131: Effective Devops - Velocity New York 2015

define servicedependency{ host_name WWW1 service_description Apache Web Server dependent_host_name WWW1 dependent_service_description Main Web Site execution_failure_criteria n notification_failure_criteria w,u,c}

✨ @beerops(@sigje(#effec/vedevops✨ 131

Page 132: Effective Devops - Velocity New York 2015

Nagios'herald

✨ @beerops(@sigje(#effec/vedevops✨ 132

Page 133: Effective Devops - Velocity New York 2015

✨ @beerops(@sigje(#effec/vedevops✨ 133

Page 134: Effective Devops - Velocity New York 2015

OpsWeekly

✨ @beerops(@sigje(#effec/vedevops✨ 134

Page 135: Effective Devops - Velocity New York 2015

✨ @beerops(@sigje(#effec/vedevops✨ 135

Page 136: Effective Devops - Velocity New York 2015

✨ @beerops(@sigje(#effec/vedevops✨ 136

Page 137: Effective Devops - Velocity New York 2015

✨ @beerops(@sigje(#effec/vedevops✨ 137

Page 138: Effective Devops - Velocity New York 2015

✨ @beerops(@sigje(#effec/vedevops✨ 138

Page 139: Effective Devops - Velocity New York 2015

Impact'on'Quality

• Service(quality((SLAs)

• Visibility(of(quality

✨ @beerops(@sigje(#effec/vedevops✨ 139

Page 140: Effective Devops - Velocity New York 2015

Statsd

✨ @beerops(@sigje(#effec/vedevops✨ 140

Page 141: Effective Devops - Velocity New York 2015

>>> import statsd>>>>>> timer = statsd.Timer('MyApplication')>>>>>> timer.start()>>> # do something here>>> timer.stop('SomeTimer')

✨ @beerops(@sigje(#effec/vedevops✨ 141

Page 142: Effective Devops - Velocity New York 2015

>>> import statsd>>>>>> counter = statsd.Counter('MyApplication')>>> # do something here>>> counter += 1

✨ @beerops(@sigje(#effec/vedevops✨ 142

Page 143: Effective Devops - Velocity New York 2015

>>> import statsd>>>>>> average = statsd.Average('MyApplication', connection)>>> # do something here>>> average.send('SomeName', 'somekey:%d'.format(value))

✨ @beerops(@sigje(#effec/vedevops✨ 143

Page 144: Effective Devops - Velocity New York 2015

Graphite

✨ @beerops(@sigje(#effec/vedevops✨ 144

Page 145: Effective Devops - Velocity New York 2015

Value&of&Change

✨ @beerops(@sigje(#effec/vedevops✨ 145

Page 146: Effective Devops - Velocity New York 2015

Value&of&Availability

• Be$er&for&customers

• Be$er&for&employees&(internal&services)

• Fewer&pages

✨ @beerops(@sigje(#effec/vedevops✨ 146

Page 147: Effective Devops - Velocity New York 2015

Value&of&Quality

• Deploys)take)less)-me

• Also)be1er)for)customers

• More)visibility)into)issues

✨ @beerops(@sigje(#effec/vedevops✨ 147

Page 148: Effective Devops - Velocity New York 2015

Retrospec)ve+!

✨ @beerops(@sigje(#effec/vedevops✨ 148

Page 149: Effective Devops - Velocity New York 2015

Review• Recognizing*your*Devops*Narra4ve

• Applica4on*Deployment*Planning

• Infrastructure*as*code

• Introducing*repeatable,*testable*change

• Measuring*impact*and*value*of*change

✨ @beerops(@sigje(#effec/vedevops✨ 149

Page 150: Effective Devops - Velocity New York 2015

Next%Steps• Manual,(Automa-on(to(Con-nuous("X"

• Be(the(storylistener(and(storyteller(in(your(org

• Effec-ve(Devops(available(in(Early(Release

✨ @beerops(@sigje(#effec/vedevops✨ 150

Page 151: Effective Devops - Velocity New York 2015

Thank&you!&❤@sigje

@beerops

✨ @beerops(@sigje(#effec/vedevops✨ 151

Page 152: Effective Devops - Velocity New York 2015

✨ @beerops(@sigje(#effec/vedevops✨ 152