Saltconf16 william-cannon b

28
Auto-Scaling and On-Demand Deployment William Cannon

Transcript of Saltconf16 william-cannon b

Auto-Scaling andOn-Demand DeploymentWilliam Cannon

About Me:

• Co-Founder of hospitalityPulse• SaltStack user for about 4 years• SaltStack Certified Engineer #23• Co-host of SaltStack meetup Minneapolis

Agenda for this talkTechnical history of our infrastructure

On-Demand deployments

Auto-Scaling deployments

BackgroundWe’re “all in” on AWS

This means medium to heavy use of the following:EC2, S3, ELB, DynamoDB, VPC, SQS, SNS, Route53, CloudFormation

Most solutions we create use AWS and SaltStack together

How did it start?A simple request for a little help from friends

Deploying using scp / rsync stinks. Can you help?

Yes….with two requirements.

Better deployments…

./deployer.py appname env

Next – separate stage and prod

How do we know if a deployment worked? The “Checker”

Each app supports a path of /checker

The return json response looks something like:

{ "global": "pass", "responder": "ip-10-0-2-152", "dns-name": "stage-ws.hospitalitypulse.net", "db_ws": true, "db_in": true, "db_fc": true, "date": "2016-04-15 20:06:13", "directory": "\/var\/www\/hp_ws\/2016-04-14-21-54-42", "egg_id": "0" }

A custom salt module reads the returned json for each server where software is deployed

Deployment Example

Stage and

Production* Static monitoring

Let’s make it great – all Highly Available (HA)How hard can it be?

Kind of like making a unicorn

Project Phoenix• At least two of everything, or 1 thing that could

automatically replace itself and tolerate minimal downtime

• Automate salt key management• Automate salt high states• Distributed file system (gluster)• Servers “replace” themselves and resume

operations• Automate monitoring of servers and services• Enable scaling: introduction of “eggs”

Project Phoenix

Automated Key Solution

So, everything replaces itself…

except custom applications

How hard can it be to add auto-scaling deployments?Do we have to abandon the on-demand deployments?

What has to change?

Can we get the best of both worlds?

How will auto scaling work?• Update deployment module to support S3 and dynamodb• Create a salt state• Tie it to high state• Determine what apps should be installed based on grains• Look up info for custom apps in dynamodb (what, from where)• Record deployment results into dynamodb• Make use of pillars for info on how / where to deploy on

servers

Auto-Scaling Diagram

What has to change in on-demand deployment?

• Populate what should be deployed• Record results of deployment• Push build artifact into long term storage• Put all deployment info into a nice pillar

Diagram of On Demand deployment

SummaryWe have an HA environment

Components run in multiple availability zones, and replace themselves

Custom applications deploy on-demand or via highstate / state runs

Question and Answer Time• The floor is yours for questions

Please Provide Feedback• Use the SaltConf16 event app to

provide feedback for this presentation.