CHEF Interview Questions for freshers and experienced :-
1. What is chef?
The chef is a well-structured, powerful management tool that is used to transfer the infrastructure into codes. With chef, you can easily develop and use the scripts for automation and IT process.
2. What are the primary components of Chef?
The architecture of the chef tool can be easily broken down in the following components:
- Chef node
- Chef server
- Chef workstation
3. What is the chef node?
The chef node is a hosting element of the chef tool that is managed through the chef-client and responsible to share data across the network.
4. What is the chef server?
The chef server is referred to as the center of the chef tool is responsible for storing necessary data and configuring nodes.
5. Define chef workstation?
You can consider the chef workstation as the modifying host for the data and cookbooks.
6. Describe the chef resource and its functions?
The chef resource is a crucial aspect of the infrastructure which is used to install and run a service. It can be used to:
- Describe a configured item
- Choose resources like services, package, and template
- List down the properties of the resources
- Group the resources into recipes
7. What is the importance of the chef nodes?
DevOps professionals often consider chef nodes as the virtual constituent that is an integral of the infrastructure. Chef nodes help to execute any resource.
8. What is a recipe in the chef tool?
The recipe in the chef is often described as a group of resources. The recipe contains all the information reuired to configure an aspect of the system.
9. Write down the functions of the recipe?
The recipe is used to perform the following function:
- Install and manage components of software
- Deploy applications in chef
- Execute other recipes in the system
- Manage system files
10. Describe the difference between a recipe and cookbook in the chef workstation?
When developers group down resources together they receive the recipe which is useful when configuring and implementing policies. Now, when they group down recipes what they receive is the cookbook. The concept is similar to the food cookbook and recipes.

11. Define step by step process to update the chef cookbook?
Here is the step-by-step process you need to follow while updating the chef cookbook:
Step 1: Go to the workstation to run the knife SSH
Step 2: Run both chef-client and knife SSH directly on the server
Step 3: You can consider and utilize the chef-client as a daemon to restart the service
12. What will happen if the action is not defined in chef resource?
If the developer did not define a particular action for the chef resource, then it will automatically choose a default action for itself.
13. Describe the run-list in the chef?
The run list can be described as a list of roles and responsibilities of the recipes in an order to define which recipe needs to run in which order. It is significant to have run-list when you are dealing with multiple cookbooks in the chef.
14. What are the benefits of using run-list?
There are several benefits of using run-list including:
- Ensure recipes are running in the same order as specified
- It specifies the node on which recipes will run
- Transfer the workstation to chef-server
15. What instructions do you need to perform bootstrap in chef?
To perform or order bootstrap in the chef, you need:
- Public IP address or hostname
- Account Id and password to log into the node
- You can use the keyword-authentication instead of ID and password
16. Do you know what DK is in chef?
As a beginner, you must know that DK is the server station in the chef that is used to interact with the system. There are pre-installed tools in DK which makes interaction much easier and effective.
17. What is chef repository and why do we use it?
As a developer, you can consider the chef repository as a collection of cookbooks, data bags, environments, roles and more. You can also sync the chef repository with the version control system to further enhance the overall performance.
18. Showcase your knowledge about the test kitchen in chef?
The test kitchen is the tool which is used to enable cookbooks on the server. It also helps in creating various virtual machines on the cloud.
19. What are the primary advantages of a test kitchen?
The key advantages of using the test kitchen are:
- It allows you to use various virtualization providers that create virtual machines
- It speeds up the overall development cycle
- It helps you to run cookbooks on the server
20. Have you learned about signature header? If yes, then explain it?
The signature header is crucial to validate the interaction that is created or exist between the chef server and node.
21. What is the role of SSL in chef?
It can be challenging to find out the right data has been accessed in a pile of servers and chef clients. Therefore, it is crucial to establish the SSL connection to make sure you have accessed the right data in the chef.
22. Describe the starter kit in chef?
The primary reason to use starter kit to configure files in the chef tool. It is used to get the clear information for the configuration process.
23. What is chefDK?
In the tool, chefDK is the software development kit that is used to develop and test the cookbooks.
24. Does the chef use the ruby?
Yes, chef- the configuration tool is entirely written in the Ruby and leverage the pure domain-specific language.
25. What is the difference between Chef and Ansible?
Although both Ansible and Chef are popular configuration management tools they are far different than being similar. Both of them have different strength, structures, benefits, and drawbacks. While configuration files are known as cookbooks in chef, they are known as a playbook in ansible. Chef operates on client-server and Ansible is agentless.
26. What is the source of truth? Define the chef’s source of truth?
Source of truth is the process of structuring information modules and data in a way that every data is edited at a single place. What actually differentiates chef from the ansible is the way how it handles the source of truth. Unlike ansible, the chef has its chef serves as the source of truth and process includes deploying updated cookbooks on one or two servers.
27. What is the orchestration tool? Is chef orchestration tool?
The orchestration tool is often defined as a way to represent complex systems and models in the easiest manner. So, no, the chef is not an orchestration tool.
28. Describe one main difference between chef and puppet tool?
The key difference between chef and puppet is that Puppet is the set of tools while the chef is the Ruby DSL and set of configured tools.
29. Define the chef-repo?
Chef repo is a directory that is pre-installed in your chef workstation and used to store:
- Data bags
- Environments
- Roles
30. Define the role of chef validator?
Chef validator can be defined as a process to analyze to ensure every reuest that is made from the client-server to chef-server is authentic.
31. What do you understand by knife SSL check command in chef?
Knife SSL check is the subcommand that is leverage to validate the state of SSL certification and uickly response to troubleshoot the issue.
32. What is data bags in chef?
Data bags are the variables that basically store the JSON data and can be easily accessible through the chef server.
33. Where do you store the cookbooks in the chef?
The cookbooks are basically stored in the bookshelf directory of chef which can be easily modified as per your needs.
34. What attributes represent in the chef?
Attributes in the chef are used at the first hand to represent the information of nodes.
35. What do you understand by “chef template”?
Chef templates are the embedded templates that used to creates static files that consist of Ruby statements and expressions.
36. What Happens During The Bootstrap Process?
During the bootstrap process, the node downloads and installs chef-client, registers itself with the Chef server, and does an initial check in. During this check in, the node applies any cookbooks that are part of its run-list.
37. How Do You Apply An Updated Cookbook To Your Node?
We mentioned two ways.
Run knife Ssh from your workstation.
SSH directly into your server and run chef-client.
You can also run chef-client as a daemon, or service, to check in with the Chef server on a regular interval, say every 15 or 30 minutes.
Update your Apache cookbook to display your node’s host name, platform, total installed memory, and number of CPUs in addition to its FQDN on the home page.
Update index.html.erb like this.
<html>
<body>
<h1>hello from <%= node [‘fqdn’] %>< /h1>
<pre>
<%= node [‘hostname’] %>
<%= node [‘platform’] %> – <%= node[‘platform_version’] %>
<%= node [‘memory’][‘total’] %> RAM
<%= node [‘cpu’][‘total’] %> CPUs
</pre>
</body>
</html>
Then upload your cookbook and run it on your node.
38. What Would You Set Your Cookbook’s Version To Once It’s Ready To Use In Production?
According to Semantic Versioning, you should set your cookbook’s version number to 1.0.0 at the point it’s ready to use in production.
39. Create A Second Node And Apply The Awesome Customers Cookbook To It. How Long Does It Take?
You already accomplished the majority of the tasks that you need. You wrote the awesome customers cookbook, uploaded it and its dependent cookbooks to the Chef server, applied the awesome customers cookbook to your node, and verified that everything’s working.
All you need to do now is:
- Bring up a second Red Hat Enterprise Linux or Centos node.
- Copy your secret key file to your second node.
- Bootstrap your node the same way as before. Because you include the awesome customers cookbook in your run-list, your node will apply that cookbook during the bootstrap process.
- The result is a second node that’s configured identically to the first one. The process should take far less time because you already did most of the work.
- Now when you fix an issue or add a new feature, you’ll be able to deploy and verify your update much more quickly!
40. What’s The Value Of Local Development Using Test Kitchen?
Local development with Test Kitchen:
- Enables you to use a variety of virtualization providers that create virtual machine or container instances locally on your workstation or in the cloud.
- Enables you to run your cookbooks on servers that resemble those that you use in production.
- Speeds up the development cycle by automatically provisioning and tearing down temporary instances, resolving cookbook dependencies, and applying your cookbooks to your instances.
41. Which Of The Following Lets You Verify That Your Node Has Successfully Bootstrapped?
- The Chef management console.
- Knife node list
- Knife node show
- You can use all three of these methods.
42. What Is The Command You Use To Upload A Cookbook To The Chef Server?
Knife cookbook upload.
