SlideShare a Scribd company logo
Automa'ng  the    
Modern  Datacenter
@mitchellh
Mitchell  Hashimoto
Powering  the  so9ware-­‐managed  datacenter.
HashiCorp
hashicorp.com
The  Modern  Datacenter
Single  Server
Datacenter
Server
Mul'-­‐Server
Datacenter
Server Server
ServerServer
Virtualiza'on
Datacenter
Server Server
VM VM
VM VM
VM VM
VM VM
Containeriza'on
Datacenter
Server Server
VM
VMVM
VM
VM
VMVM
Service  Prolifera'on
Datacenter
Server Server Server
Server Server Server
Server Server Server
DNS
Database
CDN
Etc…
• Hybrid  cloud:  Physical  datacenter  vs.  Cloud  provider  
• Mul'-­‐paradigm:  Physical,  virtual,  container  
• IaaS,  PaaS,  SaaS  depending  on  the  app  
• Opera'ng  systems:  Windows,  Linux,  Mac,  Other  
• Realis'cally  a  mixture  of  everything  just  shown
But…  why?
Common  Goal:  Efficiently  deliver  and  
maintain  applica9ons.
Applica'on  Delivery
• Consistent  
• Shareable  
• Readily  Available  
• High  producCon  

parity.
• Start  and  configure  
servers  /  services  
• Deploy  and  run  
applicaCon
• Update  servers  or  
applicaCons  
• Reconfigure,  feature  
flag  
• Monitor  health  
• Orchestrate  
complex  changes
Development Deployment Maintenance
HashiCorp’s  Open  Source  Tools
Development Deployment Maintenance
Taming  the  Datacenter
Deployment  +  Maintenance
Deployment  +  Maintenance
1. Acquisi'on  
2. Provision  
3. Update  
4. Destroy
Historically
• Servers:  Days,  weeks  
• Provisioning:  Hours,  days  
• SaaS:  <didn’t  exist>
Today
• Servers:  Minutes  
• Provisioning:  Minutes  
• SaaS:  Minutes
Historically
• Rela'vely  fixed  set  of  servers  
• Fewer  applica'ons  to  deploy  
• Fewer  SaaS  
• Less  demanding  web  traffic
Today
• Poten'ally  elas'c  set  of  servers  of  varying  sizes  
• Push  towards  SoA  
• SaaS  for  everything  
• More  internet  connected  devices  than  ever  before  =>  higher  traffic  
What  do  we  need?
• Zero  to  deployed  in  one  command  
• Resiliency  through  distributed  systems  
• Autoscaling,  autohealing  
• Beder  teamwork  through  codified  knowledge
But  how?  Automa6on.
HashiCorp’s  Open  Source  Tools
Development Deployment Maintenance
Automa9ng  the  Datacenter
Deployment  +  Maintenance
terraform.io
Build,  combine,  and  launch  
infrastructure  safely  and  efficiently.
terraform.io
What  If  I  asked  you  to…  
• create  a  completely  isolated  second  environment  to  run  an  applica'on  
(staging,  QA,  dev,  etc.)?  
• deploy  a  complex  new  applica'on?    
• update  an  exis'ng  complex  applica'on?    
• document  how  our  infrastructure  is  architected?    
• delegate  some  ops  to  smaller  teams?  (Core  IT  vs.  App  IT)
What  If  I  asked  you  to…  
• create  a  completely  isolated  second  environment  to  run  an  applica'on  
(staging,  QA,  dev,  etc.)?  One  command.  
• deploy  a  complex  new  applica'on?  Code  it,  diff  it,  pull  request.  
• update  an  exis'ng  complex  applica'on?  Code  it,  diff  it,  pull  request.  
• document  how  our  infrastructure  is  architected?  Read  the  code.  
• delegate  some  ops  to  smaller  teams?  (Core  IT  vs.  App  IT)  Modules,  
code  reviews.
But  how?
Terraform
• Create  infrastructure  with  code:  servers,  load  balancers,  databases,  email  
providers,  etc.    
• One  command  to  create,  update  infrastructure.  
• Preview  changes  to  infrastructure,  save  diffs.    
• Use  code  +  diffs  to  treat  infrastructure  change  just  like  code  change:  
make  a  pull  request,  show  the  differences,  review  it,  and  accept.    
• Break  infrastructure  into  modules  to  encourage/allow  teamwork  without  
risking  stability.  
Infrastructure  as  Code
DigitalOcean  Droplet  with  DNS  in  DNSimple
resource "digitalocean_droplet" "web" {
name = "tf-web"
size = "512mb"
image = "centos-5-8-x32"
region = "sfo1"
}
resource "dnsimple_record" "hello" {
domain = "example.com"
name = "test"
value = "${digitalocean_droplet.web.ipv4_address}"
type = "A"
}
Infrastructure  as  Code
DigitalOcean  Droplet  with  DNS  in  DNSimple
resource "digitalocean_droplet" "web" {
name = "tf-web"
size = "512mb"
image = "centos-5-8-x32"
region = "sfo1"
}
resource "dnsimple_record" "hello" {
domain = "example.com"
name = "test"
value = "${digitalocean_droplet.web.ipv4_address}"
type = "A"
}
Infrastructure  as  Code
DigitalOcean  Droplet  with  DNS  in  DNSimple
resource "digitalocean_droplet" "web" {
name = "tf-web"
size = "512mb"
image = "centos-5-8-x32"
region = "sfo1"
}
resource "dnsimple_record" "hello" {
domain = "example.com"
name = "test"
value = "${digitalocean_droplet.web.ipv4_address}"
type = "A"
}
Infrastructure  as  Code
DigitalOcean  Droplet  with  DNS  in  DNSimple
resource "digitalocean_droplet" "web" {
name = "tf-web"
size = "512mb"
image = "centos-5-8-x32"
region = "sfo1"
}
resource "dnsimple_record" "hello" {
domain = "example.com"
name = "test"
value = "${digitalocean_droplet.web.ipv4_address}"
type = "A"
}
Infrastructure  as  Code
• Human  friendly  config,  JSON  compa'ble  
• Text  format  makes  it  version-­‐able,  VCS-­‐friendly  
• Declara've  
• Infrastructure  as  code  on  a  level  not  before  possible
Zero  to  Done  in  One  Command
Terraform  Apply
$ terraform apply
digitalocean_droplet.web: Creating…
dnsimple_record.hello: Creating…
Apply complete! Resources: 2 added, 0 changed, 0 destroyed.
Zero  to  Done  in  One  Command
• Idempotent  
• Highly  parallelized  
• Will  only  do  what  the  plan  says
Safely  Change/Iterate
Terraform  Plan
+ digitalocean_droplet.web
backups: "" => "<computed>"
image: "" => "centos-5-8-x32"
ipv4_address: "" => "<computed>"
ipv4_address_private: "" => "<computed>"
name: "" => "tf-web"
private_networking: "" => "<computed>"
region: "" => "sfo1"
size: "" => "512mb"
status: "" => "<computed>"
+ dnsimple_record.hello
domain: "" => "example.com"
domain_id: "" => "<computed>"
hostname: "" => "<computed>"
name: "" => "test"
priority: "" => "<computed>"
ttl: "" => "<computed>"
type: "" => "A"
value: "" => "${digitalocean_droplet.web.ipv4_address}"
Safely  Change/Iterate
Terraform  Plan
+ digitalocean_droplet.web
backups: "" => "<computed>"
image: "" => "centos-5-8-x32"
ipv4_address: "" => "<computed>"
ipv4_address_private: "" => "<computed>"
name: "" => "tf-web"
private_networking: "" => "<computed>"
region: "" => "sfo1"
size: "" => "512mb"
status: "" => "<computed>"
+ dnsimple_record.hello
domain: "" => "example.com"
domain_id: "" => "<computed>"
hostname: "" => "<computed>"
name: "" => "test"
priority: "" => "<computed>"
ttl: "" => "<computed>"
type: "" => "A"
value: "" => "${digitalocean_droplet.web.ipv4_address}"
Safely  Change/Iterate
Terraform  Plan
+ digitalocean_droplet.web
backups: "" => "<computed>"
image: "" => "centos-5-8-x32"
ipv4_address: "" => "<computed>"
ipv4_address_private: "" => "<computed>"
name: "" => "tf-web"
private_networking: "" => "<computed>"
region: "" => "sfo1"
size: "" => "512mb"
status: "" => "<computed>"
+ dnsimple_record.hello
domain: "" => "example.com"
domain_id: "" => "<computed>"
hostname: "" => "<computed>"
name: "" => "test"
priority: "" => "<computed>"
ttl: "" => "<computed>"
type: "" => "A"
value: "" => "${digitalocean_droplet.web.ipv4_address}"
Safely  Change/Iterate
• Plan  shows  you  what  will  happen  
• Save  plans  to  guarantee  what  will  happen  
• Plans  show  reasons  for  certain  ac'ons  (such  as  re-­‐create)  
• Prior  to  Terraform:  Operators  had  to  “divine”  change  ordering,  
paralleliza'on,  rollout  effect.
Workflow
• Make  code  changes  
• `terraform  plan`  
• Pull  request  with  code  changes  +  plan  to  make  changes  
• Review  and  merge  
• `terraform  apply  pr1234.pplan`
Knowledge  Sharing:  Modules
Terraform  Plan
module “consul” {
source = “github.com/hashicorp/consul/terraform/aws”
servers = 3
}
resource "dnsimple_record" "hello" {
domain = "example.com"
name = "test"
value = “${module.consul.server_address}”
type = "A"
}
Knowledge  Sharing:  Modules
Terraform  Plan
module “consul” {
source = “github.com/hashicorp/consul/terraform/aws”
servers = 3
}
resource "dnsimple_record" "hello" {
domain = "example.com"
name = "test"
value = “${module.consul.server_address}”
type = "A"
}
Knowledge  Sharing:  Remote  Modules
Terraform  Plan
resource “terraform_remote_state” “consul” {
type = “atlas”
name = “hashicorp/consul”
}
resource "dnsimple_record" "hello" {
domain = "example.com"
name = "test"
value = “${terraform_remote_state.consul.outputs.server_address}”
type = "A"
}
Knowledge  Sharing:  Modules
• Self-­‐contained  infrastructure  components  
• Allows  delega'on  of  responsibility  to  mul'ple  teams  
• Some  teams  create  modules,  other  teams  consume  modules  
• Remote  modules  let  teams  share  outputs,  but  not  affect  infrastructure
Terraform
• Zero  to  fully  deployed  in  one  command  
• Change/maintain  infrastructure  predictably  
• Teamwork-­‐oriented  workflow  to  infrastructure  
• Goal:  Sta'c  deploy/provisioning  of  infrastructure.  Real'me  monitoring,  
discovery,  configura'on  provided  by  Consul  (discussed  next).
consul.io
Service  discovery,  configura9on,  and  
orchestra9on  made  easy.  Distributed,  
highly  available,  and  datacenter-­‐aware.
Ques'ons  that  Consul  Answers
• Where  is  the  service  foo?  (ex.  Where  is  the  database?)  
• What  is  the  health  status  of  service  foo?  
• What  is  the  health  status  of  the  machine/node  foo?  
• What  is  the  list  of  all  currently  running  machines?  
• What  is  the  configura'on  of  service  foo?  
• Is  anyone  else  currently  performing  opera'on  foo?  
Service  Discovery  
Where  is  service  foo?
Service  Discovery
Service  Discovery  via  DNS  or  HTTP
$ dig web-frontend.service.consul. +short
10.0.3.89
10.0.1.46
$ curl http://localhost:8500/v1/catalog/service/web-frontend
[{
“Node”: “node-e818f1”,
“Address”: “10.0.3.89”,
“ServiceID”: “web-frontend”,
…
}]
Service  Discovery
• DNS  is  legacy-­‐friendly.  No  applica'on  changes  required.  
• HTTP  returns  rich  metadata.  
• Discover  both  internal  and  external  services  

(such  as  service  providers)
Failure  Detection  
Is  service  foo  healthy/available?
Failure  Detec'on
Failure  Detec'on
• DNS  won’t  return  non-­‐healthy  services  or  nodes.  
• HTTP  has  endpoints  to  list  health  state  of  catalog.
Key/Value  Storage  
What  is  the  config  of  service  foo?
Key/Value  Storage
Serng  and  Gerng  a  Key
$ curl –X PUT –d ‘bar’ http://localhost:8500/v1/kv/foo
true
$ curl http://localhost:8500/v1/kv/foo?raw
bar
Key/Value  Storage
• Highly  available  storage  of  configura'on.  
• Turn  knobs  without  big  configura'on  management  process.  
• Watch  keys  (long  poll)  for  changes  
• ACLs  on  key/value  to  protect  sensi've  informa'on
Multi-­‐Datacenter
Mul'-­‐Datacenter
Service  Discovery
$ dig web-frontend.singapore.service.consul. +short
10.3.3.33
10.3.1.18
$ dig web-frontend.germany.service.consul. +short
10.7.3.41
10.7.1.76
Mul'-­‐Datacenter
Serng  and  Gerng  a  Key
$ curl http://localhost:8500/v1/kv/foo?raw&dc=asia
true
$ curl http://localhost:8500/v1/kv/foo?raw&dc=eu
false
Mul'-­‐Datacenter
• Local  by  default  
• Can  query  other  datacenters  however  you  may  need  to  
• Can  view  all  datacenters  within  one  UI
Orchestration  
Events,  Exec,  Watches
Events,  Exec,  Watches
Dispatching  Custom  Events
$ consul event deploy 6DF7FE
…
$ consul watch -type event -name deploy /usr/bin/deploy.sh
…
$ consul exec -service web /usr/bin/deploy.sh
…
Events,  Exec,  Watches
• Powerful  orchestra'on  tools  
• Pros/cons  to  each  approach,  use  the  right  tool  for  the  job  
• All  approaches  proven  to  scale  to  thousands  of  agents
Easiest  Distributed  System  Deploy
Deploy  Consul  to  AWS
$ terraform apply github.com/hashicorp/consul/terraform/aws
var.servers
The number of Consul servers to launch.
Default: 3
Enter a value: 3
…
Easiest  Distributed  System  Deploy
Deploy  Consul  to  AWS  (manually)
$ consul agent -atlas-join 
-atlas=USERNAME/NAME 
-atlas-token=API_TOKEN
Workflow
• Server  is  started  (via  Terraform,  etc.)  
• Consul  agent  is  started,  joins  cluster  
• Star'ng  services  (ex.  web  app)  query  Consul  for  configura'on  
• Once  healthy,  services  are  discovered  via  DNS!
Opera'onal  Bullet  Points
• Leader  elec'on  via  Ra9  
• Gossip  protocol  for  aliveness  
• Three  consistency  models:  default,  consistent,  and  stale  
• Encryp'on,  ACLs  available  
• Real  world  usage  to  thousands  of  agents  per  datacenter
Thanks!
hashicorp.com

More Related Content

What's hot

Scaling Drupal in AWS Using AutoScaling, Cloudformation, RDS and more
Scaling Drupal in AWS Using AutoScaling, Cloudformation, RDS and moreScaling Drupal in AWS Using AutoScaling, Cloudformation, RDS and more
Scaling Drupal in AWS Using AutoScaling, Cloudformation, RDS and more
Dropsolid
 
Immutable Deployments with AWS CloudFormation and AWS Lambda
Immutable Deployments with AWS CloudFormation and AWS LambdaImmutable Deployments with AWS CloudFormation and AWS Lambda
Immutable Deployments with AWS CloudFormation and AWS Lambda
AOE
 
Why your Spark Job is Failing
Why your Spark Job is FailingWhy your Spark Job is Failing
Why your Spark Job is Failing
DataWorks Summit
 
Streamline Hadoop DevOps with Apache Ambari
Streamline Hadoop DevOps with Apache AmbariStreamline Hadoop DevOps with Apache Ambari
Streamline Hadoop DevOps with Apache Ambari
Alejandro Fernandez
 
Bosh 2.0
Bosh 2.0Bosh 2.0
Data Analytics Service Company and Its Ruby Usage
Data Analytics Service Company and Its Ruby UsageData Analytics Service Company and Its Ruby Usage
Data Analytics Service Company and Its Ruby Usage
SATOSHI TAGOMORI
 
Deep Dive - Infrastructure as Code
Deep Dive - Infrastructure as CodeDeep Dive - Infrastructure as Code
Deep Dive - Infrastructure as Code
Amazon Web Services
 
Just one-shade-of-openstack
Just one-shade-of-openstackJust one-shade-of-openstack
Just one-shade-of-openstack
Roberto Polli
 
Tuning Apache Ambari Performance for Big Data at Scale with 3,000 Agents
Tuning Apache Ambari Performance for Big Data at Scale with 3,000 AgentsTuning Apache Ambari Performance for Big Data at Scale with 3,000 Agents
Tuning Apache Ambari Performance for Big Data at Scale with 3,000 Agents
Alejandro Fernandez
 
Building your own slack bot on the AWS stack
Building your own slack bot on the AWS stackBuilding your own slack bot on the AWS stack
Building your own slack bot on the AWS stack
TorontoNodeJS
 
Orchestrating Docker with Terraform and Consul by Mitchell Hashimoto
Orchestrating Docker with Terraform and Consul by Mitchell Hashimoto Orchestrating Docker with Terraform and Consul by Mitchell Hashimoto
Orchestrating Docker with Terraform and Consul by Mitchell Hashimoto
Docker, Inc.
 
A deep dive into trove: Scale 13x Linux Expo 2/22/15
A deep dive into trove: Scale 13x Linux Expo 2/22/15A deep dive into trove: Scale 13x Linux Expo 2/22/15
A deep dive into trove: Scale 13x Linux Expo 2/22/15
Tesora
 
AWS May Webinar Series - Deep Dive: Infrastructure as Code
AWS May Webinar Series - Deep Dive: Infrastructure as CodeAWS May Webinar Series - Deep Dive: Infrastructure as Code
AWS May Webinar Series - Deep Dive: Infrastructure as Code
Amazon Web Services
 
AutoScaling and Drupal
AutoScaling and DrupalAutoScaling and Drupal
AutoScaling and Drupal
Promet Source
 
Why Your Apache Spark Job is Failing
Why Your Apache Spark Job is FailingWhy Your Apache Spark Job is Failing
Why Your Apache Spark Job is Failing
Cloudera, Inc.
 
Beginning hive and_apache_pig
Beginning hive and_apache_pigBeginning hive and_apache_pig
Beginning hive and_apache_pig
Mohamed Ali Mahmoud khouder
 
Deep Dive: Infrastructure as Code
Deep Dive: Infrastructure as CodeDeep Dive: Infrastructure as Code
Deep Dive: Infrastructure as Code
Amazon Web Services
 
Inside hadoop-dev
Inside hadoop-devInside hadoop-dev
Inside hadoop-dev
Steve Loughran
 
Configuring Your First Hadoop Cluster On EC2
Configuring Your First Hadoop Cluster On EC2Configuring Your First Hadoop Cluster On EC2
Configuring Your First Hadoop Cluster On EC2
benjaminwootton
 
Infrastructure-as-Code (IaC) using Terraform
Infrastructure-as-Code (IaC) using TerraformInfrastructure-as-Code (IaC) using Terraform
Infrastructure-as-Code (IaC) using Terraform
Adin Ermie
 

What's hot (20)

Scaling Drupal in AWS Using AutoScaling, Cloudformation, RDS and more
Scaling Drupal in AWS Using AutoScaling, Cloudformation, RDS and moreScaling Drupal in AWS Using AutoScaling, Cloudformation, RDS and more
Scaling Drupal in AWS Using AutoScaling, Cloudformation, RDS and more
 
Immutable Deployments with AWS CloudFormation and AWS Lambda
Immutable Deployments with AWS CloudFormation and AWS LambdaImmutable Deployments with AWS CloudFormation and AWS Lambda
Immutable Deployments with AWS CloudFormation and AWS Lambda
 
Why your Spark Job is Failing
Why your Spark Job is FailingWhy your Spark Job is Failing
Why your Spark Job is Failing
 
Streamline Hadoop DevOps with Apache Ambari
Streamline Hadoop DevOps with Apache AmbariStreamline Hadoop DevOps with Apache Ambari
Streamline Hadoop DevOps with Apache Ambari
 
Bosh 2.0
Bosh 2.0Bosh 2.0
Bosh 2.0
 
Data Analytics Service Company and Its Ruby Usage
Data Analytics Service Company and Its Ruby UsageData Analytics Service Company and Its Ruby Usage
Data Analytics Service Company and Its Ruby Usage
 
Deep Dive - Infrastructure as Code
Deep Dive - Infrastructure as CodeDeep Dive - Infrastructure as Code
Deep Dive - Infrastructure as Code
 
Just one-shade-of-openstack
Just one-shade-of-openstackJust one-shade-of-openstack
Just one-shade-of-openstack
 
Tuning Apache Ambari Performance for Big Data at Scale with 3,000 Agents
Tuning Apache Ambari Performance for Big Data at Scale with 3,000 AgentsTuning Apache Ambari Performance for Big Data at Scale with 3,000 Agents
Tuning Apache Ambari Performance for Big Data at Scale with 3,000 Agents
 
Building your own slack bot on the AWS stack
Building your own slack bot on the AWS stackBuilding your own slack bot on the AWS stack
Building your own slack bot on the AWS stack
 
Orchestrating Docker with Terraform and Consul by Mitchell Hashimoto
Orchestrating Docker with Terraform and Consul by Mitchell Hashimoto Orchestrating Docker with Terraform and Consul by Mitchell Hashimoto
Orchestrating Docker with Terraform and Consul by Mitchell Hashimoto
 
A deep dive into trove: Scale 13x Linux Expo 2/22/15
A deep dive into trove: Scale 13x Linux Expo 2/22/15A deep dive into trove: Scale 13x Linux Expo 2/22/15
A deep dive into trove: Scale 13x Linux Expo 2/22/15
 
AWS May Webinar Series - Deep Dive: Infrastructure as Code
AWS May Webinar Series - Deep Dive: Infrastructure as CodeAWS May Webinar Series - Deep Dive: Infrastructure as Code
AWS May Webinar Series - Deep Dive: Infrastructure as Code
 
AutoScaling and Drupal
AutoScaling and DrupalAutoScaling and Drupal
AutoScaling and Drupal
 
Why Your Apache Spark Job is Failing
Why Your Apache Spark Job is FailingWhy Your Apache Spark Job is Failing
Why Your Apache Spark Job is Failing
 
Beginning hive and_apache_pig
Beginning hive and_apache_pigBeginning hive and_apache_pig
Beginning hive and_apache_pig
 
Deep Dive: Infrastructure as Code
Deep Dive: Infrastructure as CodeDeep Dive: Infrastructure as Code
Deep Dive: Infrastructure as Code
 
Inside hadoop-dev
Inside hadoop-devInside hadoop-dev
Inside hadoop-dev
 
Configuring Your First Hadoop Cluster On EC2
Configuring Your First Hadoop Cluster On EC2Configuring Your First Hadoop Cluster On EC2
Configuring Your First Hadoop Cluster On EC2
 
Infrastructure-as-Code (IaC) using Terraform
Infrastructure-as-Code (IaC) using TerraformInfrastructure-as-Code (IaC) using Terraform
Infrastructure-as-Code (IaC) using Terraform
 

Similar to OSDC 2015: Mitchell Hashimoto | Automating the Modern Datacenter, Development to Production

TIAD : Automating the modern datacenter
TIAD : Automating the modern datacenterTIAD : Automating the modern datacenter
TIAD : Automating the modern datacenter
The Incredible Automation Day
 
London HUG 12/4
London HUG 12/4London HUG 12/4
Aprovisionamiento multi-proveedor con Terraform - Plain Concepts DevOps day
Aprovisionamiento multi-proveedor con Terraform  - Plain Concepts DevOps dayAprovisionamiento multi-proveedor con Terraform  - Plain Concepts DevOps day
Aprovisionamiento multi-proveedor con Terraform - Plain Concepts DevOps day
Plain Concepts
 
Atmosphere Conference 2015: Taming the Modern Datacenter
Atmosphere Conference 2015: Taming the Modern DatacenterAtmosphere Conference 2015: Taming the Modern Datacenter
Atmosphere Conference 2015: Taming the Modern Datacenter
PROIDEA
 
Infrastructure-as-code: bridging the gap between Devs and Ops
Infrastructure-as-code: bridging the gap between Devs and OpsInfrastructure-as-code: bridging the gap between Devs and Ops
Infrastructure-as-code: bridging the gap between Devs and Ops
Mykyta Protsenko
 
Declarative & workflow based infrastructure with Terraform
Declarative & workflow based infrastructure with TerraformDeclarative & workflow based infrastructure with Terraform
Declarative & workflow based infrastructure with Terraform
Radek Simko
 
Infrastructure as code, using Terraform
Infrastructure as code, using TerraformInfrastructure as code, using Terraform
Infrastructure as code, using Terraform
Harkamal Singh
 
Managing Infrastructure as Code
Managing Infrastructure as CodeManaging Infrastructure as Code
Managing Infrastructure as Code
Allan Shone
 
Puppetpreso
PuppetpresoPuppetpreso
Puppetpresoke4qqq
 
Burn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesBurn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websites
Lindsay Holmwood
 
Declarative Infrastructure Tools
Declarative Infrastructure Tools Declarative Infrastructure Tools
Declarative Infrastructure Tools
Yulia Shcherbachova
 
Terraform in deployment pipeline
Terraform in deployment pipelineTerraform in deployment pipeline
Terraform in deployment pipeline
Anton Babenko
 
DevOps Enabling Your Team
DevOps Enabling Your TeamDevOps Enabling Your Team
DevOps Enabling Your Team
GR8Conf
 
Reusable, composable, battle-tested Terraform modules
Reusable, composable, battle-tested Terraform modulesReusable, composable, battle-tested Terraform modules
Reusable, composable, battle-tested Terraform modules
Yevgeniy Brikman
 
Puppet and Apache CloudStack
Puppet and Apache CloudStackPuppet and Apache CloudStack
Puppet and Apache CloudStack
Puppet
 
Infrastructure as code with Puppet and Apache CloudStack
Infrastructure as code with Puppet and Apache CloudStackInfrastructure as code with Puppet and Apache CloudStack
Infrastructure as code with Puppet and Apache CloudStackke4qqq
 
Automating your Infrastructure Deployment with AWS CloudFormation and AWS Ops...
Automating your Infrastructure Deployment with AWS CloudFormation and AWS Ops...Automating your Infrastructure Deployment with AWS CloudFormation and AWS Ops...
Automating your Infrastructure Deployment with AWS CloudFormation and AWS Ops...
Amazon Web Services
 
Cutting through the fog of cloud
Cutting through the fog of cloudCutting through the fog of cloud
Cutting through the fog of cloud
Kyle Rames
 
OpenStack Horizon: Controlling the Cloud using Django
OpenStack Horizon: Controlling the Cloud using DjangoOpenStack Horizon: Controlling the Cloud using Django
OpenStack Horizon: Controlling the Cloud using Django
David Lapsley
 
Dive into DevOps | March, Building with Terraform, Volodymyr Tsap
Dive into DevOps | March, Building with Terraform, Volodymyr TsapDive into DevOps | March, Building with Terraform, Volodymyr Tsap
Dive into DevOps | March, Building with Terraform, Volodymyr Tsap
Provectus
 

Similar to OSDC 2015: Mitchell Hashimoto | Automating the Modern Datacenter, Development to Production (20)

TIAD : Automating the modern datacenter
TIAD : Automating the modern datacenterTIAD : Automating the modern datacenter
TIAD : Automating the modern datacenter
 
London HUG 12/4
London HUG 12/4London HUG 12/4
London HUG 12/4
 
Aprovisionamiento multi-proveedor con Terraform - Plain Concepts DevOps day
Aprovisionamiento multi-proveedor con Terraform  - Plain Concepts DevOps dayAprovisionamiento multi-proveedor con Terraform  - Plain Concepts DevOps day
Aprovisionamiento multi-proveedor con Terraform - Plain Concepts DevOps day
 
Atmosphere Conference 2015: Taming the Modern Datacenter
Atmosphere Conference 2015: Taming the Modern DatacenterAtmosphere Conference 2015: Taming the Modern Datacenter
Atmosphere Conference 2015: Taming the Modern Datacenter
 
Infrastructure-as-code: bridging the gap between Devs and Ops
Infrastructure-as-code: bridging the gap between Devs and OpsInfrastructure-as-code: bridging the gap between Devs and Ops
Infrastructure-as-code: bridging the gap between Devs and Ops
 
Declarative & workflow based infrastructure with Terraform
Declarative & workflow based infrastructure with TerraformDeclarative & workflow based infrastructure with Terraform
Declarative & workflow based infrastructure with Terraform
 
Infrastructure as code, using Terraform
Infrastructure as code, using TerraformInfrastructure as code, using Terraform
Infrastructure as code, using Terraform
 
Managing Infrastructure as Code
Managing Infrastructure as CodeManaging Infrastructure as Code
Managing Infrastructure as Code
 
Puppetpreso
PuppetpresoPuppetpreso
Puppetpreso
 
Burn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesBurn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websites
 
Declarative Infrastructure Tools
Declarative Infrastructure Tools Declarative Infrastructure Tools
Declarative Infrastructure Tools
 
Terraform in deployment pipeline
Terraform in deployment pipelineTerraform in deployment pipeline
Terraform in deployment pipeline
 
DevOps Enabling Your Team
DevOps Enabling Your TeamDevOps Enabling Your Team
DevOps Enabling Your Team
 
Reusable, composable, battle-tested Terraform modules
Reusable, composable, battle-tested Terraform modulesReusable, composable, battle-tested Terraform modules
Reusable, composable, battle-tested Terraform modules
 
Puppet and Apache CloudStack
Puppet and Apache CloudStackPuppet and Apache CloudStack
Puppet and Apache CloudStack
 
Infrastructure as code with Puppet and Apache CloudStack
Infrastructure as code with Puppet and Apache CloudStackInfrastructure as code with Puppet and Apache CloudStack
Infrastructure as code with Puppet and Apache CloudStack
 
Automating your Infrastructure Deployment with AWS CloudFormation and AWS Ops...
Automating your Infrastructure Deployment with AWS CloudFormation and AWS Ops...Automating your Infrastructure Deployment with AWS CloudFormation and AWS Ops...
Automating your Infrastructure Deployment with AWS CloudFormation and AWS Ops...
 
Cutting through the fog of cloud
Cutting through the fog of cloudCutting through the fog of cloud
Cutting through the fog of cloud
 
OpenStack Horizon: Controlling the Cloud using Django
OpenStack Horizon: Controlling the Cloud using DjangoOpenStack Horizon: Controlling the Cloud using Django
OpenStack Horizon: Controlling the Cloud using Django
 
Dive into DevOps | March, Building with Terraform, Volodymyr Tsap
Dive into DevOps | March, Building with Terraform, Volodymyr TsapDive into DevOps | March, Building with Terraform, Volodymyr Tsap
Dive into DevOps | March, Building with Terraform, Volodymyr Tsap
 

Recently uploaded

From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 

Recently uploaded (20)

From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 

OSDC 2015: Mitchell Hashimoto | Automating the Modern Datacenter, Development to Production

  • 1. Automa'ng  the     Modern  Datacenter
  • 3. Powering  the  so9ware-­‐managed  datacenter. HashiCorp hashicorp.com
  • 4.
  • 5.
  • 11. Service  Prolifera'on Datacenter Server Server Server Server Server Server Server Server Server DNS Database CDN
  • 12. Etc… • Hybrid  cloud:  Physical  datacenter  vs.  Cloud  provider   • Mul'-­‐paradigm:  Physical,  virtual,  container   • IaaS,  PaaS,  SaaS  depending  on  the  app   • Opera'ng  systems:  Windows,  Linux,  Mac,  Other   • Realis'cally  a  mixture  of  everything  just  shown
  • 14. Common  Goal:  Efficiently  deliver  and   maintain  applica9ons.
  • 15. Applica'on  Delivery • Consistent   • Shareable   • Readily  Available   • High  producCon  
 parity. • Start  and  configure   servers  /  services   • Deploy  and  run   applicaCon • Update  servers  or   applicaCons   • Reconfigure,  feature   flag   • Monitor  health   • Orchestrate   complex  changes Development Deployment Maintenance
  • 16. HashiCorp’s  Open  Source  Tools Development Deployment Maintenance
  • 18. Deployment  +  Maintenance 1. Acquisi'on   2. Provision   3. Update   4. Destroy
  • 19. Historically • Servers:  Days,  weeks   • Provisioning:  Hours,  days   • SaaS:  <didn’t  exist>
  • 20. Today • Servers:  Minutes   • Provisioning:  Minutes   • SaaS:  Minutes
  • 21. Historically • Rela'vely  fixed  set  of  servers   • Fewer  applica'ons  to  deploy   • Fewer  SaaS   • Less  demanding  web  traffic
  • 22. Today • Poten'ally  elas'c  set  of  servers  of  varying  sizes   • Push  towards  SoA   • SaaS  for  everything   • More  internet  connected  devices  than  ever  before  =>  higher  traffic  
  • 23. What  do  we  need? • Zero  to  deployed  in  one  command   • Resiliency  through  distributed  systems   • Autoscaling,  autohealing   • Beder  teamwork  through  codified  knowledge
  • 25. HashiCorp’s  Open  Source  Tools Development Deployment Maintenance
  • 28. Build,  combine,  and  launch   infrastructure  safely  and  efficiently. terraform.io
  • 29. What  If  I  asked  you  to…   • create  a  completely  isolated  second  environment  to  run  an  applica'on   (staging,  QA,  dev,  etc.)?   • deploy  a  complex  new  applica'on?     • update  an  exis'ng  complex  applica'on?     • document  how  our  infrastructure  is  architected?     • delegate  some  ops  to  smaller  teams?  (Core  IT  vs.  App  IT)
  • 30. What  If  I  asked  you  to…   • create  a  completely  isolated  second  environment  to  run  an  applica'on   (staging,  QA,  dev,  etc.)?  One  command.   • deploy  a  complex  new  applica'on?  Code  it,  diff  it,  pull  request.   • update  an  exis'ng  complex  applica'on?  Code  it,  diff  it,  pull  request.   • document  how  our  infrastructure  is  architected?  Read  the  code.   • delegate  some  ops  to  smaller  teams?  (Core  IT  vs.  App  IT)  Modules,   code  reviews.
  • 32. Terraform • Create  infrastructure  with  code:  servers,  load  balancers,  databases,  email   providers,  etc.     • One  command  to  create,  update  infrastructure.   • Preview  changes  to  infrastructure,  save  diffs.     • Use  code  +  diffs  to  treat  infrastructure  change  just  like  code  change:   make  a  pull  request,  show  the  differences,  review  it,  and  accept.     • Break  infrastructure  into  modules  to  encourage/allow  teamwork  without   risking  stability.  
  • 33. Infrastructure  as  Code DigitalOcean  Droplet  with  DNS  in  DNSimple resource "digitalocean_droplet" "web" { name = "tf-web" size = "512mb" image = "centos-5-8-x32" region = "sfo1" } resource "dnsimple_record" "hello" { domain = "example.com" name = "test" value = "${digitalocean_droplet.web.ipv4_address}" type = "A" }
  • 34. Infrastructure  as  Code DigitalOcean  Droplet  with  DNS  in  DNSimple resource "digitalocean_droplet" "web" { name = "tf-web" size = "512mb" image = "centos-5-8-x32" region = "sfo1" } resource "dnsimple_record" "hello" { domain = "example.com" name = "test" value = "${digitalocean_droplet.web.ipv4_address}" type = "A" }
  • 35. Infrastructure  as  Code DigitalOcean  Droplet  with  DNS  in  DNSimple resource "digitalocean_droplet" "web" { name = "tf-web" size = "512mb" image = "centos-5-8-x32" region = "sfo1" } resource "dnsimple_record" "hello" { domain = "example.com" name = "test" value = "${digitalocean_droplet.web.ipv4_address}" type = "A" }
  • 36. Infrastructure  as  Code DigitalOcean  Droplet  with  DNS  in  DNSimple resource "digitalocean_droplet" "web" { name = "tf-web" size = "512mb" image = "centos-5-8-x32" region = "sfo1" } resource "dnsimple_record" "hello" { domain = "example.com" name = "test" value = "${digitalocean_droplet.web.ipv4_address}" type = "A" }
  • 37. Infrastructure  as  Code • Human  friendly  config,  JSON  compa'ble   • Text  format  makes  it  version-­‐able,  VCS-­‐friendly   • Declara've   • Infrastructure  as  code  on  a  level  not  before  possible
  • 38. Zero  to  Done  in  One  Command Terraform  Apply $ terraform apply digitalocean_droplet.web: Creating… dnsimple_record.hello: Creating… Apply complete! Resources: 2 added, 0 changed, 0 destroyed.
  • 39. Zero  to  Done  in  One  Command • Idempotent   • Highly  parallelized   • Will  only  do  what  the  plan  says
  • 40. Safely  Change/Iterate Terraform  Plan + digitalocean_droplet.web backups: "" => "<computed>" image: "" => "centos-5-8-x32" ipv4_address: "" => "<computed>" ipv4_address_private: "" => "<computed>" name: "" => "tf-web" private_networking: "" => "<computed>" region: "" => "sfo1" size: "" => "512mb" status: "" => "<computed>" + dnsimple_record.hello domain: "" => "example.com" domain_id: "" => "<computed>" hostname: "" => "<computed>" name: "" => "test" priority: "" => "<computed>" ttl: "" => "<computed>" type: "" => "A" value: "" => "${digitalocean_droplet.web.ipv4_address}"
  • 41. Safely  Change/Iterate Terraform  Plan + digitalocean_droplet.web backups: "" => "<computed>" image: "" => "centos-5-8-x32" ipv4_address: "" => "<computed>" ipv4_address_private: "" => "<computed>" name: "" => "tf-web" private_networking: "" => "<computed>" region: "" => "sfo1" size: "" => "512mb" status: "" => "<computed>" + dnsimple_record.hello domain: "" => "example.com" domain_id: "" => "<computed>" hostname: "" => "<computed>" name: "" => "test" priority: "" => "<computed>" ttl: "" => "<computed>" type: "" => "A" value: "" => "${digitalocean_droplet.web.ipv4_address}"
  • 42. Safely  Change/Iterate Terraform  Plan + digitalocean_droplet.web backups: "" => "<computed>" image: "" => "centos-5-8-x32" ipv4_address: "" => "<computed>" ipv4_address_private: "" => "<computed>" name: "" => "tf-web" private_networking: "" => "<computed>" region: "" => "sfo1" size: "" => "512mb" status: "" => "<computed>" + dnsimple_record.hello domain: "" => "example.com" domain_id: "" => "<computed>" hostname: "" => "<computed>" name: "" => "test" priority: "" => "<computed>" ttl: "" => "<computed>" type: "" => "A" value: "" => "${digitalocean_droplet.web.ipv4_address}"
  • 43. Safely  Change/Iterate • Plan  shows  you  what  will  happen   • Save  plans  to  guarantee  what  will  happen   • Plans  show  reasons  for  certain  ac'ons  (such  as  re-­‐create)   • Prior  to  Terraform:  Operators  had  to  “divine”  change  ordering,   paralleliza'on,  rollout  effect.
  • 44. Workflow • Make  code  changes   • `terraform  plan`   • Pull  request  with  code  changes  +  plan  to  make  changes   • Review  and  merge   • `terraform  apply  pr1234.pplan`
  • 45. Knowledge  Sharing:  Modules Terraform  Plan module “consul” { source = “github.com/hashicorp/consul/terraform/aws” servers = 3 } resource "dnsimple_record" "hello" { domain = "example.com" name = "test" value = “${module.consul.server_address}” type = "A" }
  • 46. Knowledge  Sharing:  Modules Terraform  Plan module “consul” { source = “github.com/hashicorp/consul/terraform/aws” servers = 3 } resource "dnsimple_record" "hello" { domain = "example.com" name = "test" value = “${module.consul.server_address}” type = "A" }
  • 47. Knowledge  Sharing:  Remote  Modules Terraform  Plan resource “terraform_remote_state” “consul” { type = “atlas” name = “hashicorp/consul” } resource "dnsimple_record" "hello" { domain = "example.com" name = "test" value = “${terraform_remote_state.consul.outputs.server_address}” type = "A" }
  • 48. Knowledge  Sharing:  Modules • Self-­‐contained  infrastructure  components   • Allows  delega'on  of  responsibility  to  mul'ple  teams   • Some  teams  create  modules,  other  teams  consume  modules   • Remote  modules  let  teams  share  outputs,  but  not  affect  infrastructure
  • 49. Terraform • Zero  to  fully  deployed  in  one  command   • Change/maintain  infrastructure  predictably   • Teamwork-­‐oriented  workflow  to  infrastructure   • Goal:  Sta'c  deploy/provisioning  of  infrastructure.  Real'me  monitoring,   discovery,  configura'on  provided  by  Consul  (discussed  next).
  • 51. Service  discovery,  configura9on,  and   orchestra9on  made  easy.  Distributed,   highly  available,  and  datacenter-­‐aware.
  • 52. Ques'ons  that  Consul  Answers • Where  is  the  service  foo?  (ex.  Where  is  the  database?)   • What  is  the  health  status  of  service  foo?   • What  is  the  health  status  of  the  machine/node  foo?   • What  is  the  list  of  all  currently  running  machines?   • What  is  the  configura'on  of  service  foo?   • Is  anyone  else  currently  performing  opera'on  foo?  
  • 53. Service  Discovery   Where  is  service  foo?
  • 54. Service  Discovery Service  Discovery  via  DNS  or  HTTP $ dig web-frontend.service.consul. +short 10.0.3.89 10.0.1.46 $ curl http://localhost:8500/v1/catalog/service/web-frontend [{ “Node”: “node-e818f1”, “Address”: “10.0.3.89”, “ServiceID”: “web-frontend”, … }]
  • 55. Service  Discovery • DNS  is  legacy-­‐friendly.  No  applica'on  changes  required.   • HTTP  returns  rich  metadata.   • Discover  both  internal  and  external  services  
 (such  as  service  providers)
  • 56. Failure  Detection   Is  service  foo  healthy/available?
  • 58. Failure  Detec'on • DNS  won’t  return  non-­‐healthy  services  or  nodes.   • HTTP  has  endpoints  to  list  health  state  of  catalog.
  • 59. Key/Value  Storage   What  is  the  config  of  service  foo?
  • 60. Key/Value  Storage Serng  and  Gerng  a  Key $ curl –X PUT –d ‘bar’ http://localhost:8500/v1/kv/foo true $ curl http://localhost:8500/v1/kv/foo?raw bar
  • 61. Key/Value  Storage • Highly  available  storage  of  configura'on.   • Turn  knobs  without  big  configura'on  management  process.   • Watch  keys  (long  poll)  for  changes   • ACLs  on  key/value  to  protect  sensi've  informa'on
  • 63. Mul'-­‐Datacenter Service  Discovery $ dig web-frontend.singapore.service.consul. +short 10.3.3.33 10.3.1.18 $ dig web-frontend.germany.service.consul. +short 10.7.3.41 10.7.1.76
  • 64. Mul'-­‐Datacenter Serng  and  Gerng  a  Key $ curl http://localhost:8500/v1/kv/foo?raw&dc=asia true $ curl http://localhost:8500/v1/kv/foo?raw&dc=eu false
  • 65. Mul'-­‐Datacenter • Local  by  default   • Can  query  other  datacenters  however  you  may  need  to   • Can  view  all  datacenters  within  one  UI
  • 67. Events,  Exec,  Watches Dispatching  Custom  Events $ consul event deploy 6DF7FE … $ consul watch -type event -name deploy /usr/bin/deploy.sh … $ consul exec -service web /usr/bin/deploy.sh …
  • 68. Events,  Exec,  Watches • Powerful  orchestra'on  tools   • Pros/cons  to  each  approach,  use  the  right  tool  for  the  job   • All  approaches  proven  to  scale  to  thousands  of  agents
  • 69. Easiest  Distributed  System  Deploy Deploy  Consul  to  AWS $ terraform apply github.com/hashicorp/consul/terraform/aws var.servers The number of Consul servers to launch. Default: 3 Enter a value: 3 …
  • 70. Easiest  Distributed  System  Deploy Deploy  Consul  to  AWS  (manually) $ consul agent -atlas-join -atlas=USERNAME/NAME -atlas-token=API_TOKEN
  • 71. Workflow • Server  is  started  (via  Terraform,  etc.)   • Consul  agent  is  started,  joins  cluster   • Star'ng  services  (ex.  web  app)  query  Consul  for  configura'on   • Once  healthy,  services  are  discovered  via  DNS!
  • 72. Opera'onal  Bullet  Points • Leader  elec'on  via  Ra9   • Gossip  protocol  for  aliveness   • Three  consistency  models:  default,  consistent,  and  stale   • Encryp'on,  ACLs  available   • Real  world  usage  to  thousands  of  agents  per  datacenter