Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Introduction to Chef

7,279 views

Published on

These slides are containing a brief intro to chef software and will let you know the power of chef, and how to use it and make deployment automatic.

Published in: Technology
  • DOWNLOAD FULL. BOOKS INTO AVAILABLE FORMAT, ......................................................................................................................... ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Introduction to Chef

  1. 1. Arpit Suthar Software Consultant Knoldus Software LLP Arpit Suthar Software Consultant Knoldus Software LLP
  2. 2. Our 5 Course meal for today :) ➔ What is chef ➔ How chef works? ➔ How to use it? ➔ Chef alternatives ➔ Lets cook :)
  3. 3. What is chef Chef is a powerful automation platform that transforms complex infrastructure into code, Chef automates how applications are configured, deployed, and managed across your network, no matter its size.
  4. 4. Why chef?
  5. 5. Chef Components ➔ Recipe ➔ Cookbook ➔ Node ➔ Chef-client ➔ Workstation ➔ Chef-server ➔ Chef Supermarket ➔ Knife
  6. 6. What is the problem???What is the problem???
  7. 7. The real problem is STATE.The real problem is STATE.
  8. 8. How to use chef?How to use chef?
  9. 9. ➔ Download Chef Development Kit (https://downloads.chef.io/chef-dk/) ➔Create a repo eg. chef-repo (mkdir learn-chef) ➔Create a folder to keep cookbooks (mkdir cookbooks) ➔Now create a cook book eg. (chef generate cookbook learn_chef) ➔ Download Chef Development Kit (https://downloads.chef.io/chef-dk/) ➔Create a repo eg. chef-repo (mkdir learn-chef) ➔Create a folder to keep cookbooks (mkdir cookbooks) ➔Now create a cook book eg. (chef generate cookbook learn_chef) How to use chef?How to use chef?
  10. 10. Cont. Now there is a question where will I upload my recipes (chef server) ➔ Go to https://manage.chef.io/ and create a account on chef.io ➔ Create an organization ➔ Configure your workstation to communicate with the Chef server with knife ➔ knife requires two files to communicate with the Chef server – an RSA private key and a configuration file. ➔ Every request to the Chef server is authenticated through an RSA public key-pair. The Chef server holds the public part; you hold the private part. ➔ The configuration file is typically named knife.rb. It contains information such as the Chef server's URL, the location of your RSA private key, and the default location of your cookbooks. ➔ The next step is to create the ~/learn-chef/.chef directory and add your RSA private key and knife configuration files. Eg mkdir ~/learn-chef/.chef
  11. 11. Cont. ➔ Generate your knife configuration file ➔ From the command line, copy knife.rb to your ~/learn-chef/.chef directory eg. cp ~/Downloads/knife.rb ~/learn-chef/.chef
  12. 12. Cont. ➔ Generate your RSA private key file
  13. 13. Cont. ➔ From the command line, copy knife.rb to your ~/learn-chef/.chef directory eg. cp ~/Downloads/arpitkulria.pem ~/learn-chef/.chef
  14. 14. ➔ Run these commands to download the cookbook from Chef Supermarket and extract it to your ~/learn-chef/cookbooks directory. $ knife cookbook site download java ➔ In cookbook dir run this command $ tar -zxvf java-1.39.0.tar.gz ➔ Upload your cookbook to the Chef server $ knife cookbook upload java ➔ After uploading you can see your cookbooks on https://manage.chef.io/ under policy tab Cont.
  15. 15. ➔ You can see all the uploaded cookbooks by command ➔ $ knife cookbook list Cont.
  16. 16. ➔ Set up an Ubuntu server, called a node, and prepare your node to be configured by Chef remotely from your workstation is called bootstrapping a node We will be doing this on virtual machine For that you have to download virtual machine from here ➔ and vagrant from here The next step is to download a base virtual machine image, called a box. Here's how to download an Ubuntu 14.04 box $ vagrant box add ubuntu-14.04 http://opscode-vm- bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-14.04_chef- provisionerless.box Get a node to bootstrap
  17. 17. ➔ Run these commands to bring up an Ubuntu 14.04 instance. $ vagrant init ubuntu-14.04 $ vagrant up –provider=virtualbox ➔ Now we can connect to our virtual instance by $ vagrant ssh ➔ If you are using a real instance then you can follow steps from here ➔ Bootstrap the node by $knife bootstrap localhost --ssh-port PORT --ssh-user vagrant --sudo --identity-file IDENTITY_FILE_LOCATION --node-name node1 --run-list 'recipe[java]' Cont.
  18. 18. ➔ Now that your updated cookbook is on the Chef server, you can run chef-client on your node. The chef-client command pulls from Chef server the latest cookbooks from the node's run-list and applies the run-list to the node. ➔ On virtual machine we can do this by $ knife ssh localhost --ssh-port PORT 'sudo chef-client' --manual-list --ssh-user vagrant --identity-file IDENTITY_FILE_LOCATION Run the cookbook on your node
  19. 19. Chef alternatives ➔ Puppet ➔ Ansible ➔ Salt ➔ Rundeck
  20. 20. Lets cook :)Lets cook :)
  21. 21. Questions and Answers.getOrElse(“You'll get ASAP”)Questions and Answers.getOrElse(“You'll get ASAP”)
  22. 22. Thank youThank you
  23. 23. ReferencesReferences ● https://www.chef.io/ ●http://www.slideshare.net/JoshPadnick/introduction-to-chef-autom ●http://www.slideshare.net/jweiss/infrastructure-automation-withch ● https://www.chef.io/ ●http://www.slideshare.net/JoshPadnick/introduction-to-chef-autom ●http://www.slideshare.net/jweiss/infrastructure-automation-withch

×