SlideShare uma empresa Scribd logo
1 de 26
Baixar para ler offline
Tuesday, July 15, 14
Packing It In: Images, Containers,
and Config Management
Michael Goetz
Sr. Consulting Engineer @ Chef
mpgoetz@getchef.com
Tuesday, July 15, 14
Who am I?
• Sr. Consulting Engineer @ Chef
• 8+ years of experience planning, managing
and operating web scale and enterprise
applications
• Avid woodworker
Tuesday, July 15, 14
This talk isn’t about joining a cult...
• Lots of opinions exist that claim to be the “only right
way” to manage your systems
• The true path is the best combination that makes
you go faster, in a safe and secure manner
• Use a toolbox, not one tool
http://leavingthecult.com/
Tuesday, July 15, 14
So what are my options?
• Artisanal machines made of metal and sweat
• Pristine virtual machines
• Isolated containers
• Just-in-time automatic configuration management
• All (or some) of the above?
Tuesday, July 15, 14
Artisanal machines made of metal and sweat
• Do we really need to talk about why this sucks?
• If you want to work on artisan crafts, take up woodworking
http://www.juggernautwoodworking.com/images/carve.jpg
Tuesday, July 15, 14
Containers vs. Virtual Machines
• Containers consist of an application
and its dependencies, running in
isolation in userland outside the
kernel.
• Virtual Machines create an entire
machine, including a fully functional
operating system.
https://www.docker.io/static/img/about/docker_vm.jpg
Tuesday, July 15, 14
Hurray! We can go back to golden images, right?
• The “golden image” problem still exists with containers, but on a much smaller
scale
• A dozen “server” images become dozens of “container” images
• AUFS layering mitigates some sprawl, but has a limit
• Modularity of applications without convergence of the entire system just kicks the
can down the road
http://images.smh.com.au/2011/10/28/2737998/ipad-art-wide-shipping-420x0.jpg
Tuesday, July 15, 14
What about configuration management?
• Convergence - coming to a desired end state
• Congruence - building a result from a blank state
• Always building from scratch can be time
consuming
• Specification of application versions becomes
extremely important
• Changes can happen unexpectedly if you don’t
plan ahead
Convergence is like fixing the
outcome and compute the
route (like a GPS finder), and
congruence is about repeating
a recipe in a sequence of
known steps to massage a
system into shape”
– Mark Burgess
Tuesday, July 15, 14
Tuesday, July 15, 14
Let’s talk real world here...
• My application system has:
• An OS layer that rarely changes
• A few supporting applications that change semi-
frequently
• My application code that changes rapidly
• This can translate to:
• VM image to act as a base OS + some deltas
• Container images for supporting applications
• Configuration management to maintain overall state
Tuesday, July 15, 14
So wait... that still seems like a lot of work
• With 3 layers of your application stack to maintain, it feels like the maintenance
demand will only go up
• We’ll use three tools to manage each layer:
• Packer - building and maintaining images (virtual machine host)
• Chef - building Docker images, provisioning the VM and managing the
configuration of running containers
• Docker - running the containers
Tuesday, July 15, 14
What is Packer?
• Half the battle is keeping VM images up-
to-date
• The more time spent refreshing VM
images, the more table flipping that will
ensue
• Packer is tool for creating identical
machine images for multiple platforms
from a single source configuration
• Makes programmatically building VM
images super easy!
{
	
  	
  "builders":	
  [{
	
  	
  	
  	
  "type":	
  "amazon-­‐ebs",
	
  	
  	
  	
  "region":	
  "us-­‐east-­‐1",
	
  	
  	
  	
  "source_ami":	
  "ami-­‐8ade42ba",
	
  	
  	
  	
  "instance_type":	
  "m3.medium",
	
  	
  	
  	
  "ssh_username":	
  "ubuntu",
	
  	
  	
  	
  "ami_name":	
  "my	
  ami	
  {{timestamp}}"
	
  	
  }],
	
  	
  "provisioners":	
  [{
	
  	
  	
  	
  "type":	
  "chef-­‐solo",
	
  	
  	
  	
  "cookbook_paths":	
  ["cookbooks"],
	
  	
  	
  	
  "json":	
  {
	
  	
  	
  	
  	
  	
  "name":	
  "my_node",
	
  	
  	
  	
  	
  	
  "run_list":	
  [
	
  	
  	
  	
  	
  	
  	
  	
  "recipe[docker]",
	
  	
  	
  	
  	
  	
  	
  	
  "recipe[my_application]"
	
  	
  	
  	
  	
  	
  ]
	
  	
  	
  	
  }
	
  	
  }]
}
Tuesday, July 15, 14
What is Docker?
• Docker combines Linux containers (LXC) with AUFS to
create portable, lightweight application containers
• Docker containers are running instances of Docker images
• Docker images can be shared via a public or private registry
• Containers can be single application processes or
lightweight virtual machines if a supervisor is provided.
Tuesday, July 15, 14
What is Chef?
• Chef is an automation platform that manages
infrastructure as code
• Configuration of systems is performed by reusable
recipes that are shared across your entire
infrastructure
• Information about the various infrastructure
components is cataloged and made available to to
inform the rest of the topology configuration
• Chef can run on demand or as a managed service to
keep infrastructure convergent
Tuesday, July 15, 14
Chef-Container
• A version of chef-client that includes
components to support running the chef-
client from within a Linux container
• Packaged with chef-client, runit and
chef-init
• Allows you to bootstrap the container
without an SSH connection
• Use chef-client resources the same way
in a container as on any UNIX- or Linux-
based platform
• Can manage multiple services within a
single container using chef-init & runit
Tuesday, July 15, 14
The knife-container plugin
• Used to initialize and build containers
•knife container docker init
•knife container docker build
• Docker support today, other containers
planned
• Berkshelf integration
• Supports Chef-Zero or Chef-Client modes
Tuesday, July 15, 14
Let’s get to building!
• Starting with a solid foundation is key to success
• Identify the core components that are unlikely to
change, but are different from default settings
• Security policies/applications
• Image hardening
• Core component packages
• Docker tooling
• The goal is to create a minimal base VM, combined
with the components that are consistently configured
across your entire application infrastructure
Tuesday, July 15, 14
Demo: Building the VM
Tuesday, July 15, 14
Building the Docker factory
• We need a repeatable factory for building Docker
images for the supporting applications
• Chef-container lets us use our existing Chef
cookbooks to create reusable Docker images
• The key to success is isolation - create the smallest
Docker images that will work
• Hook up your continuous integration system to crank
out new images as cookbooks are updated
Tuesday, July 15, 14
Demo: Building the Docker Factory
Tuesday, July 15, 14
Bringing it all together
• Now that we have our base VM and Docker factory
running, let’s manage an active application stack
• Chef will provision servers with the base VM, build
and run the Docker containers
• Ongoing convergence of the overall desired state of
the system will be managed by chef-clients running
inside each container.
Tuesday, July 15, 14
Demo: Using Chef to manage the entire system
Tuesday, July 15, 14
Wrapping Up
• Don’t join a cult
• Use what works to make things faster, more secure and more stable
• Keep the base VM small, but not too small
• Use containers to manage isolated, reusable applications
• Maintain a convergent infrastructure with automated configuration management
Tuesday, July 15, 14
Want to know more?
• Release: Chef Container 0.2.0 (beta) - http://www.getchef.com/blog/2014/07/15/
release-chef-container-0-2-0-beta/
• Chef Containers Documentation - http://docs.opscode.com/containers.html
• Video demo - https://www.youtube.com/watch?
v=nSB9rHG1_FQ&feature=youtu.be
• Packer - http://www.packer.io/
• Docker - http://www.docker.com/
Tuesday, July 15, 14
Thank You!
Michael Goetz
mpgoetz@getchef.com
@michaelpgoetz
Tuesday, July 15, 14

Mais conteúdo relacionado

Mais procurados

Beyond Apache: Faster Web Servers
Beyond Apache: Faster Web ServersBeyond Apache: Faster Web Servers
Beyond Apache: Faster Web Servers
webhostingguy
 

Mais procurados (20)

Engage 2019: The good, the bad and the ugly: a not so objective view on front...
Engage 2019: The good, the bad and the ugly: a not so objective view on front...Engage 2019: The good, the bad and the ugly: a not so objective view on front...
Engage 2019: The good, the bad and the ugly: a not so objective view on front...
 
Implementation of the Continuous Integration based on Atlassian Bamboo
 Implementation of the Continuous Integration based on Atlassian Bamboo Implementation of the Continuous Integration based on Atlassian Bamboo
Implementation of the Continuous Integration based on Atlassian Bamboo
 
WordPress Development Environments
WordPress Development EnvironmentsWordPress Development Environments
WordPress Development Environments
 
Hacking the way you work
Hacking the way you workHacking the way you work
Hacking the way you work
 
From zero to hero with running your asp.net core 1 application in a docker co...
From zero to hero with running your asp.net core 1 application in a docker co...From zero to hero with running your asp.net core 1 application in a docker co...
From zero to hero with running your asp.net core 1 application in a docker co...
 
Automation: PowerShell & DSC
Automation: PowerShell & DSCAutomation: PowerShell & DSC
Automation: PowerShell & DSC
 
Docker With Asp.net Core
Docker With Asp.net CoreDocker With Asp.net Core
Docker With Asp.net Core
 
Monoliths vs microservices
Monoliths vs microservicesMonoliths vs microservices
Monoliths vs microservices
 
Windows server containers
Windows server containersWindows server containers
Windows server containers
 
Working in harmony
Working in harmonyWorking in harmony
Working in harmony
 
bol.com Dutch Container Day presentation
bol.com Dutch Container Day presentationbol.com Dutch Container Day presentation
bol.com Dutch Container Day presentation
 
Railsconf 2014 - Deploying Rails is Easier Thank It Looks
Railsconf 2014 - Deploying Rails is Easier Thank It LooksRailsconf 2014 - Deploying Rails is Easier Thank It Looks
Railsconf 2014 - Deploying Rails is Easier Thank It Looks
 
Don't worry with bower
Don't worry with bowerDon't worry with bower
Don't worry with bower
 
Microservices without servers
Microservices without serversMicroservices without servers
Microservices without servers
 
CI/CD at bol.com
CI/CD at bol.comCI/CD at bol.com
CI/CD at bol.com
 
Infrastructure as Code (IaC)
Infrastructure as Code (IaC)Infrastructure as Code (IaC)
Infrastructure as Code (IaC)
 
Beyond Apache: Faster Web Servers
Beyond Apache: Faster Web ServersBeyond Apache: Faster Web Servers
Beyond Apache: Faster Web Servers
 
The Pivotal Engineering Dojo: Earning Your Black Belt in Cloud Foundry Engine...
The Pivotal Engineering Dojo: Earning Your Black Belt in Cloud Foundry Engine...The Pivotal Engineering Dojo: Earning Your Black Belt in Cloud Foundry Engine...
The Pivotal Engineering Dojo: Earning Your Black Belt in Cloud Foundry Engine...
 
Training Slides: Tungsten Replicator AMI - The Getting Started Guide
Training Slides: Tungsten Replicator AMI - The Getting Started GuideTraining Slides: Tungsten Replicator AMI - The Getting Started Guide
Training Slides: Tungsten Replicator AMI - The Getting Started Guide
 
Azure Templates for Consistent Deployment
Azure Templates for Consistent DeploymentAzure Templates for Consistent Deployment
Azure Templates for Consistent Deployment
 

Semelhante a Packing It In: Images, Containers, and Config Management

August Webinar - Water Cooler Talks: A Look into a Developer's Workbench
August Webinar - Water Cooler Talks: A Look into a Developer's WorkbenchAugust Webinar - Water Cooler Talks: A Look into a Developer's Workbench
August Webinar - Water Cooler Talks: A Look into a Developer's Workbench
Howard Greenberg
 

Semelhante a Packing It In: Images, Containers, and Config Management (20)

eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
 
The container revolution, and what it means to operators bay lisa - july 2016
The container revolution, and what it means to operators   bay lisa - july 2016The container revolution, and what it means to operators   bay lisa - july 2016
The container revolution, and what it means to operators bay lisa - july 2016
 
Vagrant for Effective DevOps Culture
Vagrant for Effective DevOps CultureVagrant for Effective DevOps Culture
Vagrant for Effective DevOps Culture
 
The Rocky Cloud Road
The Rocky Cloud RoadThe Rocky Cloud Road
The Rocky Cloud Road
 
Immutable infrastructure isn’t the answer
Immutable infrastructure isn’t the answerImmutable infrastructure isn’t the answer
Immutable infrastructure isn’t the answer
 
Chef vs puppet
Chef vs puppetChef vs puppet
Chef vs puppet
 
Midwest PHP - Scaling Magento
Midwest PHP - Scaling MagentoMidwest PHP - Scaling Magento
Midwest PHP - Scaling Magento
 
Warsaw MuleSoft Meetup - Runtime Fabric
Warsaw MuleSoft Meetup - Runtime FabricWarsaw MuleSoft Meetup - Runtime Fabric
Warsaw MuleSoft Meetup - Runtime Fabric
 
August Webinar - Water Cooler Talks: A Look into a Developer's Workbench
August Webinar - Water Cooler Talks: A Look into a Developer's WorkbenchAugust Webinar - Water Cooler Talks: A Look into a Developer's Workbench
August Webinar - Water Cooler Talks: A Look into a Developer's Workbench
 
An introduction to configuring Domino for Docker
An introduction to configuring Domino for DockerAn introduction to configuring Domino for Docker
An introduction to configuring Domino for Docker
 
Highly available nodejs
Highly available nodejsHighly available nodejs
Highly available nodejs
 
ThatConference 2016 - Highly Available Node.js
ThatConference 2016 - Highly Available Node.jsThatConference 2016 - Highly Available Node.js
ThatConference 2016 - Highly Available Node.js
 
Introduction to Containers - SQL Server and Docker
Introduction to Containers - SQL Server and DockerIntroduction to Containers - SQL Server and Docker
Introduction to Containers - SQL Server and Docker
 
Dockerize All The Things
Dockerize All The ThingsDockerize All The Things
Dockerize All The Things
 
Couchbase Connect 2016
Couchbase Connect 2016Couchbase Connect 2016
Couchbase Connect 2016
 
Warsaw MuleSoft Meetup #6 - CI/CD
Warsaw MuleSoft Meetup  #6 - CI/CDWarsaw MuleSoft Meetup  #6 - CI/CD
Warsaw MuleSoft Meetup #6 - CI/CD
 
Containerizing GPU Applications with Docker for Scaling to the Cloud
Containerizing GPU Applications with Docker for Scaling to the CloudContainerizing GPU Applications with Docker for Scaling to the Cloud
Containerizing GPU Applications with Docker for Scaling to the Cloud
 
Automation: The Good, The Bad and The Ugly with DevOpsGuys - AppD Summit Europe
Automation: The Good, The Bad and The Ugly with DevOpsGuys - AppD Summit EuropeAutomation: The Good, The Bad and The Ugly with DevOpsGuys - AppD Summit Europe
Automation: The Good, The Bad and The Ugly with DevOpsGuys - AppD Summit Europe
 
DevOpsGuys - DevOps Automation - The Good, The Bad and The Ugly
DevOpsGuys - DevOps Automation - The Good, The Bad and The UglyDevOpsGuys - DevOps Automation - The Good, The Bad and The Ugly
DevOpsGuys - DevOps Automation - The Good, The Bad and The Ugly
 
Database as a Service (DBaaS) on Kubernetes
Database as a Service (DBaaS) on KubernetesDatabase as a Service (DBaaS) on Kubernetes
Database as a Service (DBaaS) on Kubernetes
 

Último

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

Packing It In: Images, Containers, and Config Management

  • 2. Packing It In: Images, Containers, and Config Management Michael Goetz Sr. Consulting Engineer @ Chef mpgoetz@getchef.com Tuesday, July 15, 14
  • 3. Who am I? • Sr. Consulting Engineer @ Chef • 8+ years of experience planning, managing and operating web scale and enterprise applications • Avid woodworker Tuesday, July 15, 14
  • 4. This talk isn’t about joining a cult... • Lots of opinions exist that claim to be the “only right way” to manage your systems • The true path is the best combination that makes you go faster, in a safe and secure manner • Use a toolbox, not one tool http://leavingthecult.com/ Tuesday, July 15, 14
  • 5. So what are my options? • Artisanal machines made of metal and sweat • Pristine virtual machines • Isolated containers • Just-in-time automatic configuration management • All (or some) of the above? Tuesday, July 15, 14
  • 6. Artisanal machines made of metal and sweat • Do we really need to talk about why this sucks? • If you want to work on artisan crafts, take up woodworking http://www.juggernautwoodworking.com/images/carve.jpg Tuesday, July 15, 14
  • 7. Containers vs. Virtual Machines • Containers consist of an application and its dependencies, running in isolation in userland outside the kernel. • Virtual Machines create an entire machine, including a fully functional operating system. https://www.docker.io/static/img/about/docker_vm.jpg Tuesday, July 15, 14
  • 8. Hurray! We can go back to golden images, right? • The “golden image” problem still exists with containers, but on a much smaller scale • A dozen “server” images become dozens of “container” images • AUFS layering mitigates some sprawl, but has a limit • Modularity of applications without convergence of the entire system just kicks the can down the road http://images.smh.com.au/2011/10/28/2737998/ipad-art-wide-shipping-420x0.jpg Tuesday, July 15, 14
  • 9. What about configuration management? • Convergence - coming to a desired end state • Congruence - building a result from a blank state • Always building from scratch can be time consuming • Specification of application versions becomes extremely important • Changes can happen unexpectedly if you don’t plan ahead Convergence is like fixing the outcome and compute the route (like a GPS finder), and congruence is about repeating a recipe in a sequence of known steps to massage a system into shape” – Mark Burgess Tuesday, July 15, 14
  • 11. Let’s talk real world here... • My application system has: • An OS layer that rarely changes • A few supporting applications that change semi- frequently • My application code that changes rapidly • This can translate to: • VM image to act as a base OS + some deltas • Container images for supporting applications • Configuration management to maintain overall state Tuesday, July 15, 14
  • 12. So wait... that still seems like a lot of work • With 3 layers of your application stack to maintain, it feels like the maintenance demand will only go up • We’ll use three tools to manage each layer: • Packer - building and maintaining images (virtual machine host) • Chef - building Docker images, provisioning the VM and managing the configuration of running containers • Docker - running the containers Tuesday, July 15, 14
  • 13. What is Packer? • Half the battle is keeping VM images up- to-date • The more time spent refreshing VM images, the more table flipping that will ensue • Packer is tool for creating identical machine images for multiple platforms from a single source configuration • Makes programmatically building VM images super easy! {    "builders":  [{        "type":  "amazon-­‐ebs",        "region":  "us-­‐east-­‐1",        "source_ami":  "ami-­‐8ade42ba",        "instance_type":  "m3.medium",        "ssh_username":  "ubuntu",        "ami_name":  "my  ami  {{timestamp}}"    }],    "provisioners":  [{        "type":  "chef-­‐solo",        "cookbook_paths":  ["cookbooks"],        "json":  {            "name":  "my_node",            "run_list":  [                "recipe[docker]",                "recipe[my_application]"            ]        }    }] } Tuesday, July 15, 14
  • 14. What is Docker? • Docker combines Linux containers (LXC) with AUFS to create portable, lightweight application containers • Docker containers are running instances of Docker images • Docker images can be shared via a public or private registry • Containers can be single application processes or lightweight virtual machines if a supervisor is provided. Tuesday, July 15, 14
  • 15. What is Chef? • Chef is an automation platform that manages infrastructure as code • Configuration of systems is performed by reusable recipes that are shared across your entire infrastructure • Information about the various infrastructure components is cataloged and made available to to inform the rest of the topology configuration • Chef can run on demand or as a managed service to keep infrastructure convergent Tuesday, July 15, 14
  • 16. Chef-Container • A version of chef-client that includes components to support running the chef- client from within a Linux container • Packaged with chef-client, runit and chef-init • Allows you to bootstrap the container without an SSH connection • Use chef-client resources the same way in a container as on any UNIX- or Linux- based platform • Can manage multiple services within a single container using chef-init & runit Tuesday, July 15, 14
  • 17. The knife-container plugin • Used to initialize and build containers •knife container docker init •knife container docker build • Docker support today, other containers planned • Berkshelf integration • Supports Chef-Zero or Chef-Client modes Tuesday, July 15, 14
  • 18. Let’s get to building! • Starting with a solid foundation is key to success • Identify the core components that are unlikely to change, but are different from default settings • Security policies/applications • Image hardening • Core component packages • Docker tooling • The goal is to create a minimal base VM, combined with the components that are consistently configured across your entire application infrastructure Tuesday, July 15, 14
  • 19. Demo: Building the VM Tuesday, July 15, 14
  • 20. Building the Docker factory • We need a repeatable factory for building Docker images for the supporting applications • Chef-container lets us use our existing Chef cookbooks to create reusable Docker images • The key to success is isolation - create the smallest Docker images that will work • Hook up your continuous integration system to crank out new images as cookbooks are updated Tuesday, July 15, 14
  • 21. Demo: Building the Docker Factory Tuesday, July 15, 14
  • 22. Bringing it all together • Now that we have our base VM and Docker factory running, let’s manage an active application stack • Chef will provision servers with the base VM, build and run the Docker containers • Ongoing convergence of the overall desired state of the system will be managed by chef-clients running inside each container. Tuesday, July 15, 14
  • 23. Demo: Using Chef to manage the entire system Tuesday, July 15, 14
  • 24. Wrapping Up • Don’t join a cult • Use what works to make things faster, more secure and more stable • Keep the base VM small, but not too small • Use containers to manage isolated, reusable applications • Maintain a convergent infrastructure with automated configuration management Tuesday, July 15, 14
  • 25. Want to know more? • Release: Chef Container 0.2.0 (beta) - http://www.getchef.com/blog/2014/07/15/ release-chef-container-0-2-0-beta/ • Chef Containers Documentation - http://docs.opscode.com/containers.html • Video demo - https://www.youtube.com/watch? v=nSB9rHG1_FQ&feature=youtu.be • Packer - http://www.packer.io/ • Docker - http://www.docker.com/ Tuesday, July 15, 14