Just kill it

Post on 23-Feb-2017

65 views 0 download

Transcript of Just kill it

JUST KILL IT@jamesrcounts | @paulwhitmer

JIM COUNTSLegacy Code Expert

Full Stack Consultant

C#/VB/Perl/AngularJS/Node/Cloud

PAUL WHITMERFull Stack ASP.NET MVC

C#/AngularJS/NodeJS/Cloud

Linux/Windows

DevOps TIG Mentor

WHY CARE?

The goal is to deliver new features and not worry about the servers. Increasing value to our customers.

OUR EXPERIENCEA little historyGo back to basics, when high level tools fail to deliver

How do we do it now?BuildDeployRemove human interaction

BUILDAutomatic: continuous integration on check-insCheck-in frequently to get feedback more oftenCreate fast builds to tighten up the feedback cycleReveal any hidden assumptions about your build

BUILD: GOCD POLLS GIT REPOSITORY FOR CHANGES

BUILD: BUILD FAST

BUILD: CHECK-INS OFTEN

EXAMPLE WEBSERVERDeveloper makes changes and checks inBuild server detects changes and agent in cloud runs tests and builds software

Final product is zipped up and stored on cloud file serverBuild server generates a custom boot script from a template and launches a new instance to kick off the deploy

LAUNCH SCRIPT

Where to find the codeFirewall configurationSecurity RolesNetwork/VPN configuration

Remote access keys

So many details… automate them!

DEPLOY QUICKLYLoad baseline instance with custom boot script

Pull and run pre-built code from online file storage

Connect to load balancer

BOOT SCRIPT

Download my app, unzip, and run app

Add thy self to load balancer and wait to become healthy

Tell load balancer to remove other instances with a different version

Tag thy selfWait ten minutes then start "Death Cron”

It’s another script!A generic script that the boot

script invokes with parameters.

REMOVE HUMAN INTERACTIONNo human needs to kickoff a build/deploymentScripts are built from template for each environment

Environment itself has been mostly built from script as well

Self cleaning instance destruction

CRON JOB

Runs every minuteAm I attached to the load balancer?

No?“Amazon, please kill me”

Yes!“The world loves me, keep going and check it again in a minute”

aka "Death Cron"

BACK TO BASICSHigh level tools promise magic, but can deliver their own set of problemsBeanstalkCloudformerDocker

When a tool doesn’t deliver, kill itRevisit the tool with a better understanding of underlying mechanics.

QUESTIONS?