Skip to content

Cleanup knife bootstrap description #4402

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 33 additions & 47 deletions content/reusable/md/chef_client_bootstrap_stages.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,36 @@
The following diagram shows the stages of the bootstrap operation, and
the list below the diagram describes each of those stages in greater
detail.
The following diagram shows the stages of the bootstrap operation,
and the list below the diagram describes each of those stages in greater detail.

![image](/images/chef_bootstrap.png)

During a `knife bootstrap` bootstrap operation, the following happens:

<!-- markdownlint-disable-file MD033 -->

<table>
<colgroup>
<col style="width: 25%" />
<col style="width: 75%" />
</colgroup>
<thead>
<tr class="header">
<th>Stages</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>knife bootstrap</strong></td>
<td>Enter the <code>knife bootstrap</code> subcommand from a workstation. Include the hostname, IP address, or FQDN of the target node as part of this command. Knife will establish an SSH or WinRM connection with the target system and run a bootstrap script.</td>
</tr>
<tr>
<td><p><strong>Get the install script from Chef</strong></p></td>
<td><p>The shell script will make a request to the Chef website to get the most recent version of a the Chef Infra Client install script(<code>install.sh</code> or <code>install.ps1</code>).</td>
</tr>
<tr>
<td><strong>Get the Chef Infra Client package from Chef</strong></td>
<td>The install script then gathers system-specific information and determines the correct package for Chef Infra Client, and then downloads the appropriate package from <code>omnitruck-direct.chef.io</code>.</td>
</tr>
<tr>
<td><strong>Install Chef Infra Client</strong></td>
<td>Chef Infra Client is installed on the target node using a system native package (.rpm, .msi, etc).</td>
</tr>
<tr>
<td><p><strong>Start a Chef Infra Client run</strong></p></td>
<td><p>On UNIX and Linux-based machines: The second shell script executes the <code>chef-client</code> binary with a set of initial settings stored within <code>first-boot.json</code> on the node. <code>first-boot.json</code> is generated from the workstation as part of the initial <code>knife bootstrap</code> subcommand.</p>
<p>On Windows machines: The batch file that's derived from the windows-chef-client-msi.erb bootstrap template executes the <code>chef-client</code> binary with a set of initial settings stored within <code>first-boot.json</code> on the node. <code>first-boot.json</code> is generated from the workstation as part of the initial <code>knife bootstrap</code> subcommand.</p></td>
</tr>
<tr>
<td><p><strong>Complete a Chef Infra Client run</strong></p></td>
<td><p>a Chef Infra Client run proceeds, using HTTPS (port 443), and registers the node with the Chef Infra Server.</p>
<p>The first Chef Infra Client run, by default, contains an empty run-list. A <a href="/workstation/knife_bootstrap/">run-list can be specified</a> as part of the initial bootstrap operation using the <code>--run-list</code> option as part of the <code>knife bootstrap</code> subcommand.</p></td>
</tr>
</tbody>
</table>
When you run `knife bootstrap` on a node for the first time, Chef Workstation, Infra Client, and Infra Server handle the following tasks:

1. **Run `knife bootstrap`**

Run the [`knife bootstrap`](/workstation/knife_bootstrap/) subcommand from a workstation. Include the hostname, IP address, or FQDN of the target node as part of this command. Knife establishes an SSH or WinRM connection with the target system and runs the bootstrap script.

By default, the first Chef Infra Client run has an empty run list. You can add a [run list](/run_lists/) to the initial bootstrap operation using the [`--run-list`](/workstation/knife_bootstrap/#node-options) option.

1. **Get the install script**

A shell script gets the most recent version of the [Chef Infra Client install script](/chef_install_script/) (`install.sh` or `install.ps1`) from Chef.

1. **Get the Chef Infra Client package**

The install script gathers system-specific information, determines the correct package for Chef Infra Client, and downloads that package from Chef's downloads API.

1. **Install Chef Infra Client**

Chef Infra Client is installed on the target node using a system native package (.rpm, .msi, etc).

1. **Start a Chef Infra Client run**

When you first run `knife bootstrap`, Chef Workstation creates a `first-boot.json` file with some initial settings.

On UNIX and Linux-based machines, the second shell script executes the `chef-client` binary with the `first-boot.json` file on the node.

On Windows machines, the batch file that's derived from the `windows-chef-client-msi.erb` bootstrap template executes the `chef-client` binary with the `first-boot.json` file on the node.

1. **Complete the Chef Infra Client run**

The Chef Infra Client run proceeds using HTTPS (port 443) and registers the node with Chef Infra Server.
Loading