SlideShare a Scribd company logo
1 of 28
Arpit Suthar
Software Consultant
Knoldus Software LLP
Arpit Suthar
Software Consultant
Knoldus Software LLP
Our 5 Course meal for today :)
➔ What is chef
➔ How chef works?
➔ How to use it?
➔ Chef alternatives
➔ Lets cook :)
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.
Why chef?
Chef Components
➔ Recipe
➔ Cookbook
➔ Node
➔ Chef-client
➔ Workstation
➔ Chef-server
➔ Chef Supermarket
➔ Knife
What is the problem???What is the problem???
The real problem is STATE.The real problem is STATE.
How to use chef?How to use 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)
➔ 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?
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
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
Cont.
➔ Generate your RSA private key file
Cont.
➔ From the command line, copy knife.rb to your ~/learn-chef/.chef directory
eg. cp ~/Downloads/arpitkulria.pem ~/learn-chef/.chef
➔ 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.
➔ You can see all the uploaded cookbooks by command
➔ $ knife cookbook list
Cont.
➔ 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
➔ 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.
➔ 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
Chef alternatives
➔ Puppet
➔ Ansible
➔ Salt
➔ Rundeck
Lets cook :)Lets cook :)
Questions and Answers.getOrElse(“You'll get ASAP”)Questions and Answers.getOrElse(“You'll get ASAP”)
Thank youThank you
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

More Related Content

What's hot

Docker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker 101: Introduction to Docker
Docker 101: Introduction to Docker
Docker, Inc.
 
What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...
What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...
What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...
Simplilearn
 

What's hot (20)

Automating your infrastructure with Chef
Automating your infrastructure with ChefAutomating your infrastructure with Chef
Automating your infrastructure with Chef
 
Docker & kubernetes
Docker & kubernetesDocker & kubernetes
Docker & kubernetes
 
Getting Started with Kubernetes
Getting Started with Kubernetes Getting Started with Kubernetes
Getting Started with Kubernetes
 
Kubernetes for Beginners: An Introductory Guide
Kubernetes for Beginners: An Introductory GuideKubernetes for Beginners: An Introductory Guide
Kubernetes for Beginners: An Introductory Guide
 
Configuration management with Chef
Configuration management with ChefConfiguration management with Chef
Configuration management with Chef
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
 
Immutable Infrastructure with Packer Ansible and Terraform
Immutable Infrastructure with Packer Ansible and TerraformImmutable Infrastructure with Packer Ansible and Terraform
Immutable Infrastructure with Packer Ansible and Terraform
 
Docker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker 101: Introduction to Docker
Docker 101: Introduction to Docker
 
Docker Commands With Examples | Docker Tutorial | DevOps Tutorial | Docker Tr...
Docker Commands With Examples | Docker Tutorial | DevOps Tutorial | Docker Tr...Docker Commands With Examples | Docker Tutorial | DevOps Tutorial | Docker Tr...
Docker Commands With Examples | Docker Tutorial | DevOps Tutorial | Docker Tr...
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
Docker
DockerDocker
Docker
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
[GitOps] Argo CD on GKE (v0.9.2).pdf
[GitOps] Argo CD on GKE (v0.9.2).pdf[GitOps] Argo CD on GKE (v0.9.2).pdf
[GitOps] Argo CD on GKE (v0.9.2).pdf
 
Jenkins, pipeline and docker
Jenkins, pipeline and docker Jenkins, pipeline and docker
Jenkins, pipeline and docker
 
What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...
What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...
What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...
 
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
 
모두의 쿠버네티스 (Kubernetes for everyone)
모두의 쿠버네티스 (Kubernetes for everyone)모두의 쿠버네티스 (Kubernetes for everyone)
모두의 쿠버네티스 (Kubernetes for everyone)
 
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
 
Docker swarm introduction
Docker swarm introductionDocker swarm introduction
Docker swarm introduction
 

Viewers also liked

Chef Fundamentals Training Series Module 1: Overview of Chef
Chef Fundamentals Training Series Module 1: Overview of ChefChef Fundamentals Training Series Module 1: Overview of Chef
Chef Fundamentals Training Series Module 1: Overview of Chef
Chef Software, Inc.
 
Introduction to puppet
Introduction to puppetIntroduction to puppet
Introduction to puppet
Habeeb Rahman
 

Viewers also liked (19)

Infrastructure Automation with Chef
Infrastructure Automation with Chef Infrastructure Automation with Chef
Infrastructure Automation with Chef
 
Chef Fundamentals Training Series Module 1: Overview of Chef
Chef Fundamentals Training Series Module 1: Overview of ChefChef Fundamentals Training Series Module 1: Overview of Chef
Chef Fundamentals Training Series Module 1: Overview of Chef
 
Puppets
PuppetsPuppets
Puppets
 
Survey: Frozen Yogurt Market in India (2013)
Survey: Frozen Yogurt Market in India (2013)Survey: Frozen Yogurt Market in India (2013)
Survey: Frozen Yogurt Market in India (2013)
 
Chef Delivery
Chef DeliveryChef Delivery
Chef Delivery
 
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...
 
STIG Compliance and Remediation with Ansible
STIG Compliance and Remediation with AnsibleSTIG Compliance and Remediation with Ansible
STIG Compliance and Remediation with Ansible
 
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
 
Compliance Automation Workshop
Compliance Automation WorkshopCompliance Automation Workshop
Compliance Automation Workshop
 
Puppet overview
Puppet overviewPuppet overview
Puppet overview
 
Facebook Network Analysis using Gephi
Facebook Network Analysis using GephiFacebook Network Analysis using Gephi
Facebook Network Analysis using Gephi
 
Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015
 
Ansible
AnsibleAnsible
Ansible
 
Introduction to puppet
Introduction to puppetIntroduction to puppet
Introduction to puppet
 
Ansible tips & tricks
Ansible tips & tricksAnsible tips & tricks
Ansible tips & tricks
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction
 
3 Steps to Expand DevOps and Automation Throughout the Enterprise
3 Steps to Expand DevOps and Automation Throughout the Enterprise3 Steps to Expand DevOps and Automation Throughout the Enterprise
3 Steps to Expand DevOps and Automation Throughout the Enterprise
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
A Look Inside Google’s Data Center Networks
A Look Inside Google’s Data Center NetworksA Look Inside Google’s Data Center Networks
A Look Inside Google’s Data Center Networks
 

Similar to Introduction to Chef

NLIT 2011: Chef & Capistrano
NLIT 2011: Chef & CapistranoNLIT 2011: Chef & Capistrano
NLIT 2011: Chef & Capistrano
nickblah
 

Similar to Introduction to Chef (20)

IT Automation with Chef
IT Automation with ChefIT Automation with Chef
IT Automation with Chef
 
Cloud Automation with Opscode Chef
Cloud Automation with Opscode ChefCloud Automation with Opscode Chef
Cloud Automation with Opscode Chef
 
Node setup, resource, and recipes - Fundamentals Webinar Series Part 2
Node setup, resource, and recipes - Fundamentals Webinar Series Part 2Node setup, resource, and recipes - Fundamentals Webinar Series Part 2
Node setup, resource, and recipes - Fundamentals Webinar Series Part 2
 
Chef Provisioning a Chef Server Cluster - ChefConf 2015
Chef Provisioning a Chef Server Cluster - ChefConf 2015Chef Provisioning a Chef Server Cluster - ChefConf 2015
Chef Provisioning a Chef Server Cluster - ChefConf 2015
 
The Berkshelf Way
The Berkshelf WayThe Berkshelf Way
The Berkshelf Way
 
Cloud Automation with Opscode Chef
Cloud Automation with Opscode ChefCloud Automation with Opscode Chef
Cloud Automation with Opscode Chef
 
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
 
Understand Chef
Understand ChefUnderstand Chef
Understand Chef
 
Azure handsonlab
Azure handsonlabAzure handsonlab
Azure handsonlab
 
How to Write Chef Cookbook
How to Write Chef CookbookHow to Write Chef Cookbook
How to Write Chef Cookbook
 
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
 
NLIT 2011: Chef & Capistrano
NLIT 2011: Chef & CapistranoNLIT 2011: Chef & Capistrano
NLIT 2011: Chef & Capistrano
 
Chef training Day4
Chef training Day4Chef training Day4
Chef training Day4
 
Chef Fundamentals Training Series Module 2: Workstation Setup
Chef Fundamentals Training Series Module 2: Workstation SetupChef Fundamentals Training Series Module 2: Workstation Setup
Chef Fundamentals Training Series Module 2: Workstation Setup
 
Using Vagrant
Using VagrantUsing Vagrant
Using Vagrant
 
Compliance Automation with Inspec Part 4
Compliance Automation with Inspec Part 4Compliance Automation with Inspec Part 4
Compliance Automation with Inspec Part 4
 
Vagrant introduction for Developers
Vagrant introduction for DevelopersVagrant introduction for Developers
Vagrant introduction for Developers
 
DevOps hackathon Session 2: Basics of Chef
DevOps hackathon Session 2: Basics of ChefDevOps hackathon Session 2: Basics of Chef
DevOps hackathon Session 2: Basics of Chef
 
Learning chef
Learning chefLearning chef
Learning chef
 

More from Knoldus Inc.

More from Knoldus Inc. (20)

Supply chain security with Kubeclarity.pptx
Supply chain security with Kubeclarity.pptxSupply chain security with Kubeclarity.pptx
Supply chain security with Kubeclarity.pptx
 
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML ParsingMastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
 
Akka gRPC Essentials A Hands-On Introduction
Akka gRPC Essentials A Hands-On IntroductionAkka gRPC Essentials A Hands-On Introduction
Akka gRPC Essentials A Hands-On Introduction
 
Entity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptxEntity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptx
 
Introduction to Redis and its features.pptx
Introduction to Redis and its features.pptxIntroduction to Redis and its features.pptx
Introduction to Redis and its features.pptx
 
GraphQL with .NET Core Microservices.pdf
GraphQL with .NET Core Microservices.pdfGraphQL with .NET Core Microservices.pdf
GraphQL with .NET Core Microservices.pdf
 
NuGet Packages Presentation (DoT NeT).pptx
NuGet Packages Presentation (DoT NeT).pptxNuGet Packages Presentation (DoT NeT).pptx
NuGet Packages Presentation (DoT NeT).pptx
 
Data Quality in Test Automation Navigating the Path to Reliable Testing
Data Quality in Test Automation Navigating the Path to Reliable TestingData Quality in Test Automation Navigating the Path to Reliable Testing
Data Quality in Test Automation Navigating the Path to Reliable Testing
 
K8sGPTThe AI​ way to diagnose Kubernetes
K8sGPTThe AI​ way to diagnose KubernetesK8sGPTThe AI​ way to diagnose Kubernetes
K8sGPTThe AI​ way to diagnose Kubernetes
 
Introduction to Circle Ci Presentation.pptx
Introduction to Circle Ci Presentation.pptxIntroduction to Circle Ci Presentation.pptx
Introduction to Circle Ci Presentation.pptx
 
Robusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptxRobusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptx
 
Optimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptxOptimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptx
 
Azure Function App Exception Handling.pptx
Azure Function App Exception Handling.pptxAzure Function App Exception Handling.pptx
Azure Function App Exception Handling.pptx
 
CQRS Design Pattern Presentation (Java).pptx
CQRS Design Pattern Presentation (Java).pptxCQRS Design Pattern Presentation (Java).pptx
CQRS Design Pattern Presentation (Java).pptx
 
ETL Observability: Azure to Snowflake Presentation
ETL Observability: Azure to Snowflake PresentationETL Observability: Azure to Snowflake Presentation
ETL Observability: Azure to Snowflake Presentation
 
Scripting with K6 - Beyond the Basics Presentation
Scripting with K6 - Beyond the Basics PresentationScripting with K6 - Beyond the Basics Presentation
Scripting with K6 - Beyond the Basics Presentation
 
Getting started with dotnet core Web APIs
Getting started with dotnet core Web APIsGetting started with dotnet core Web APIs
Getting started with dotnet core Web APIs
 
Introduction To Rust part II Presentation
Introduction To Rust part II PresentationIntroduction To Rust part II Presentation
Introduction To Rust part II Presentation
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Configuring Workflows & Validators in JIRA
Configuring Workflows & Validators in JIRAConfiguring Workflows & Validators in JIRA
Configuring Workflows & Validators in JIRA
 

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

Introduction to Chef

  • 1. Arpit Suthar Software Consultant Knoldus Software LLP Arpit Suthar Software Consultant Knoldus Software LLP
  • 2. Our 5 Course meal for today :) ➔ What is chef ➔ How chef works? ➔ How to use it? ➔ Chef alternatives ➔ Lets cook :)
  • 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.
  • 5. Chef Components ➔ Recipe ➔ Cookbook ➔ Node ➔ Chef-client ➔ Workstation ➔ Chef-server ➔ Chef Supermarket ➔ Knife
  • 6. What is the problem???What is the problem???
  • 7. The real problem is STATE.The real problem is STATE.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12. How to use chef?How to use chef?
  • 13. ➔ 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?
  • 14.
  • 15. 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
  • 16. 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
  • 17. Cont. ➔ Generate your RSA private key file
  • 18. Cont. ➔ From the command line, copy knife.rb to your ~/learn-chef/.chef directory eg. cp ~/Downloads/arpitkulria.pem ~/learn-chef/.chef
  • 19. ➔ 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.
  • 20. ➔ You can see all the uploaded cookbooks by command ➔ $ knife cookbook list Cont.
  • 21. ➔ 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
  • 22. ➔ 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.
  • 23. ➔ 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
  • 24. Chef alternatives ➔ Puppet ➔ Ansible ➔ Salt ➔ Rundeck
  • 25. Lets cook :)Lets cook :)
  • 26. Questions and Answers.getOrElse(“You'll get ASAP”)Questions and Answers.getOrElse(“You'll get ASAP”)

Editor's Notes

  1. Chef is built around simple concepts: achieving desired state, centralized modeling of IT infrastructure etc. These concepts enable you to quickly manage any infrastructure with Chef. These very same concepts allow Chef to handle the most difficult infrastructure challenges on the planet.
  2. Recipe: - Recipes are simple patterns (blocks that define properties and values that map to specific configuration items like packages, files, services, templates, and users) Cookbook: - Collection of recipes Node:- A node is any machine—physical, virtual, cloud, network device, etc.—that is under management by Chef. Chef-client: - A chef-client is installed on every node that is under management by Chef. The chef-client performs all of the configuration tasks that are specified by the run-list and will pull down any required configuration data from the Chef server as it is needed during the chef-client run Workstation : - One (or more) workstations are configured to allow users to author, test, and maintain cookbooks. Cookbooks are uploaded to the Chef server from the workstation. Chef-server:- The Chef server acts as a hub of information. Cookbooks and policy settings are uploaded to the Chef server by users from workstations. Chef Supermarket: - This is the location in which community cookbooks are authored and maintained. Cookbooks that are part of the Chef Supermarket may be used by any Chef user. Knife: - The knife command-line tool to interact with nodes or work with objects on the Chef server..
  3. Port will be SSH 2222 And IDENTITY_File is location of file /home/apit/.vagrant/machines/default/virtualbox/private_key
  4. Why javascript, why we are bothering to do javascript. beacuse as you know its typical to do web development without javascript. ITs the only language, that's basically supported web browser. So at some point you need javascript code. ITs scripting language, not designed to scale large rich web application
  5. Why javascript, why we are bothering to do javascript. beacuse as you know its typical to do web development without javascript. ITs the only language, that's basically supported web browser. So at some point you need javascript code. ITs scripting language, not designed to scale large rich web application
  6. Why javascript, why we are bothering to do javascript. beacuse as you know its typical to do web development without javascript. ITs the only language, that's basically supported web browser. So at some point you need javascript code. ITs scripting language, not designed to scale large rich web application
  7. Why javascript, why we are bothering to do javascript. beacuse as you know its typical to do web development without javascript. ITs the only language, that's basically supported web browser. So at some point you need javascript code. ITs scripting language, not designed to scale large rich web application