Bootstrap process

In production environment, where exactly ‘bootstrap process’ should be triggered? What is Chef recommendation?
In the tutorial, it is usually triggered from chef workstation.

The bootstrap process, done by knife, is just one way. What it does is installing chef client, pushing some configuration and certificates when needed and doing a first run.

Some peoples use knife bootstrap from the provisioning system, others preinstall chef-client and a basic configuration and the validator.pem file on the base image and launch the first run after hostname/IP has been configured by their provisioning system.

Usually using the chef_client cookbook to manage the client configuration is a good idea.

In brief: find the most suitable case for you, as long as the client has a configuration to reach the chef-server and and either a validator.pem to register itself or it’s own client.pem to authenticate it will be fine.

Thank You very much for the details. Can you please shed some light on ‘Usually using the chef_client cookbook to manage the client configuration is a good idea’??

Will this chef_client cookbook be run as part of initial bootstrapping?

The cookbook is here, the readme covers it’s usage.

I do think you should have it in every node runlist so if you need to change a parameter it is easy via attributes, so yes, it should be set in the bootstrap runlist IMHO.

Thanks. Looks like this chef_client cookbook does NOT install chef client on the node. It simply provides a way to change the client.rb configuration at run-time. Is my understanding correct?

Yes, probably.

It wouldn’t make sense for any cookbook to try to install chef-client because you need chef-client to even run the cookbook!

Kevin Keane
Whom the IT Pros Call
The NetTech
http://www.4nettech.com
Our values: Privacy, Liberty, Justice
See https://www.4nettech.com/corp/the-nettech-values.html

Yes, Thanks.

Can I make the node, bootstrap itself? Basically I will install chefdk on my node and issue ‘knife bootstrap’ command which will install chef-client and create /etc/chef/client.rb. You see any issues with this approach?

Basically the node will play the role of ‘chefworkstation’ and ‘node’.

You probably could do that, but it doesn’t seem to make much sense to me. You would only be moving the problem of having to manually install something from a fairly simple install to a much larger and more complex one.

Why not manually install the chef-client instead of manually installing chef-dk? chef-dk is a much more massive download, and needs a lot more configuration (which would be a lot easier to do with a cookbook).

Kevin Keane
Whom the IT Pros Call
The NetTech
http://www.4nettech.com
Our values: Privacy, Liberty, Justice
See https://www.4nettech.com/corp/the-nettech-values.html

I see that ‘chef_client’ cookbook has ‘service recipes’. As part of bootstrap process, is it a must to use these service recipes?

Do I have to setup chef-client cron jobs so that it runs at a specific interval?