Current situationThe damn developers are not aware aboutthe impact of his source code in theproduction systems.They have a optimized toolkit for developquicklyThey run the code locally in his laptop evenif there are testing/staging/integration envsto try code
The key for get business objectivesDevelopers contribute value to the businessimplementing functional requirementsSysadmins contribute value to the businessimplementing security, stability and performanceBoth objectives crush because new funcionalitiesinvolve assume risksSysadmins try to decrease risks avoiding changesand release deployments are delayed and finally a lotof changes are done simultaneously
Operations objective is not onlymaintain a safety, stable and fasterenvironmentAnother important objective is enablebusiness objectivesBusiness requires changes and changesare the root of the instability so..
RecommendationsImplication since first steps of development➔Configuration is code, separated of the application code➔Common and integrated tools between teams➔Abstract administration➔Continuous integration➔Infrastructure and provisioning automated➔Shared KPI➔
Common TerminologyThe following are some Chef terms that will be helpful to know before weStart.Node: A managed machine. When the Chef client runs, it executes theconfiguration for a node.Client: An authorized user of the Chef API. In most cases, every machine youmanage will be represented by: a) a client for logging into the API and b) anode configuration to apply. Administrators and the web interface are alsoclients.Cookbook: A collection of attributes, recipes, custom resources, anddefinitions to configure a certain application or service. For instance you willfind shared cookbooks available on the web for NTP, Apache httpd, MySQL,nginx, and other common services.Recipe: A list of resources that should be applied to a node. Recipes arewritten in normal Ruby extended by the Chef resource domain-specificlanguage. This gives you the power of anything you can do in Ruby(conditionals, using gems, etc.) while not having to be verbose in managingthe resources that make up your configuration.
Chef componentsKnifeKnife is the tool you will use as a system administrator to interact withthe server most often, especially taking cookbooks and other customconfigurations and loading them into the server for distribution to clientsChef ClientThe Chef client runs on the servers you are managing. It gathersinformationabout itself using Ohai, synchronizes the cookbooks it needs from the Chefserver, compiles the collection of resources that make up the configuration,and then “converges” the resources it has compiled with the state of thecurrent machineWeb-UIChef includes a web interface that lets you browse cookbooks and browseandedit nodes, roles, and clients.Server/APIThe Chef server sits at the center of the system. The Chef server exposesa RESTful API, which is used by the other components in the system. Yourmanaged nodes, knife, and the web interface are all clients of the API..
Ohai Detects data about your local machine & OS➔ Kernel stats➔ Modules & drivers➔ Programming Languages➔ Users➔ Filesystems➔ Network configuration● Populates attributes and makes them available for Chef
Configuration● JSON: /etc/chef/solo.json Run Chef Solo
Resources ● The steps that make up a recipe● Implemented by providers, depending on your platform● (in this case apt-get, rpm, zypper or MacPorts)
Chef Server Knife● CLI tool for Chef-Server:➔ List nodes, cookbooks & attributes➔ Assign roles➔ Upload new cookbooks
Two Phases of Chef1) CompileLoad all attributes & recipes and build list ofactions/dependenciesCompute attribute tree2) RunRandom Ruby Code runs hereActually execute the resources
Chef Experiences Great way to automate provisioning of servers➔Infrastructure as code➔Understandable by dev & ops➔ Easy to extend➔ Easy to integrate in managementframework➔(SSH, mcollective, Nanite, ..)➔Ignore Chef-Server when starting toplay with Chef(dev envs)