I have been struggling with speeding up bootstrapping nodes and it seems quite difficult to find an easy way.
First, I tried using Squid proxy but chef bootstrap uses https communication to download packages and my squid proxy doesn’t cache the contents with https communication. I have tried Squid to cache for https communication but it seems pretty complicating and not recommended by its design purpose.
So second, I have tried making local apt repo(since I usually work with Ubuntu) to speed up downloading the packages but it seems there is no option for ‘chef bootstrap’ to download chef packages from a specific URL.
Can anybody help me to solve this problem? Am I doing wrong or misunderstanding?
Please help.
Bootstrapping basically just involves copying a script over to the node and executing it. The script is not very complicated, actually; it just sets up /etc/chef and adds a basic configuration file and a validation key, installs chef and then runs it.
There are several options:
You can create your own bootstrapping script, based on the default one.
You can install the chef client before bootstrapping. The package manager (apt in your case) should recognize that the package is already installed, and not re-download it.
In my own system, I am taking the second approach. My systems are CentOS and specific to my site, so my script would be fairly useless for you, but the general idea might help.
My OS gets installed with kickstarter in an unattended install. I simply added installing chef to the kickstarter script. The kickstarter script also sets up the validation key and configuration file in /etc/chef, and then launches the initial chef run.
That’s pretty much all the bootstrapping process does, so my systems don’t really need to be bootstrapped at all; it happens automatically at OS install time.