Planning Application Resilience - Developer Week 2015
-
Upload
jennifer-davis -
Category
Technology
-
view
119 -
download
1
Transcript of Planning Application Resilience - Developer Week 2015
Goal: Communication
Jennifer Davis Solutions Engineer Twitter: @sigje Hashtag: #getchef Email: [email protected]
Goal: Communication
Jennifer Davis Solutions Engineer Twitter: @sigje Hashtag: #getchef Email: [email protected]
Hang out with me at the Chef Booth, talk Infrastructure and recharge!
Resilience
• Elasticity – Spring back into shape • Recoverability – Quick to recover/rebuild • Malleability – Ease of change
Enduring Resilience
Resilient Organization
• Conway’s law
Organizations which design systems … are constrained to produce designs which are copies of the communication structures of these organizations.
Not Resilient: Minimized Change
• Security Patches? • Over Engineering Delays in Schedule • Under Engineering – Rewrite required to scale
Stability is a myth.
Automation Platform
• Complex dependency handling between nodes. • Fault tolerance. • Security. • Multi-Platform. • Flexibility.
Chef is a language.
• Describe infrastructure as code. • Programmatically provision and
configure servers. • Versioning, artifacts
chef is a command line utility
• Generate skeleton for application, cookbook, recipes, attributes, files, templates, and custom resources.
• Prep environment with correct ruby gems. • Verifies environment is configured and installed correctly.
Chef is a community.
• Mailing lists • https://supermarket.chef.io/ • Chef Conf 3/31 – 4/2 Santa Clara • Chef Summit • IRC #chef
Chef Fundamentals … in 5 minutes
https://www.chef.io/training/ March 5-6 SEKRET CODE 10% off:
HELLO-CHEF
Infrastructure Automation is creating control systems that reduce the burden on people to manage services and increase the quality, accuracy and precision of a service to the consumers of the service.
Resources
• Fundamental building blocks • Describes piece of system and it’s desired state • Chef DSL is ruby.
Example of describing a resource
Recipe: (chef-apply cookbook)::(chef-apply recipe) * package[nano] action install - install version 2.0.9-7.el6 of package nano
sudo chef-apply -e "package 'nano'"
Test and Repair Resources follow a test and repair model
• package ”nano"
Is nano installed?
Done Install it
Yes No
Recipe
package “httpd”
template “/var/www/html/index.html” do
source “index.html.erb”
end
service “httpd” do
action [:enable, :start]
end
Cookbook
• A collection of recipes (and other elements like files and templates). • Map 1-1 to a piece of software or functionality. • Distribution unit • Versioned • Modular and re-usable.
Chef Provisioning – Part of Chef DK
https://flic.kr/p/knDPjc
• Describe multiple tier applications. • Deploy many copies of your
application cluster. • Spread cluster across different clouds/
machines. • Orchestrate deployment. • Parallelize machine deployment.
Multi-platform
• AWS • Azure • Fog • Vagrant • Docker • LXC • .. more
.. We’ll use AWS in this example https://github.com/chef/chef-provisioning-aws
http://aws.amazon.com/start-ups/loft/
AWS
• SQS Queues • SNS Topics • Elastic Load Balancers • VPCs • Security Groups • Instances • Images • Autoscaling Groups • SSH Key pairs • Launch configs
AWS Config: ~/.aws/config
[default] region=us-‐west-‐2 aws_access_key_id = aws_secret_access_key =
Edit Provision Recipe
require “chef/provisioning/aws_driver” with_driver “aws”
machine ‘web1’ do
recipe ‘webserver’
converge true
end
..but I need multiple webservers
require “chef/provisioning/aws_driver” with_driver “aws”
num_webservers = 3
(0… num_webservers).each do |i|
machine “web_0#{i}” do
recipe ‘apache’
end
end
…add security
aws_security_group "#{name}-http" do inbound_rules [{:ports => 80, :protocol => :tcp, :sources => ['0.0.0.0/0']}]
end
…add security
with_machine_options({ :bootstrap_options => {
:security_groups => [ "#{name}-‐http”] } })
..add load balancing
load_balancer "#{name}-‐webserver-‐lb" do load_balancer_options({ :availability_zones => ["us-‐west-‐2a", "us-‐west-‐2b", “us-‐west-‐2c"], :listeners => [{:port => 80, :protocol => :http, :instance_port => 80, :instance_protocol => :http }], :security_group_name => “#{name}-‐http” }) machines elb_instances end
Bulkhead Pattern
• Compartmentalization to limit failure. • Repeatable Clusters • … across platforms.
Review
• Resilience • Organizational – Conway’s Law • Software
• Introduction to Chef • Fundamentals, Infrastructure as Code, Chef Provisioning
• Striving for Resilience with Chef • Examples Chef Provisioning
Jumpstart Learning
• The LearnChef Site • Guided Tutorials • Chef Fundamentals intro
http://learnchef.com • How-To’s, Conference Talks, Webinars, more
http://youtube.com/user/getchef • Attend a Chef Fundamentals Class (HELLO-CHEF code)
Further Resources
• http://chef.io • http://docs.chef.io • http://supermarket.chef.io • http://lists.opscode.com • irc.freenode.net #chef • Twitter @chef #getchef, @learnchef #learnchef