SlideShare a Scribd company logo
1 of 47
Download to read offline
Docker at SpareFoot
Lessons From a Journey to Production
DevOps Days Austin
May 3, 2016
Who am I?
Steve Woodruff
❏ Director of DevOps at SpareFoot
implementing CI/CD
❏ Spent 10+ years at Motorola doing
embedded development (C, C++)
❏ Spent 5 years at IBM as a sys admin in a
large server farm (Linux, AIX, Solaris)
swoodruff@sparefoot.com
Twitter: @sjwoodr
GitHub: sjwoodr
● Think Hotels.com for self storage*
● All infrastructure in AWS
● 40 Developers on 7 Teams
○ Continuous Delivery
● Docker in production since 2014
*This kind of storage:
The Beginning: SpareFoot + Docker
Hackathon! Docker + Fig
(now compose) allowed us to
run production architecture
locally.
Yim - Call Center Application
Used exclusively by our
call center
Chrome ONLY
Node version n+1
React + Flux
Vers. n
+1
Vers. n
+1
Vers. n
Yim - Call Center Application
Used exclusively by our
call center
Chrome ONLY
Node version n+1
React + Flux
Vers. n
+1
Vers. n
+1
Vers. n
CI and deployments
Janky shell scripts… slow builds, etc…
Used Bamboo to build images
feature branches were built/deployed to Dev
master branch was built/deployed to Staging
Dynamically created custom container start script
Tried to auto-detect when the containers started to begin post-deploy test
Build times were rather long
Spent an awful long time doing docker push (to our registry) and docker pull (on the target hosts)
Ok, so Docker feels like the a solution
… and we kind of know how to do this. But....
Continuous Integration / Delivery?
○ Docker Registry
○ Bamboo
○ Deployments
● Host Volumes and Port Forwarding rules?
○ Not saved with the source code
● Get Docker to run in local, dev, staging, and production environments?
○ Configuration?
Docker in Production (technically)!
We had 2 load balanced
EC2 instances running a
node app.
ELB
443
3000 3000
Docker in Production (technically)!
We had 2 load balanced
EC2 instances running a
node app.
Now we have 2 load
balanced EC2 instances
running docker containers
that run a node app!
ELB
443
3000 3000
ELB
App 1 App 1
3000 3000
443
Docker in Production (technically)!
ELB ELB
App 1 App 1
We had 2 load balanced
EC2 instances running a
node app.
Now we have 2 load
balanced EC2 instances
running docker containers
that run a node app!
NEW443
3000 3000 3000 3000
443
Yim: Trouble in Docker Paradise
Hosting our own Docker registry was a bad idea
Stability was a problem
No level of access control on the registry itself
Mimicking servers - 1 container per host. Need orchestration please!
Amazon Linux AMI -> old version of Docker… doh!
Docker push/pull to/from registry was very slow
build - push to registry
deploy - pull from registry to each host, serially
Performance was fine….
But stability was the issue
This internal-facing nodejs app was moved to a pair of EC2 instances and out of Docker after about 4
months of pain and suffering
Yim: Lessons Learned
We need orchestration
Rolling our own docker deployments was confusing to OPS and to the Dev team
Our own docker registry is a bad idea
Stability was a problem
No level of access control on the registry itself
Our S3 backend would grow by several GB per month with no automated
cleanup
No easy way to rollback failed deploys
Just fix it and deploy again...
All this culminated in a poor build process and affected CI velocity
Longer builds, longer deploys, no real gain
Like everyone else....
...we were “deconstructing the monolith”
Application
Monolithic Library
Data
Like everyone else....
...we were “deconstructing the monolith”
Application
REST API
Data
Microservice
REST API
Data
Microservice
REST API
Data
Microservice
REST API
Data
Microservice
API Gateway
A Better Docker Registry
With Yim we learned that rolling our own Registry was a bad idea.
Limited Access Control
We have to maintain it
Let’s try Quay...
Has Access Control
Robots, yusss!
We don’t have to maintain it
We’ve learned some things...
● Easier than we thought
● Quay was the glue we needed
○ Use an off the shelf solution.
○ We like Quay.io
● Bolting on to our existing CI pipeline worked really well.
○ Developers didn’t have to learn new process
○ Microservice consumers can pull tagged versions
○ We can automate tests against all versions
Now we talk containers from local -> dev -> staging but NOT
in production.
MASTE
R
BRANCH A
Dev Staging
Service1
service1:prod
Production
Service1
service1:stage
Service1
service1:dev-branch-name
Production - What is still needed
Orchestration
Yim sucked because we tried to do this ourselves
Better Deployments
With rollbacks
Configuration Management
We have things to hide
Production - Orchestration
Production - Orchestration
Production - Software Selection
Choosing orchestration software / container service in early 2015
StackEngine
Lacked docker-compose support
Kubernetes
PhD Required
Mesosphere
Nice, but slow to deploy
EC2 Container Service
Lacked docker-compose support and custom AMIs
Tutum (now Docker Cloud)
Rancher
Production - Enter Rancher
After running proof-of-concepts of both Tutum and Rancher, we decided to continue down our
path to production deploys with Rancher.
Had more mature support for docker-compose files.
Tutum added this after our evaluation had ended
Did not require us to orchestrate the deployments through their remote endpoint
Rancher server runs on our EC2 instances and we are in full control of all the things
Had a full API we can work with in addition to the custom rancher-compose cli
Had a very-active user community and a beta-forum where the Rancher development team
was active in answering questions and even troubleshooting configuration problems.
Overlaying Docker on AWS
ELB
EC2
Containers
Overlaying Docker on AWS
Why the extra HAProxy layer?
Allows us to create the ELB and leave them alone
When we deploy new versioned services we update the service alias / haproxy links
Allows for fast rollback to previous version of the service
Deployments and Rollbacks
Developers can deploy to production whenever they want
HipChat bot commands to deploy and rollback/revert
Deployments to each of the 3 environments use rancher-compose to
Deploy new versioned services / containers
Create or update service aliases / haproxy links
Delete previous versioned services except for current and previous
When things go haywire…
We simply rollback
Production deploy creates a docker-compose-rollback.yml file
Query Rancher API to get list of running services
Allows us to change haproxy and service alias links back to the previous version
Super fast to rollback, no containers need to be spun up!
Overlaying Docker on AWS
ELB
EC2
Containers
Overlaying Docker on AWS
ELB
EC2
Containers
Overlaying Docker on AWS
ELB
EC2
Containers
Overlaying Docker on AWS
ELB
EC2
Containers
Rollback!
Secret Management
We’re already using SaltStack to manage our EC2 minions (VMs)
Salt Grains are used for some common variables used in salt states
Salt Pillar Data exists which is configuration data available only to certain
minions
This Salt Pillar Data is already broken down by environment (dev/stage/prod)
We should just use this data to dynamically create the docker-compose and
rancher-compose files!
Technical Challenge - docker-compose
We needed to support a single docker-compose.yml file, maintained by
developers of an app or service
They don’t want to maintain local, dev, stage, and prod versions of this file
Changes to multiple files would be error-prone
Must support differences in the architecture or configuration of services across environments
Secret Secret, I’ve got a Secret
A templated rancher-compose file
{% set sf_env = grains['bookingservice-env'] %}
{% set version = grains['bookingservice-version'] %}
bookingservice-{{ sf_env }}-{{ version }}:
scale: 1
We use a scale of 1 because we use global host scheduling combined with host affinity so that one
container of this service is deployed to each VM of the specified environment (dev/stage/prod). This
allows us to spin up a new Rancher host and easily deploy to the new host VM.
A templated docker-compose file
A Closer Look
MYSQL_SPAREFOOT_HOST: {{ salt['pillar.get']('bookingservice-dev:MYSQL_SPAREFOOT_HOST') }}
MYSQL_SPAREFOOT_DB: {{ salt['pillar.get']('bookingservice-dev:MYSQL_SPAREFOOT_DB') }}
MYSQL_SPAREFOOT_USER: {{ salt['pillar.get']('bookingservice-dev:MYSQL_SPAREFOOT_USER') }}
MYSQL_SPAREFOOT_PASS: {{ salt['pillar.get']('bookingservice-dev:MYSQL_SPAREFOOT_PASS') }}
MYSQL_SPAREFOOT_PORT: {{ salt['pillar.get']('bookingservice-dev:MYSQL_SPAREFOOT_PORT') }}
APP_LOG_FILE: {{ salt['pillar.get']('bookingservice-dev:APP_LOG_FILE') }}
REDIS_HOST: {{ salt['pillar.get']('bookingservice-dev:REDIS_HOST') }}
REDIS_PORT: {{ salt['pillar.get']('bookingservice-dev:REDIS_PORT') }}
Deployments with rancher-compose
Deployments to Dev and Staging are done via Bamboo
Deployments to Production are done by developers via HipChat commands
In the end, everything is invoking our salt-deploy.py script
Set some salt grains for target env, version, buildid, image tag in quay.io
Services get versioned with a timestamp and bamboo build id
Render jinja2 / Inject Salt grains and pillar data via salt minion python code
caller.sminion.functions['cp.get_template'](cwd + '/docker-compose.yml', cwd + '/docker-compose-
salt.yml')
caller.sminion.functions['cp.get_template'](cwd + '/rancher-compose.yml', cwd + '/rancher-compose-
salt.yml')
Invokes rancher-compose create / up
Cleanup to keep the live verison of a service and live-1 version. The rest are purged.
Surprise! Rancher Adds Variable Support
Does the support for interpolating variables, added in Rancher 0.41, deprecate the
work we've done with Salt and rendering jinja2 templates?
No. We already maintain data in grains and pillars so we just reuse that data.
Rancher implementation uses the environment variables on the host running
rancher-compose to fill in the blanks
It would require logic to load those env variables based on the target env (dev/
stage/prod) so might as well get the data out of salt pillar which has separate
pillars for each service and then broken down by target environment.
So we deployed our first microservice and...
So we deployed our first microservice and...
...Everything worked...
So we deployed our first microservice and...
...Everything worked...
… Until it didn’t.
The Day Rancher Died
ELB
EC2
Containers
The Day Rancher Died
ELB
EC2
Containers
The Day Rancher Died
ELB
EC2
Containers
Where are we now?
52 Microservices in production with Rancher + Docker
5-10 Deployments per day on average
Busiest services handling around 50 requests / second
Consumer facing applications being containerized in development
New teams cutting their teeth
Keep on “Strangling”*
* DO NOT: google image search for “strangling hands”
Finally
Start small
Fail (a lot)
Move on and apply
what you learned
Thank you!
These Slides: http://bit.ly/1SVGaRA
Reach out:
● Steve (swoodruff@sparefoot.com, Twitter @sjwoodr)
Questions?

More Related Content

What's hot

AWS Lambda and Serverless framework: lessons learned while building a serverl...
AWS Lambda and Serverless framework: lessons learned while building a serverl...AWS Lambda and Serverless framework: lessons learned while building a serverl...
AWS Lambda and Serverless framework: lessons learned while building a serverl...
Luciano Mammino
 
Screencast dave dev-introtoask-andecho-july2015
Screencast dave dev-introtoask-andecho-july2015Screencast dave dev-introtoask-andecho-july2015
Screencast dave dev-introtoask-andecho-july2015
David Isbitski
 

What's hot (20)

Getting Started With Docker on AWS
Getting Started With Docker on AWSGetting Started With Docker on AWS
Getting Started With Docker on AWS
 
AWS Lambda and Serverless framework: lessons learned while building a serverl...
AWS Lambda and Serverless framework: lessons learned while building a serverl...AWS Lambda and Serverless framework: lessons learned while building a serverl...
AWS Lambda and Serverless framework: lessons learned while building a serverl...
 
AWS Step Function with API Gateway Integration - Metin Kale, Chicago
AWS Step Function with API Gateway Integration - Metin Kale, ChicagoAWS Step Function with API Gateway Integration - Metin Kale, Chicago
AWS Step Function with API Gateway Integration - Metin Kale, Chicago
 
Serverless Architecture - A Gentle Overview
Serverless Architecture - A Gentle OverviewServerless Architecture - A Gentle Overview
Serverless Architecture - A Gentle Overview
 
Serverless Architecture Patterns - Manoj Ganapathi
Serverless Architecture Patterns - Manoj GanapathiServerless Architecture Patterns - Manoj Ganapathi
Serverless Architecture Patterns - Manoj Ganapathi
 
From AUI to Atlaskit - Streamlining Development for Server & Cloud Apps
From AUI to Atlaskit - Streamlining Development for Server & Cloud AppsFrom AUI to Atlaskit - Streamlining Development for Server & Cloud Apps
From AUI to Atlaskit - Streamlining Development for Server & Cloud Apps
 
Open stack ocata summit enabling aws lambda-like functionality with openstac...
Open stack ocata summit  enabling aws lambda-like functionality with openstac...Open stack ocata summit  enabling aws lambda-like functionality with openstac...
Open stack ocata summit enabling aws lambda-like functionality with openstac...
 
Evolution of the REST API
Evolution of the REST APIEvolution of the REST API
Evolution of the REST API
 
Screencast dave dev-introtoask-andecho-july2015
Screencast dave dev-introtoask-andecho-july2015Screencast dave dev-introtoask-andecho-july2015
Screencast dave dev-introtoask-andecho-july2015
 
Cooking your Ravioli "al dente" with Hexagonal Architecture
Cooking your Ravioli "al dente" with Hexagonal ArchitectureCooking your Ravioli "al dente" with Hexagonal Architecture
Cooking your Ravioli "al dente" with Hexagonal Architecture
 
Serverless Architectures on AWS Lambda
Serverless Architectures on AWS LambdaServerless Architectures on AWS Lambda
Serverless Architectures on AWS Lambda
 
(CMP302) Amazon ECS: Distributed Applications at Scale
(CMP302) Amazon ECS: Distributed Applications at Scale(CMP302) Amazon ECS: Distributed Applications at Scale
(CMP302) Amazon ECS: Distributed Applications at Scale
 
Spring cloud Service-Discovery
Spring cloud Service-DiscoverySpring cloud Service-Discovery
Spring cloud Service-Discovery
 
How to Build a Big Data Application: Serverless Edition
How to Build a Big Data Application: Serverless EditionHow to Build a Big Data Application: Serverless Edition
How to Build a Big Data Application: Serverless Edition
 
Magic of web components
Magic of web componentsMagic of web components
Magic of web components
 
AWS Summit Singapore - Lambda, Step Functions and Datadog: A Symphony
AWS Summit Singapore - Lambda, Step Functions and Datadog: A SymphonyAWS Summit Singapore - Lambda, Step Functions and Datadog: A Symphony
AWS Summit Singapore - Lambda, Step Functions and Datadog: A Symphony
 
Rails 5 – most effective features for apps upgradation
Rails 5 – most effective features for apps upgradationRails 5 – most effective features for apps upgradation
Rails 5 – most effective features for apps upgradation
 
Twelve Factor Serverless Applications
Twelve Factor Serverless ApplicationsTwelve Factor Serverless Applications
Twelve Factor Serverless Applications
 
Managing the Continuous Delivery of Code to AWS Lambda
Managing the Continuous Delivery of Code to AWS LambdaManaging the Continuous Delivery of Code to AWS Lambda
Managing the Continuous Delivery of Code to AWS Lambda
 
2010 07-20 TDD with ActiveResource
2010 07-20 TDD with ActiveResource2010 07-20 TDD with ActiveResource
2010 07-20 TDD with ActiveResource
 

Viewers also liked

Viewers also liked (20)

The Cognitive Neuroscience of Empathy, DevOpsDays Austin 2016
The Cognitive Neuroscience of Empathy, DevOpsDays Austin 2016The Cognitive Neuroscience of Empathy, DevOpsDays Austin 2016
The Cognitive Neuroscience of Empathy, DevOpsDays Austin 2016
 
2016 - IGNITE - How Do I Even Swarm
2016 - IGNITE - How Do I Even Swarm2016 - IGNITE - How Do I Even Swarm
2016 - IGNITE - How Do I Even Swarm
 
2016 - IGNITE - A Developer's Progress: The mistaeks that have made me who I am
2016 - IGNITE - A Developer's Progress: The mistaeks that have made me who I am2016 - IGNITE - A Developer's Progress: The mistaeks that have made me who I am
2016 - IGNITE - A Developer's Progress: The mistaeks that have made me who I am
 
2016 - Open Mic - IGNITE - Open Infrastructure = ANY Infrastructure
2016 - Open Mic - IGNITE - Open Infrastructure = ANY Infrastructure2016 - Open Mic - IGNITE - Open Infrastructure = ANY Infrastructure
2016 - Open Mic - IGNITE - Open Infrastructure = ANY Infrastructure
 
2016 - Safely Removing the Last Roadblock to Continuous Delivery
2016 - Safely Removing the Last Roadblock to Continuous Delivery2016 - Safely Removing the Last Roadblock to Continuous Delivery
2016 - Safely Removing the Last Roadblock to Continuous Delivery
 
2015 | Continuous Acceleration: Why Continuous Everything Needs A Supply Chai...
2015 | Continuous Acceleration: Why Continuous Everything Needs A Supply Chai...2015 | Continuous Acceleration: Why Continuous Everything Needs A Supply Chai...
2015 | Continuous Acceleration: Why Continuous Everything Needs A Supply Chai...
 
2016 - IGNITE - ChatOps for Developers and Everyone Else, Too
2016 - IGNITE - ChatOps for Developers and Everyone Else, Too2016 - IGNITE - ChatOps for Developers and Everyone Else, Too
2016 - IGNITE - ChatOps for Developers and Everyone Else, Too
 
2016 - Fail Proof Ways to Run Beautiful Tests Regardless Of Browser Choice
2016 - Fail Proof Ways to Run Beautiful Tests Regardless Of Browser Choice2016 - Fail Proof Ways to Run Beautiful Tests Regardless Of Browser Choice
2016 - Fail Proof Ways to Run Beautiful Tests Regardless Of Browser Choice
 
2016 - IGNITE - Rugged Enterprise DevSecNetQAGovOps
2016 - IGNITE - Rugged Enterprise DevSecNetQAGovOps2016 - IGNITE - Rugged Enterprise DevSecNetQAGovOps
2016 - IGNITE - Rugged Enterprise DevSecNetQAGovOps
 
2016 - IGNITE - Blameless System Design
2016 - IGNITE - Blameless System Design2016 - IGNITE - Blameless System Design
2016 - IGNITE - Blameless System Design
 
Dockerfy Your CI/CD - DevOpsDays Austin 2014
Dockerfy Your CI/CD - DevOpsDays Austin 2014Dockerfy Your CI/CD - DevOpsDays Austin 2014
Dockerfy Your CI/CD - DevOpsDays Austin 2014
 
2016 - IGNITE - 17th Century Shipbuild and Your Failed Software Project
2016 - IGNITE - 17th Century Shipbuild and Your Failed Software Project2016 - IGNITE - 17th Century Shipbuild and Your Failed Software Project
2016 - IGNITE - 17th Century Shipbuild and Your Failed Software Project
 
2016 - DevOpsDays Austin Keynote - 2016 State of DevOps
2016 - DevOpsDays Austin Keynote - 2016 State of DevOps2016 - DevOpsDays Austin Keynote - 2016 State of DevOps
2016 - DevOpsDays Austin Keynote - 2016 State of DevOps
 
DevOpsDays Austin: Helping Horses Become Unicorns, Chef's Operations Maturity...
DevOpsDays Austin: Helping Horses Become Unicorns, Chef's Operations Maturity...DevOpsDays Austin: Helping Horses Become Unicorns, Chef's Operations Maturity...
DevOpsDays Austin: Helping Horses Become Unicorns, Chef's Operations Maturity...
 
2016 - IGNITE - Terraform to go from Zero to Prod in less than 1 month and TH...
2016 - IGNITE - Terraform to go from Zero to Prod in less than 1 month and TH...2016 - IGNITE - Terraform to go from Zero to Prod in less than 1 month and TH...
2016 - IGNITE - Terraform to go from Zero to Prod in less than 1 month and TH...
 
Scaling a Start-up DevOps team to 10x while scaling the system 50x
Scaling a Start-up DevOps team to 10x while scaling the system 50x Scaling a Start-up DevOps team to 10x while scaling the system 50x
Scaling a Start-up DevOps team to 10x while scaling the system 50x
 
2016 - IGNITE - The Cynefin Model for Operational Transformation
2016 - IGNITE - The Cynefin Model for Operational Transformation2016 - IGNITE - The Cynefin Model for Operational Transformation
2016 - IGNITE - The Cynefin Model for Operational Transformation
 
Devopsdays Austin 2015 - Guns, Germs and Microservices
Devopsdays Austin 2015 - Guns, Germs and MicroservicesDevopsdays Austin 2015 - Guns, Germs and Microservices
Devopsdays Austin 2015 - Guns, Germs and Microservices
 
2016 - Orchestrating multi-container apps: How I came to love the pod
2016 - Orchestrating multi-container apps: How I came to love the pod2016 - Orchestrating multi-container apps: How I came to love the pod
2016 - Orchestrating multi-container apps: How I came to love the pod
 
Devops Done Us Wrong
Devops Done Us WrongDevops Done Us Wrong
Devops Done Us Wrong
 

Similar to 2016 - Easing Your Way Into Docker: Lessons From a Journey to Production

Application Deployment on Openstack
Application Deployment on OpenstackApplication Deployment on Openstack
Application Deployment on Openstack
Docker, Inc.
 
Docker intro
Docker introDocker intro
Docker intro
spiddy
 
Kubernetes @ meetic
Kubernetes @ meeticKubernetes @ meetic
Kubernetes @ meetic
Sébastien Le Gall
 

Similar to 2016 - Easing Your Way Into Docker: Lessons From a Journey to Production (20)

ContainerDays NYC 2015: "Easing Your Way Into Docker: Lessons From a Journey ...
ContainerDays NYC 2015: "Easing Your Way Into Docker: Lessons From a Journey ...ContainerDays NYC 2015: "Easing Your Way Into Docker: Lessons From a Journey ...
ContainerDays NYC 2015: "Easing Your Way Into Docker: Lessons From a Journey ...
 
Container Days
Container DaysContainer Days
Container Days
 
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, OrchestrationThe Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
 
DCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development Pipeline
 
Container on azure
Container on azureContainer on azure
Container on azure
 
Docker for Dummies
Docker for DummiesDocker for Dummies
Docker for Dummies
 
Dockerize your Symfony application - Symfony Live NYC 2014
Dockerize your Symfony application - Symfony Live NYC 2014Dockerize your Symfony application - Symfony Live NYC 2014
Dockerize your Symfony application - Symfony Live NYC 2014
 
Choosing the Right Framework for Running Docker Containers in Prod
Choosing the Right Framework for Running Docker Containers in ProdChoosing the Right Framework for Running Docker Containers in Prod
Choosing the Right Framework for Running Docker Containers in Prod
 
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
 
Application Deployment on Openstack
Application Deployment on OpenstackApplication Deployment on Openstack
Application Deployment on Openstack
 
dockerSAW
dockerSAWdockerSAW
dockerSAW
 
Docker - Demo on PHP Application deployment
Docker - Demo on PHP Application deployment Docker - Demo on PHP Application deployment
Docker - Demo on PHP Application deployment
 
Working with microservices and Amazon ECS at Airtime
Working with microservices and Amazon ECS at AirtimeWorking with microservices and Amazon ECS at Airtime
Working with microservices and Amazon ECS at Airtime
 
Can I Contain This?
Can I Contain This?Can I Contain This?
Can I Contain This?
 
Docker intro
Docker introDocker intro
Docker intro
 
ContainerDayVietnam2016: Dockerize a small business
ContainerDayVietnam2016: Dockerize a small businessContainerDayVietnam2016: Dockerize a small business
ContainerDayVietnam2016: Dockerize a small business
 
Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14
 
DockerCon SF 2015: Docker at Lyft
DockerCon SF 2015: Docker at LyftDockerCon SF 2015: Docker at Lyft
DockerCon SF 2015: Docker at Lyft
 
Kubernetes @ meetic
Kubernetes @ meeticKubernetes @ meetic
Kubernetes @ meetic
 
Austin - Container Days - Docker 101
Austin - Container Days - Docker 101Austin - Container Days - Docker 101
Austin - Container Days - Docker 101
 

More from devopsdaysaustin

More from devopsdaysaustin (13)

2016 - Open Mic - IGNITE - The Power of #DadOps for women in tech
2016 - Open Mic - IGNITE - The Power of #DadOps for women in tech2016 - Open Mic - IGNITE - The Power of #DadOps for women in tech
2016 - Open Mic - IGNITE - The Power of #DadOps for women in tech
 
2016 - Open Mic - IGNITE - This is a Tire Fire
2016 - Open Mic - IGNITE - This is a Tire Fire2016 - Open Mic - IGNITE - This is a Tire Fire
2016 - Open Mic - IGNITE - This is a Tire Fire
 
2016 - IGNITE - An ElasticSearch Cluster Named George Armstrong Custer
2016 - IGNITE - An ElasticSearch Cluster Named George Armstrong Custer2016 - IGNITE - An ElasticSearch Cluster Named George Armstrong Custer
2016 - IGNITE - An ElasticSearch Cluster Named George Armstrong Custer
 
2016 - IGNITE - No Assholes
2016 - IGNITE - No Assholes2016 - IGNITE - No Assholes
2016 - IGNITE - No Assholes
 
2016 - IGNITE - Real Heroes Draw Pictures
2016 - IGNITE - Real Heroes Draw Pictures2016 - IGNITE - Real Heroes Draw Pictures
2016 - IGNITE - Real Heroes Draw Pictures
 
2016 - IGNITE - DevOps or NoOps
2016 - IGNITE - DevOps or NoOps2016 - IGNITE - DevOps or NoOps
2016 - IGNITE - DevOps or NoOps
 
2016 - You Don't Belong Here: Dealing with Impostor Syndrome
2016 - You Don't Belong Here: Dealing with Impostor Syndrome2016 - You Don't Belong Here: Dealing with Impostor Syndrome
2016 - You Don't Belong Here: Dealing with Impostor Syndrome
 
2016 - Compliance as Code - InSpec
2016 - Compliance as Code - InSpec2016 - Compliance as Code - InSpec
2016 - Compliance as Code - InSpec
 
2016 - IGNITE - Being an introvert and at a conference, not as hellish as you...
2016 - IGNITE - Being an introvert and at a conference, not as hellish as you...2016 - IGNITE - Being an introvert and at a conference, not as hellish as you...
2016 - IGNITE - Being an introvert and at a conference, not as hellish as you...
 
2016 - The Ops Must Be Crazy - Hack Your Team's Ops Culture With One Weird Trick
2016 - The Ops Must Be Crazy - Hack Your Team's Ops Culture With One Weird Trick2016 - The Ops Must Be Crazy - Hack Your Team's Ops Culture With One Weird Trick
2016 - The Ops Must Be Crazy - Hack Your Team's Ops Culture With One Weird Trick
 
2016 - DevOps Meets APIs - Model once. Benefit everywhere.
2016 - DevOps Meets APIs - Model once. Benefit everywhere.2016 - DevOps Meets APIs - Model once. Benefit everywhere.
2016 - DevOps Meets APIs - Model once. Benefit everywhere.
 
2016 - Continuously Delivering Microservices in Kubernetes using Jenkins
2016 - Continuously Delivering Microservices in Kubernetes using Jenkins2016 - Continuously Delivering Microservices in Kubernetes using Jenkins
2016 - Continuously Delivering Microservices in Kubernetes using Jenkins
 
2016 - 10 questions you should answer before building a new microservice
2016 - 10 questions you should answer before building a new microservice2016 - 10 questions you should answer before building a new microservice
2016 - 10 questions you should answer before building a new microservice
 

Recently uploaded

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 

Recently uploaded (20)

Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide Deck
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 

2016 - Easing Your Way Into Docker: Lessons From a Journey to Production

  • 1. Docker at SpareFoot Lessons From a Journey to Production DevOps Days Austin May 3, 2016
  • 2. Who am I? Steve Woodruff ❏ Director of DevOps at SpareFoot implementing CI/CD ❏ Spent 10+ years at Motorola doing embedded development (C, C++) ❏ Spent 5 years at IBM as a sys admin in a large server farm (Linux, AIX, Solaris) swoodruff@sparefoot.com Twitter: @sjwoodr GitHub: sjwoodr
  • 3. ● Think Hotels.com for self storage* ● All infrastructure in AWS ● 40 Developers on 7 Teams ○ Continuous Delivery ● Docker in production since 2014 *This kind of storage:
  • 4. The Beginning: SpareFoot + Docker Hackathon! Docker + Fig (now compose) allowed us to run production architecture locally.
  • 5. Yim - Call Center Application Used exclusively by our call center Chrome ONLY Node version n+1 React + Flux Vers. n +1 Vers. n +1 Vers. n
  • 6. Yim - Call Center Application Used exclusively by our call center Chrome ONLY Node version n+1 React + Flux Vers. n +1 Vers. n +1 Vers. n
  • 7. CI and deployments Janky shell scripts… slow builds, etc… Used Bamboo to build images feature branches were built/deployed to Dev master branch was built/deployed to Staging Dynamically created custom container start script Tried to auto-detect when the containers started to begin post-deploy test Build times were rather long Spent an awful long time doing docker push (to our registry) and docker pull (on the target hosts)
  • 8. Ok, so Docker feels like the a solution … and we kind of know how to do this. But.... Continuous Integration / Delivery? ○ Docker Registry ○ Bamboo ○ Deployments ● Host Volumes and Port Forwarding rules? ○ Not saved with the source code ● Get Docker to run in local, dev, staging, and production environments? ○ Configuration?
  • 9. Docker in Production (technically)! We had 2 load balanced EC2 instances running a node app. ELB 443 3000 3000
  • 10. Docker in Production (technically)! We had 2 load balanced EC2 instances running a node app. Now we have 2 load balanced EC2 instances running docker containers that run a node app! ELB 443 3000 3000 ELB App 1 App 1 3000 3000 443
  • 11. Docker in Production (technically)! ELB ELB App 1 App 1 We had 2 load balanced EC2 instances running a node app. Now we have 2 load balanced EC2 instances running docker containers that run a node app! NEW443 3000 3000 3000 3000 443
  • 12. Yim: Trouble in Docker Paradise Hosting our own Docker registry was a bad idea Stability was a problem No level of access control on the registry itself Mimicking servers - 1 container per host. Need orchestration please! Amazon Linux AMI -> old version of Docker… doh! Docker push/pull to/from registry was very slow build - push to registry deploy - pull from registry to each host, serially Performance was fine…. But stability was the issue This internal-facing nodejs app was moved to a pair of EC2 instances and out of Docker after about 4 months of pain and suffering
  • 13. Yim: Lessons Learned We need orchestration Rolling our own docker deployments was confusing to OPS and to the Dev team Our own docker registry is a bad idea Stability was a problem No level of access control on the registry itself Our S3 backend would grow by several GB per month with no automated cleanup No easy way to rollback failed deploys Just fix it and deploy again... All this culminated in a poor build process and affected CI velocity Longer builds, longer deploys, no real gain
  • 14. Like everyone else.... ...we were “deconstructing the monolith” Application Monolithic Library Data
  • 15. Like everyone else.... ...we were “deconstructing the monolith” Application REST API Data Microservice REST API Data Microservice REST API Data Microservice REST API Data Microservice API Gateway
  • 16. A Better Docker Registry With Yim we learned that rolling our own Registry was a bad idea. Limited Access Control We have to maintain it
  • 17. Let’s try Quay... Has Access Control Robots, yusss! We don’t have to maintain it
  • 18. We’ve learned some things... ● Easier than we thought ● Quay was the glue we needed ○ Use an off the shelf solution. ○ We like Quay.io ● Bolting on to our existing CI pipeline worked really well. ○ Developers didn’t have to learn new process ○ Microservice consumers can pull tagged versions ○ We can automate tests against all versions Now we talk containers from local -> dev -> staging but NOT in production.
  • 20. Production - What is still needed Orchestration Yim sucked because we tried to do this ourselves Better Deployments With rollbacks Configuration Management We have things to hide
  • 23. Production - Software Selection Choosing orchestration software / container service in early 2015 StackEngine Lacked docker-compose support Kubernetes PhD Required Mesosphere Nice, but slow to deploy EC2 Container Service Lacked docker-compose support and custom AMIs Tutum (now Docker Cloud) Rancher
  • 24. Production - Enter Rancher After running proof-of-concepts of both Tutum and Rancher, we decided to continue down our path to production deploys with Rancher. Had more mature support for docker-compose files. Tutum added this after our evaluation had ended Did not require us to orchestrate the deployments through their remote endpoint Rancher server runs on our EC2 instances and we are in full control of all the things Had a full API we can work with in addition to the custom rancher-compose cli Had a very-active user community and a beta-forum where the Rancher development team was active in answering questions and even troubleshooting configuration problems.
  • 25. Overlaying Docker on AWS ELB EC2 Containers
  • 26. Overlaying Docker on AWS Why the extra HAProxy layer? Allows us to create the ELB and leave them alone When we deploy new versioned services we update the service alias / haproxy links Allows for fast rollback to previous version of the service
  • 27. Deployments and Rollbacks Developers can deploy to production whenever they want HipChat bot commands to deploy and rollback/revert Deployments to each of the 3 environments use rancher-compose to Deploy new versioned services / containers Create or update service aliases / haproxy links Delete previous versioned services except for current and previous When things go haywire… We simply rollback Production deploy creates a docker-compose-rollback.yml file Query Rancher API to get list of running services Allows us to change haproxy and service alias links back to the previous version Super fast to rollback, no containers need to be spun up!
  • 28. Overlaying Docker on AWS ELB EC2 Containers
  • 29. Overlaying Docker on AWS ELB EC2 Containers
  • 30. Overlaying Docker on AWS ELB EC2 Containers
  • 31. Overlaying Docker on AWS ELB EC2 Containers Rollback!
  • 32. Secret Management We’re already using SaltStack to manage our EC2 minions (VMs) Salt Grains are used for some common variables used in salt states Salt Pillar Data exists which is configuration data available only to certain minions This Salt Pillar Data is already broken down by environment (dev/stage/prod) We should just use this data to dynamically create the docker-compose and rancher-compose files!
  • 33. Technical Challenge - docker-compose We needed to support a single docker-compose.yml file, maintained by developers of an app or service They don’t want to maintain local, dev, stage, and prod versions of this file Changes to multiple files would be error-prone Must support differences in the architecture or configuration of services across environments Secret Secret, I’ve got a Secret
  • 34. A templated rancher-compose file {% set sf_env = grains['bookingservice-env'] %} {% set version = grains['bookingservice-version'] %} bookingservice-{{ sf_env }}-{{ version }}: scale: 1 We use a scale of 1 because we use global host scheduling combined with host affinity so that one container of this service is deployed to each VM of the specified environment (dev/stage/prod). This allows us to spin up a new Rancher host and easily deploy to the new host VM.
  • 36. A Closer Look MYSQL_SPAREFOOT_HOST: {{ salt['pillar.get']('bookingservice-dev:MYSQL_SPAREFOOT_HOST') }} MYSQL_SPAREFOOT_DB: {{ salt['pillar.get']('bookingservice-dev:MYSQL_SPAREFOOT_DB') }} MYSQL_SPAREFOOT_USER: {{ salt['pillar.get']('bookingservice-dev:MYSQL_SPAREFOOT_USER') }} MYSQL_SPAREFOOT_PASS: {{ salt['pillar.get']('bookingservice-dev:MYSQL_SPAREFOOT_PASS') }} MYSQL_SPAREFOOT_PORT: {{ salt['pillar.get']('bookingservice-dev:MYSQL_SPAREFOOT_PORT') }} APP_LOG_FILE: {{ salt['pillar.get']('bookingservice-dev:APP_LOG_FILE') }} REDIS_HOST: {{ salt['pillar.get']('bookingservice-dev:REDIS_HOST') }} REDIS_PORT: {{ salt['pillar.get']('bookingservice-dev:REDIS_PORT') }}
  • 37. Deployments with rancher-compose Deployments to Dev and Staging are done via Bamboo Deployments to Production are done by developers via HipChat commands In the end, everything is invoking our salt-deploy.py script Set some salt grains for target env, version, buildid, image tag in quay.io Services get versioned with a timestamp and bamboo build id Render jinja2 / Inject Salt grains and pillar data via salt minion python code caller.sminion.functions['cp.get_template'](cwd + '/docker-compose.yml', cwd + '/docker-compose- salt.yml') caller.sminion.functions['cp.get_template'](cwd + '/rancher-compose.yml', cwd + '/rancher-compose- salt.yml') Invokes rancher-compose create / up Cleanup to keep the live verison of a service and live-1 version. The rest are purged.
  • 38. Surprise! Rancher Adds Variable Support Does the support for interpolating variables, added in Rancher 0.41, deprecate the work we've done with Salt and rendering jinja2 templates? No. We already maintain data in grains and pillars so we just reuse that data. Rancher implementation uses the environment variables on the host running rancher-compose to fill in the blanks It would require logic to load those env variables based on the target env (dev/ stage/prod) so might as well get the data out of salt pillar which has separate pillars for each service and then broken down by target environment.
  • 39. So we deployed our first microservice and...
  • 40. So we deployed our first microservice and... ...Everything worked...
  • 41. So we deployed our first microservice and... ...Everything worked... … Until it didn’t.
  • 42. The Day Rancher Died ELB EC2 Containers
  • 43. The Day Rancher Died ELB EC2 Containers
  • 44. The Day Rancher Died ELB EC2 Containers
  • 45. Where are we now? 52 Microservices in production with Rancher + Docker 5-10 Deployments per day on average Busiest services handling around 50 requests / second Consumer facing applications being containerized in development New teams cutting their teeth Keep on “Strangling”* * DO NOT: google image search for “strangling hands”
  • 46. Finally Start small Fail (a lot) Move on and apply what you learned
  • 47. Thank you! These Slides: http://bit.ly/1SVGaRA Reach out: ● Steve (swoodruff@sparefoot.com, Twitter @sjwoodr) Questions?