bottlerocket-os / bottlerocket

An operating system designed for hosting containers
https://bottlerocket.dev
Other
8.69k stars 512 forks source link

Metal: Include required files in the image at build time #2225

Open zmrow opened 2 years ago

zmrow commented 2 years ago

Metal images require a few extra files (net.toml, user-data.toml, and bootconfig.data) to be provisioned to boot and properly function. I'd like the ability to build an image which includes these files on the BOTTLEROCKET-PRIVATE partition. Doing this makes provisioning machines a single step: write the image.

The locations of the files could be passed to Buildsys as environment variables in the cargo make command, i.e. cargo make -e BUILDSYS_NET_CONFIG=net.toml ....

Another less desirable option is to have default locations for these files (root of the repo) and automatically build them into the image if the files exist, but automatically and implicitly including these files configures the image which could cause confusion and big problems.

bcressey commented 2 years ago

A better approach here might be the tool that @webern has pitched to allow for modifications of an existing image.

We could support operations like:

shahaf600 commented 2 years ago

@zmrow we would love the same feature as you.

We are using PXE in order to load OS on bare metal nodes. It is not clear to me how to apply the docs of provisioning on metal.

webern commented 2 years ago

A better approach here might be the tool that @webern has pitched to allow for modifications of an existing image.

We could support operations like:

  • modifying root.json to allow an existing image to pull from different repositories
  • adding files like user-data.toml to the private partition
  • resigning kernel and bootloaders for Secure Boot

I created an issue to track this idea #2486