Chef configuration

Hi , I am new to Chef and As per my understanding chef works on pull mechanism . So whenever any update comes on chef server then the nodes configure themselves by pulling those updates from chef server. But to pull those updates chef client should be present on the respective nodes. Hence I need to understand if there are 100 nodes then do I need to install the chef client one by one on all 100 nodes. I believe no . So there must b some technique to install the chef client and configure on all 100 nodes in 1 go. Can you please advise.

Yes chef-client must be installed and configured on each node individually. This is called "bootstrapping" and can be accomplished in quite a number of ways. Knife can be used to do it via custom scripting.

https://docs.chef.io/install_bootstrap.html

Other options depend a great deal on your environment. If you are in any cloud environment then I highly recommend looking at tools like terraform that provide infrastructure as code and support fairly straightforward chef bootstrapping during the initial creation of the node.

Thanks Vaughn , However in case of bootstrapping if I spin up 100 ec2 instance using console then do I need to mention the script in user data ? Also as you mention terraform can also be used then could you please elaborate more how can I achieve this using terraform.

If the nodes already exist and you don't want to recreate them then your only real option is to write a script to use knife to bootstrap them all individually. The bootstrap process is basically just installing chef-client, setting the node's recipe list, and any environment or policy-file that determines the attributes of the node beyond the cookbooks.

Here's the documentation for bootstrapping chef w/terraform:

And some more real world examples:

More than that will require some detailed knowledge of your environment and probably more interactive professional assistance than you can get on a list like this.

That's really helpful..... In case if the node does not exists then which process should be followed .

I would definitely start with terraform if you haven't deployed the nodes (and related aws infrastructure) yet. Chef did some good talks about terraform and chef at chefconf this year. And there are tons of courses/how-tos on the process. Not sure I have any particular favorites but I'd start with watching the chefconf talks and then either google some blog how-tos or some Udemy type courses on "chef and terraform".

Great thanks ....