infrastructure - goto conference · automation rocks, but ... server sprawl. configuration drift...

49

Upload: others

Post on 30-May-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE
Page 2: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

INFRASTRUCTURE

AS CODE

Page 3: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

[email protected]

Cloud Practice Lead (UK)

DevOps, Continuous Delivery, Agile Ops

Twitter: @kiefBook: http://oreil.ly/1JKIBVeSite: http://infrastructure-as-code.com

November 2016

Page 4: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

HOW LONG?Provision a new server?

Rebuild a public-facing environment?

Change a configuration setting?

Roll out patches across all servers?

Page 5: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

CLOUD

Page 6: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

SPEED

Page 7: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

RISK

Page 8: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

COWBOYS

BUREAUCRATSor

Page 9: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

FASTER IS SAFERhttp://bit.ly/2cQQSOk

 

Page 10: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

RAPID

RESPONSIBLE

Page 11: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

CHALLENGESAutomation rocks, but ...

Page 12: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

SERVER SPRAWL

Page 13: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

CONFIGURATION DRIFT

Servers start out identical

But changes accumulate over time

Page 14: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

AUTOMATION FEAR CYCLE

Page 15: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

INFRASTRUCTURE

AS CODEApplying tools and practices from software engineering to infrastructure management.

Page 16: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

PRINCIPLESAll your stuff can be rebuilt

All your things are disposable

Everything is consistent

There is no end state

Page 17: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

PRACTICES

Page 18: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

DEFINE SYSTEMS AS CODE

System design is:▪ Reusable▪ Consistent▪ Visible▪ Versioned

Page 19: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

AUTOMATICALLY TEST CHANGES

Page 20: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

PROMOTE CHANGES

TEST

PREPROD

PROD

QA

Page 21: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

DELIVER SMALL CHANGES FREQUENTLY

v001

v002

v003

v004

Page 22: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

DESIGN TO ENABLE CHANGE

Page 23: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

CONTINUOUSLY SYNCHRONIZE

Page 24: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

OR CONTINUOUSLY REBUILD

Page 25: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

FOUNDATIONSPlatforms and tools

Page 26: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

subnet "app_server_subnet" cidr_block: 10.0.1.0/24

firewall_rule "app_server_port" allow: port: 8080 protocol: http cidr_blocks: [0.0.0.0/0]

disk_volume "app_server_data" size: 40

server_instance "app_server" image: app-server-template instance_type: medium disks: app_server_data subnet: app_server_subnet firewall_rules: app_server_port chef_role: app_server

INFRASTRUCTURE RESOURCES

Page 27: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

DYNAMIC INFRASTRUCTURE PLATFORMS

Cloud

Virtual

Physical

Page 28: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

PROGRAMMABLE

Page 29: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

BASIC PIPELINETesting and promoting definitions

Page 30: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

BASIC PIPELINE

BUILD STAGE

TEST STAGE QA STAGE PROD

STAGE

Application Server Environment StackDeploy application, configuration, and infrastructure

Page 31: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

LIBRARY PIPELINEExample: Shared server images

Page 32: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

SERVER IMAGE PIPELINETested server

imagesBUILD TEST

BUILD TEST PROD

BUILD TEST PROD

Server image pipeline

Application pipelines

Page 33: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

SHARED INFRASTRUCTUREExample: Global infrastructure stack

Page 34: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

GLOBAL STACKVPC

SubnetA SubnetB

LB Security Group

Service Security Group

Globalstack definition

Page 35: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

SERVICE STACKS

ServiceA ServiceB ServiceC

ServiceAstack definition

ServiceBstack definition

ServiceCstack definition

Page 36: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

MULTIPLE PIPELINESGlobal stack pipeline

TESTCHECK

Service stack pipelines

TESTBUILD

PROD

QA PROD

TESTBUILD QA PROD

TESTBUILD QA PROD

Page 37: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

GLOBAL STACK PIPELINE

TESTCHECK PROD

Test the global stack on its own

Apply changes to the global stack in

production

Page 38: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

SERVICE STACK PIPELINE

TESTCHECK PROD

TESTBUILD QA PROD

Global infrastructure stack

Service stack pipeline

Page 39: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

DESIGN PATTERNSAvoiding monolithic infrastructure

Page 40: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

EXAM

PLE

INFR

ASTR

UCT

URE

Catalog DB User DB

Viewer Service Editor Service

Catalog Service User Service Vendor Service

ELB

Monitoring Service

ELBSecurity Group

Page 41: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

Catalog DB User DB

Viewer Service Editor Service

Catalog Service User Service Vendor Service

ELB

Monitoring Service

MO

NO

LITH

ICST

ACK

ELBSecurity Group

Page 42: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

MO

DU

LAR

INFR

ASTR

UCT

URE

ELB Definition Module

Modularity is helpful for sharing and reusing code

Page 43: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

MO

DU

LAR

INFR

ASTR

UCT

URE

Shared ELB Definition Module

Modularity can actually make change more risky

Multiple stacks import the module

Page 44: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

HO

RIZO

NTA

L ST

ACKS

Page 45: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

HO

RIZO

NTA

L ST

ACKSThe scope of a valuable change typically crosses layers

Page 46: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

MIC

RO-S

ERVI

CE

STAC

KSInfrastructure Stack for the Viewer Service● Load Balancer VIP● Firewall Rule● Web Server Vhost● App Server Cluster

Infrastructure Stack for the User Service● Load Balancer VIP● Firewall Rules● App Server Cluster● Database Instance

Page 47: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

Design systems so that changes can be made rapidly, frequently, and reliably

Page 48: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE

Book: http://oreil.ly/1JKIBVeSite: http://infrastructure-as-code.comTwitter: @kief

[email protected]

Cloud Practice Lead (UK)

DevOps, Continuous Delivery, Agile Ops

Page 49: INFRASTRUCTURE - GOTO Conference · Automation rocks, but ... SERVER SPRAWL. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time. AUTOMATION FEAR CYCLE