47
FERNANDO HONIG DevOps & Automation Autoscaling +Chef +New Relic

Autoscaling, Chef and New Relic

Embed Size (px)

DESCRIPTION

Scaling up and down using rackspace cloud. How to use Heat Templates, and do blue green deployments with autoscaling and jenkins.

Citation preview

Page 1: Autoscaling, Chef and New Relic

FERNANDO

HONIG

DevOps & Automation

Autoscaling

+Chef +New Relic

Page 2: Autoscaling, Chef and New Relic

ABOUT

ME

More than 10 years of experience

Worked at Intel, IBM, HP

@fernandohonig

[email protected]

http://github.com/fernandohonig

FERNANDO

HONIG

Senior Automation Engineer

Page 3: Autoscaling, Chef and New Relic

RACKSPACE & DevOps Automation

CONFIGURATION

MANAGEMENT

APPLICATION

SCALE

APPLICATION

INSIGHT

YOU CODE

THE APP

WE’LL DO

THE REST

Page 4: Autoscaling, Chef and New Relic

PROBLEMS

Why to Autoscale?

How/When to Autoscale?

AUTOSCALING SCENARIOS

SELF-HEALING

New Relic Webhooks

Application Stressing

Load Balancer and Autoscaling

HEAT ORCHESTRATION

Full Deployment Stack

Horizontal Scale Up

BLUE/GREEN DEPLOYMENTS

Jenkins + Chef + Autoscale

Autoscaling+Chef +New Relic

Page 5: Autoscaling, Chef and New Relic

AUTOSCALING: What?

The act of changing the

pool of resources

able to serve requests

without manual intervention

Page 6: Autoscaling, Chef and New Relic

PROBLEMS: Why?

Page 7: Autoscaling, Chef and New Relic

PROBLEMS: Why?

Page 8: Autoscaling, Chef and New Relic

AUTOSCALING: Strategy

SEVERITY OF SPIKE:

Is this a Reddit spike or a casual increase?

TIME TO PROVISION:

Benchmark and test the time it takes to create new infrastructure.

EARLY WARNING:

What is the earliest observed anomaly in a monitoring system that predicts

this spike?

PER NODE CAPACITY:

Load test individual nodes and your baseline platform to better understand

how much natural elasticity is in your platform.

Page 9: Autoscaling, Chef and New Relic

PROBLEMS: How? When?

SCALE UP

Page 10: Autoscaling, Chef and New Relic

PROBLEMS: How? When?

SCALE

DOWN

NEW RELIC

Page 11: Autoscaling, Chef and New Relic

PROBLEMS: Scaling down?

SCALING DOWN,

SESSIONS, NEW

ARCHITECTURE

LOADBALANCER

WEBSITE

WWW

LOADBALANCER

WEBSITE

WWW

Page 12: Autoscaling, Chef and New Relic

AUTOSCALING: Early warning!

Page 13: Autoscaling, Chef and New Relic

Monitor applications performance using NewRelic

Use NewRelic APDEX score to monitor application

performance

Scale up on demand based on NewRelic stats

(Self heal)

When threshold breached fire alert to webhook

Auto register node with application in NewRelic

Scale down when compute no longer needed

AUTOSCALING:

EARLY

WARNING!

Page 14: Autoscaling, Chef and New Relic

TOOLS!

CONFIG MGMT CODE MGMT MONITORING

Page 15: Autoscaling, Chef and New Relic

LOADBALANCER

WEBSITE - SERVERS

VISITORS

WEBSITE STARTS HAVING MORE LOAD

STEP 1: START

WEBSITE

WWW

NEW RELIC

Page 16: Autoscaling, Chef and New Relic

NEW RELIC APP MONITORING TRIGGERS

A WEBHOOK FIRING AN AUTOSCALE EVENT

STEP 2: ALERT

WWW

NEW RELIC AUTO SCALE SERVICE LOADBALANCER

WEBSITE - SERVERS

Page 17: Autoscaling, Chef and New Relic

AUTOSCALING GROUP LAUNCHES MORE

COMPUTE CAPACITY

STEP 3: SCALE UP

WEBSITE+

SERVERS BUILDING

WEBSITE – SERVERS ACTIVE

WWW

NEW RELIC AUTO SCALE SERVICE LOADBALANCER

Page 18: Autoscaling, Chef and New Relic

STEP 4: CONFIGURE

CHEF AUTOMATICALLY CONFIGURES

THE NEW SERVERS

WEBSITE - SERVERSWEBSITE - SERVERS

chefLOADBALANCER

WEBSITE

WWW

Page 19: Autoscaling, Chef and New Relic

STEP 5: COMPLETE

THE NEW SERVERS ARE FULLY

DEPLOYED & IN PRODUCTION

NEW RELIC MONITORS THE

WEBSITE & PROVIDES

CUSTOMER WITH

PRO-ACTIVE INSIGHT

CUSTOMER NEW RELIC

WEBSITE - SERVERS

LOADBALANCER

WEBSITE

WWW

Page 20: Autoscaling, Chef and New Relic

SERVERS REMOVED

STEP 6: DOWN

WHEN APPLICATION RECOVERED

OLD SERVERS ARE BEING REMOVED

WEBSITE – SERVERS ACTIVE

LOADBALANCER

WEBSITE

WWW

Page 21: Autoscaling, Chef and New Relic

DEMO

Page 22: Autoscaling, Chef and New Relic

AUTOSCALING: Heat Orchestration

Page 23: Autoscaling, Chef and New Relic

Declare the infrastructure in one simple text file (YAML)

Create, update, connect and manage groups of cloud resources and their software components as a single unit (stack)

Automated, repeatable

HEAT

ORCHESTRATION

Page 24: Autoscaling, Chef and New Relic

PROBLEM: Environments

DEV = UAT = PRD:

Do we have the same architecture across all environments?

TROUBLESHOOTING:

Is the problem related to the infrastructure or code?

QUICK ENVIRONMENT TEST:

If we need an environment just for a few hours, or for a specific purpose?

Page 25: Autoscaling, Chef and New Relic

TOOLS!

CONFIG MGMT CODE MGMT MONITORING

Page 26: Autoscaling, Chef and New Relic

heat_template_version: 2013-05-23

description:

# a description of the template

parameters:

# declaration of input parameters

resources:

# declaration of template resources

outputs:

# declaration of output parameters

HEAT

ORCHESTRATION

Page 27: Autoscaling, Chef and New Relic

HEAT ORCHESTRATION: Code!

http://goo.gl/xApJg1

Page 28: Autoscaling, Chef and New Relic

LOADBALANCER

STEP 1: DEPLOY

THE TEMPLATE CONTAINS THE

AUTOSCALING GROUP, THE LB,

THE POLICIES AND WEBHOOKS

TEMPLATE CONTAINS ALL THE

CHEF INFORMATION TO

BOOTSTRAP THE NODE

WITHIN THE RIGHT

ENVIRONMENT AND ROLE.

CUSTOMER

STACK

ELK

Page 29: Autoscaling, Chef and New Relic

LOADBALANCER

TEMPLATE CONTAINS ALL THE

CHEF INFORMATION TO

BOOTSTRAP THE NODE

WITHIN THE RIGHT

ENVIRONMENT AND ROLE.

CUSTOMER

STACK

ELKSTEP 2: SCALE

THE TEMPLATE CONTAINS THE

AUTOSCALING GROUP, THE LB,

THE POLICIES, AND WEBHOOKS

AUTO SCALE SERVICE

Page 30: Autoscaling, Chef and New Relic

STEP 3: CONFIGURE

THE STACK WILL BE CONFIGURED

AND ADDED TO THE LB BASED ON

CHEF AUTOMATION

chef LOADBALANCER

TEMPLATE CONTAINS ALL THE

CHEF INFORMATION TO

BOOTSTRAP THE NODE

WITHIN THE RIGHT

ENVIRONMENT AND ROLE.

STACK

ELK

Page 31: Autoscaling, Chef and New Relic

DEMO

Page 32: Autoscaling, Chef and New Relic

AUTOSCALING: B/G Deployment

Page 33: Autoscaling, Chef and New Relic

PROBLEM: Deployments

TIME TO MARKET:

Why spend 8hs for doing a deployment? Can’t I just code my app?

AUTOMATION:

I am human, I forgot to execute this step, rollback is needed.

BRAND NEW ENVIRONMENT:

What if my old component is not compatible with the new one?

Page 34: Autoscaling, Chef and New Relic
Page 35: Autoscaling, Chef and New Relic

Increase efficiency in the application release cycle

Allow the customer to focus on their core business

Fully automated one click deployment

Faster delivery of code to production

Easy roll back and in timely manner

BLUE-

GREEN

DEPLOYMENTS

Page 36: Autoscaling, Chef and New Relic

TOOLS!

CONFIG MGMT CODE MGMT WORKFLOW

Page 37: Autoscaling, Chef and New Relic

LOADBALANCER

CUSTOMER

CUSTOMER DEVELOPS NEW VERSION

OF THEIR WEBSITE (WEBSITE 2.0)

STEP 1: DESIGN

WEBSITE 1.0

WWW

WEBSITE1.0 - SERVERS

Page 38: Autoscaling, Chef and New Relic

STEP 2: DEPLOY

JENKINS

CUSTOMER DEPLOYS NEW VERSION

OF THEIR WEBSITE (WEBSITE 2.0)

NO FURTHER INTERACTION REQUIRED

FULLY AUTOMATED FROM HERE ON OUT

LOADBALANCER

CUSTOMER

WEBSITE 1.0

WWW

WEBSITE1.0 - SERVERS

Page 39: Autoscaling, Chef and New Relic

STEP 3: SCALE UP

JENKINS

AUTO SCALE SPINS UP NEW SERVERS

WEBSITE 1.0 - SERVERS

AUTO SCALE SERVICE

WEBSITE 2.0 - SERVERS

LOADBALANCER

WEBSITE 1.0

WWW

Page 40: Autoscaling, Chef and New Relic

STEP 4: CONFIGURE

CHEF AUTOMATICALLY CONFIGURES

THE NEW SERVERS

WEBSITE 1.0 - SERVERSWEBSITE 2.0 - SERVERS

chefLOADBALANCER

WEBSITE 1.0

WWW

Page 41: Autoscaling, Chef and New Relic

STEP 5: SCALE DOWN

JENKINS

JENKINS INITITIATES THE AUTOMATIC

SPIN DOWN OF THE OLD SERVERS

WEBSITE 2.0 - SERVERS

AUTO SCALE SERVICE

WEBSITE 1.0 SERVERS

LOADBALANCER

WEBSITE 1.0

WWW

Page 42: Autoscaling, Chef and New Relic

WEBSITE 2.0 - SERVERS

STEP 6: PRODUCTION

THE NEW WEBSITE IS FULLY

DEPLOYED & IN PRODUCTION

NEW RELIC MONITORS THE WEBSITE

& PROVIDES CUSTOMER WITH

PRO-ACTIVE INSIGHT

CUSTOMER NEW RELIC

LOADBALANCER

WEBSITE 2.0

WWW

Page 43: Autoscaling, Chef and New Relic

DEMO

Page 44: Autoscaling, Chef and New Relic

SUMMARY

Autoscaling and Strategies behind

Application Architecture and scaling

Deployment enhancement using AS

Page 45: Autoscaling, Chef and New Relic

Q&A

Page 46: Autoscaling, Chef and New Relic

WHAT’S

NEXT?

www.rackspace.co.uk/devops

Page 47: Autoscaling, Chef and New Relic

THANK YOU

RACKSPACE® | 1 FANATICAL PLACE, CITY OF WINDCREST | SAN ANTONIO, TX 78218

US SALES: 1-800-961-2888 | US SUPPORT: 1-800-961-4454 | WWW.RACKSPACE.COM

© RACKSPACE LTD. | RACKSPACE® AND FANATICAL SUPPORT® ARE SERVICE MARKS OF RACKSPACE US, INC. REGISTERED IN THE UNITED S TATES AND OTHER COUNTRIES. | WWW.RACKSPACE.COM

RACKSPACE® | 5 MILLINGTON ROAD | HAYES, UNITED KINGDOM UB3 4AZ

UK SALES: +44 (0)20 8712 6507 | UK SUPPORT: 0800 988 0300 | WWW.RACKSPACE.CO.UK

www.rackspace.co.uk/devops