Proposal for a Bootc cloud-init Module

Value Statement

As a Cloud Engineer
I want to be able to easily deploy my Bootc OCI images without needing to create VM images
So that I can simplify my build pipelines

Proposal

I have been working on a custom cloud-init module allowing the sysadmin to define their desired target image directly inside the user-data.yml file. This would automatically switch from the current image to the target image on first boot, allowing an organization to have a single EC2 AMI (other cloud providers are available) and rebase/switch during the deployment.

The current code can be found in a draft PR here.

Here's how it looks:

#cloud-config

bootc:
  image: quay.io/myorg/myimage:9.4

When deployed, this will run the bootc switch command as the first step of the Config stage, reboot and continue running the subsequent modules.

All in all, it's about 60 lines of code. Mostly boilerplate code with some simple logic to extract the image name from the YAML and call bootc switch <image>. This could evolve to include enforcing the correct signatures (which IMO should be the default in bootc), or any other options Bootc provides in the future.

Advantages

This provides a simpler "route-to-live" for bootc images, eliminating the need to create AMIs for each and every image you want to deploy. This also allows RedHat to provide a very simple cloud image containing only the necessary dependencies to run a switch onto the user's desired image.

Drawbacks

The primary drawback of this approach is it increases the time taken to reach a working system during deployment. For scenarios where you wish to scale quickly, you would still want to create an AMI for your specific image.

Acceptance Criteria

This proposal is solely to gauge the interest in a bootc cloud-init module, and therefore I am not looking for maintainers to do anything other than provide their opinions on this.

Edited by Robert Sturla