Share
Embed
Hackademy Devops
Fast intro to Devops culture, tools and understanding for the students of http://hackademy.500tech.com/.
ProdOps
November 08, 2013
Transcript
54 slides
-
Infrastructure in the Cloud IaaS vs. PaaS Chef very short
WTF is … Devops -
Hi! I am Peter, a developer. ... devops heroes ...
devops heroes -
I like writing code design patterns the Integrated Development Environment
aka. IDE I like less... reading manual pages troubleshooting servers configuration files lifting heavy things managing services and packages software deployments ... devops heroes -
” “ things developers say ... I don't do system
related tasks, especially not in production. - Developer can someone else do it this time please? pretty please? -
” “ more things developers say ... - The same
Developer Give me full control, or else when things go wrong, I am powerless to fix it. Just changed motorcycle wheels. I’ll jump anyway, it will be okay ... -
I finished writing the code! Server room Servers Racks Labor
Electricity & AC Configuration Deployment $150,000,000 + 16 months When can our customers start paying? Oh, we probably need a couple more things ... Oh, oh, and I almost forgot. Ahh, I'm also gonna need you to go ahead and come in on Sunday, too... ... devops heroes -
Houston we have a problem. TPS report not found. ...
devops heroes -
use the Cloud the what? who are you? I'm Joana,
... the fairy godmother, ... ahh, never mind me. Just use the Cloud Luke, err.. Peter. ... devops heroes -
flickr.com/photos/21644167@N04/3897234326/ The Cloud rapid provision api pay per use self
maintained resilient & distributed diverse -
Cloud Jargon ... as a service IaaS Infrastructure PaaS Platform
SaaS Software ... the cloud -
IaaS vs. PaaS complex painful do it yourself total freedom
total freedom cheaper better performance simple comfortable someone else "did it" constraints conventions expensive so-so performance ... the cloud -
What would you choose? IaaS PaaS lets see examples ...
... the cloud -
Microsoft IaaS vs. PaaS Microsoft Windows Azure "Virtual Machines" Microsoft
Windows Azure "Web Sites" everything works git push to deploy infrastructure pain custom deploys has ActiveDirectory! windowsazure.com ... the cloud -
Google IaaS vs. PaaS Google "Compute Engine" Google "App Engine"
custom APIs lots of limitations lots of abilities includes: Java, Go, PHP, Python and much much more... no longer beta! Google I/O release per-minute billing cloud.google.com ... the cloud -
less control more comfort Amazon AWS IaaS vs. PaaS AWS
EC2 AWS BeanStalk almost full control no comfort aws.amazon.com AWS OpsWorks AWS CloudFormation ... the cloud -
git push deploy lots of magic easy scalability many partners
expensive poor performance IaaS vs. PaaS Salesforce Heroku heroku.com I dont like "magic", give me more control! You say its slow and expensive? ... no no, it will not do. ... the cloud -
I can't deploy to a "platform" We will use servers
in the Cloud! Just tell me when customers start paying! ... devops heroes -
what someone has to actually do to use Servers in
the (AWS) Cloud - For each world region - Define architecture (app+db+cache+stuff) - Select instance types and OS images (AMI) - Proper security groups (firewalls) - Generate SSH keys - Install packages - Configure services - Deploy application - Have a nervous breakdown - Repeat from start for each server - Profit! -
That is a lot of work. So many things can
go wrong ... ... devops heroes -
How do I do the same thing a hundred times
without making mistakes? Chef, or Puppet, or CFEngine, or ... so many options. ... devops heroes -
Automation infoq.com/presentations/Infrastructure-as-Code #!/bin/sh NODES="webserver database" for n in $NODES do
ssh $n complex-script.sh done -
redis cookbook cookbooks/redis/recipes/default.rb package "redis-server" do action :upgrade end service
"redis-server" do action :nothing supports status: true, restart: true end template "/etc/redis/redis.conf" do source "redis.conf.erb" owner "root" mode "0644" variables({ bind: node[:redis][:bind] }) notifies :restart, "service[redis-server]" end 1. cookbook/redis/attributes/default.rb 2. solo.json ... chef -
cookbooks/redis/attributes/default.rb default[:redis][:bind] = "127.0.0.1" cookbooks/redis/templates/default/redis.conf.erb # If you want you
can bind a single interface, if the bind option is not # specified all the interfaces will listen for incoming connections. bind <%= @bind %> ... template "/etc/redis/redis.conf" do ... variables({ bind: node[:redis][:bind] }) end redis cookbook ... chef -
running chef-solo $ chef-solo -c solo.rb -j solo.json ... solo.rb
cookbook_path "cookbooks" solo.json { "run_list": "recipe[redis]" } ... chef -
$ sudo chef-solo -c solo.rb -j solo.json Starting Chef Client,
version 11.4.0 Compiling Cookbooks... Converging 3 resources Recipe: redis::default * package[redis-server] action upgrade - upgrade package redis-server from uninstalled to 2:2.2.12-1build1 * service[redis-server] action nothing (up to date) * template[/etc/redis/redis.conf] action create (up to date) Chef Client finished, 1 resources updated First run installs redis, creates configuration file. ... chef -
Second time, everything is already up to date. Idempotency! ƒ[ƒ(x)]
≡ ƒ(x) $ sudo chef-solo -c solo.rb -j solo.json Starting Chef Client, version 11.4.0 Compiling Cookbooks... Converging 3 resources Recipe: redis::default * package[redis-server] action upgrade (up to date) * service[redis-server] action nothing (up to date) * template[/etc/redis/redis.conf] action create (up to date) Chef Client finished, 0 resources updated ... chef -
making a small change to JSON parameters passed to Chef
run. running chef-solo solo.json { "redis": { "bind": "0.0.0.0" }, "run_list": "recipe[redis]" } ... chef -
$ sudo chef-solo -c solo.rb -j solo.json Starting Chef Client,
version 11.4.0 Compiling Cookbooks... Converging 3 resources Recipe: redis::default * package[redis-server] action upgrade (up to date) * service[redis-server] action nothing (up to date) * template[/etc/redis/redis.conf] action create - update template[/etc/redis/redis.conf] from 81b4f1 to 8a6cec --- /etc/redis/redis.conf 2011-07-27 17:26:50.000000000 +0000 +++ /tmp/chef-rendered-template20130406-2537-f8vlv6 2013-04-06 ... @@ -27,7 +27,7 @@ # If you want you can bind a single interface, if the bind option is not # specified all the interfaces will listen for incoming connections. # -bind 127.0.0.1 +bind 0.0.0.0 # Specify the path for the unix socket that will be used to listen for # incoming connections. There is no default, so Redis will not listen * service[redis-server] action restart - restart service service[redis-server] Chef Client finished, 2 resources updated ... chef -
A single server is just not enough … how do
I scale? I have some pretty graphs for you ... ... devops heroes -
CAMS Culture Automation Measurement Sharing wtf is ... devops opscode.com/blog/2010/07/16/what-devops-means-to-me/
by John Willis @botchagalupe -
◦ Interactions over processes and tools. ◦ Continuous delivery of
value. ◦ Welcome changing requirements. ◦ Provide an environment for motivated individuals to succeed. Culture wtf is ... devops parts from agilemanifesto.org -
“Between 12:00 AM and 11:59 PM on April 25, 2013,
Quora released new versions of the site 46 times. This was a normal day for us.” - Quora engineering.quora.com/Continuous-Deployment-at-Quora “Deployment every 11.6s, 1,079 max in one hour. 10,000 mean number of hosts per deployment, with 30,000 maximum” - Amazon. com youtube.com/watch?v=PW1lhU8n5So “On the Google Consumer Surveys team, 8 minutes after you commit code it's live in production.” - Google developers.google.com/live/shows/772717729 “10+ deploys per day.” - John Allspaw, 2009 youtube.com/watch?v=LdOe18KhtT4 wtf is ... devops -
• Minimize required manual work. • Simplicity is essential. •
Working software over comprehensive documentation. • Easiest thing to solve, often neglected. Automation wtf is ... devops -
◦ Measure everything as often as possible. ◦ Metrics of
performance, process and people. ◦ Unprecedented real-time visibility. ◦ Enable continuous improvement. (Kaizen) Measurement wtf is ... devops -
“... we also track really important stuff, like how much
coffee is left in the kitchen” - Etsy codeascraft.com/2011/02/15/measure-anything-measure-everything end of 2009 end of 2012 Etsy.com : Deploys per day Measure Everything wtf is ... devops -
Why do it? fast iterations ⇒ fast feedback loops Customer
Business Release Feedback wtf is ... devops -
◦ Expand creativity and knowledge. ◦ Feedback and learning for
everyone. ◦ Collaboration of diverse people on shared ideas. ◦ Empowerment of teams and individuals. Sharing wtf is ... devops -
Deploy better systems at less cost in less time at
lower risk. wtf is ... devops