puppetconf 2016: continuous delivery and devops with jenkins and puppet enterprise – carl caum,...

72
Continuous delivery & DevOps with Jenkins and Puppet Everything as Code Brian Dawson & Carl Caum

Upload: puppet

Post on 15-Apr-2017

274 views

Category:

Technology


0 download

TRANSCRIPT

Continuous delivery & DevOps with Jenkins and Puppet Everything as Code Brian Dawson & Carl Caum

Carl Caum Technical Marketing Manager Puppet

Brian Dawson DevOps Evangelist CloudBees

DevOps It’s about giving a shit

Sound familiar?

5

“Why won’t Ops just make this change? It’s small”

“Don’t the developers know anything about logging?”

“Why does it take so long for Ops to deploy this code?”

“Why can’t the developers build packages?”

“The devs don’t care that this code doesn’t scale.”

“Ops won’t let us use the latest Ruby for some reason.”

The cause

6

Dev Ops

Empathy rarely extends beyond our

line of sight.

The solution

8

Dev Ops DevOps

…. except not really though

Product Delivery Process

Problem Statement

Problem Prioritization

Design / Development Deployment Monitoring

Engineering

Ops Product management DevOps? DevOps?

DevOps?

Shared goals with transparency and

accountability build a shared sense of

purpose.

DevOps Why are we even talking about it?

High-performing organizations are decisively outperforming their lower-performing peers in terms of throughput.

Because they address security at every stage, high-performing teams spend less time fixing security issues.

Get your copy of the 2016 State of DevOps Report puppet.com/devops-report-2016

DevOps Great...err, but what is it?

17

The DevOps Trinity

17

Upstream Downstream

People & Culture

Process & Practices

Tools & Technology

Agile, Scrum, Kanban PMBOK, ITIL, etc

Point Tools, Grassroots, Rapid Change

Move Fast, Innovate Maintain Quality Stability, Uptime

Enterprise class, Stable, Repeatable, traceable

Define Plan Code Build Integrate Test Release Deploy Operate

Culture Automation Measurement Sharing

The Three Ways - Gene Kim

Systems Thinking Understand the performance of the entire system, not each

individual silo

20

Amplify Feedback Loops

Build quick, short, feedback into the process

21

Culture of Experimentation and Learning Enforce a culture of continuous experimentation, risk taking, and

learning.

22

Continuous Delivery Prove every change is deployable

24

The DevOps Trinity and the Chasms

24

Upstream Downstream

People & Culture

Process & Practices

Tools & Technology

Agile, Scrum, Kanban PMBOK, ITIL, Waterfall etc

Point Tools, Grassroots, Rapid Change

Move Fast, Innovate Maintain Quality Stability, Uptime

Enterprise class, Corp procurement, Stable

Define Plan Code Build Integrate Test Release Deploy Operate

25

The Foundation

25

Upstream Downstream

People & Culture

Process & Practices

Tools & Technology

Agile, Scrum, Kanban PMBOK, ITIL, Waterfall etc

Point Tools, Grassroots, Rapid Change

Move Fast, Innovate Maintain Quality Stability, Uptime

Enterprise class, Corp procurement, Stable

Define Plan Code Build Integrate Test Release Deploy Operate

https://www.perforce.com/pdf/continuous-delivery-report.pdf 26

27

continuous deployment

continuous delivery continuous integration

DevOps → Cultural focus on shared objectives Reliable

Repeatable Fast

agile

CD and DevOps in Context

27

28

Software changes continuously deployed to live production

continuous deployment

Software changes continuously delivered to stakeholders in any environment

continuous delivery continuous integration

Automated commit, build and testing of code in the development environment

Feedback

Rapid Changes

Dis

cipl

ine

agile

An incremental approach to identifying, prioritizing, and coordinating feature development

Development Production / Prod-like Live Production

Env.

St

age

Release Deploy Monitor

Upstream (left) Downstream (right) Define Plan Code Commit Build Non-Func Test Scan Integrate Int. Test Package Deploy Acct. Test Load Test

Change Mgt.

Production

CD and DevOps in Context

28

DevOps → Cultural focus on shared objectives

Continuous delivery doesn’t mean every change is deployed to production ASAP

But with every change it is release ready

(which includes depoyable!)

30

Automation is the Key

PhotocourtesyofSteveJurvetsonviaFlickr

Jenkins Continuous integration and delivery tool

32

Complex Delivery Pipelines

Delivery of App and Config

Robust and Highly Available

Results Report

SOURCE CODE

CONTROL SYSTEM

Code Commit

</> Development Production

Continuous Integration/Delivery

Commit Build Test Stage Deploy

P P P

Jenkins – #1 Automation Platform for CI àCD

33 33 © 2016 CloudBees, Inc. All Rights Reserved.

Code & Commit Build & Config Scan & Test Release Deploy

Over 1.2 Million Users 1200+ plugins cover every stage of delivery

Jenkins is the Hub of Continuous Delivery

Why?

It connects all the things

It’s extensible

Source: State of Jenkins Survey Sept. 2015

How Do We Know?

Source: 2016 Jenkins Community Survey

Mission Possible: Make CD Accessible to All

Cross functional

Accessible

Simplified

Visual

Maintainable

Pipeline-as-code

Declarative Pipeline

Blue Ocean

+

Infrastructure-as-code

The future of CD

41 41

Drive CD with Jenkins Pipeline

Development Production

Commit Build Stage Deploy

? ?

Pipelines Need: P  Branching P  Looping

P  Restarts P  Checkpoints P  Manual Input

Sonar Test

Selenium Test

Perf Test

Jenkins Pipeline

Pipeline as Code

Introduce “pipeline” as a first class in Jenkins

Codify stages into an explicit Jenkinsfile in your source repository

Resumability/durability of the pipeline state

Extend the DSL with your own steps

github.com/jenkinsci/pipeline-examples

43

Pipeline DSL

node('docker'){checkoutscm/*GrabtheabbreviatedSHA1ofourpipeline’scommit.*/sh'gitrev-parseHEAD>GIT_COMMIT'defshortCommit=readFile('GIT_COMMIT').take(6)stage'Build'defimage=docker.build("jenkinsciinfra/bind:build-${shortCommit}")stage'Deploy'image.push()}

44

Jenkins Pipeline Stage View

Restartable Checkpoints

Artifact Downloads

45

Declarative Pipeline Pipelines can now be defined with a simpler syntax.

46

Blue Ocean - Pipeline Creation

47

Blue Ocean - Pipeline Visualization

48

Tools & Technologies enable “crossing the chasm”

Normalized

✓  Language and practice agnostic

✓  Not Dev or Ops specific

✓  Distributed

Rich Integration Support

✓  Tools as microservices

✓  Modular

Automated

✓  Repeatability

✓  Reportability

✓  Flexibility

Confidence In Downstream Deliverables

✓  Support supply-chain

✓  Traceability

✓  Immutability

✓  Measure and report

Scale To Enterprise

✓  Cross-domain visibility metrics

✓  Security and governance

✓  Supported

49

Puppet Enterprise And Jenkins Promote & Deploy with Puppet

The toolchain … across all technologies.

Version control Infrastructure automation Continuous Integration Deployment

automation Monitoring

and others …

and others …

and others …

Where to start

Infrastructure as Code

Collaboration Iteration Fast Feedback Visibility

Infrastructure Automation

Version Control & Peer Review

Continuous Integration &

Delivery

Automated Testing

Deployment Automation

Infrastructure as code and continuous delivery pipelines push

quality to the left, getting ever closer to the keyboard.

Push quality left

●  Infrastructure code is portable ●  Infrastructure code is repeatable ●  Puppet is idempotent (same result

regardless of beginning state) ●  Puppet is declarative (less DevOoops)

Puppet Enterprise Orchestration

Example application App relies on multiple services that span infrastructure

Glass Fish F5 LB

App API

Kerberos

SSH

Log stash

WebSphere

App API

SSH

Log stash

F5 LB MS SQL

Database

HTTP

Example application Use Puppet language to model your application

WebSphere App API

SSH Log stash

F5 LB

MS SQL

●  Services

●  Relationships

●  Dependencies

●  Instances

–  Dev, Staging, Production, etc.

Example application Puppet Enterprise determines order and deploys your application.

Puppet Enterprise Code Management

Code management

●  Know exactly when your Puppet code deployments are complete

●  Control who can deploy code into what areas with built-in integration to Role-Based Access Control

Deploy code confidently with a new command line interface and API

Jenkinsfile Everything as code

Demo

So what? Use cases

Infrastructure Pipeline https://github.com/puppetlabs/jenkins-pipeline-puppet-enterprise-plugin/blob/master/examples/Jenkinsfile-infrastructure_pipeline

Application Deployments https://github.com/puppetlabs/jenkins-pipeline-puppet-enterprise-plugin/blob/master/examples/Jenkinsfile-application_service_pipeline

Canary Deployments https://github.com/puppetlabs/jenkins-pipeline-puppet-enterprise-plugin/blob/master/examples/Jenkinsfile-canary_deployments

Phased Deployments https://github.com/puppetlabs/jenkins-pipeline-puppet-enterprise-plugin/blob/master/examples/Jenkinsfile-canary_deployments

Jenkins Update Center Available today

Tier 2 CloudBees Certified In the next few weeks

Questions https://puppet.com/Jenkins

https://go.cloudbees.com