Add support for bootc images in lifecycle-agent#815
Add support for bootc images in lifecycle-agent#815omertuc wants to merge 1 commit intoopenshift-kni:mainfrom
Conversation
|
Skipping CI for Draft Pull Request. |
# Background / Context With openshift-kni/lifecycle-agent#815 we can generate seed images that are also bootc images. Using a simple `Containerfile`, we can FROM these images, add a cluster configuration, and get a fully bootable cluster # Issue / Requirement / Reason for change This Containerfile needs to be written manually # Solution / Feature Overview The installer can help the user write this Containerfile. # Implementation Details We add a new subcommand, `containerfile`, to the `image-based create` command. This command is similar to the config-image command, but instead of generating an ISO, it generates a Containerfile that can be used to build the configured-seed image. # Other Information - The installer does not actually build the image, this is left to the user. The installer only generates the Containerfile. - The Containerfile currently needs to extract the tars. This is unnecessary, the lifecycle-agent should already do that during the seed build. There's no point in having those tars inside the image. - Changed some other unrelated IBI code to leverage Go's `embed`
# Background / Context Currently, LCA creates a seed image that is simply a bunch of files inside an empty container. Then during the deployment from a seed image LCA uses ostree-ext to pull the RHCOS container image corresponding to the seed image, creates a new stateroot from it, and then unpacks the seed image contents on top of that new stateroot. # Issue / Requirement / Reason for change We do not leverage bootc for this, which could simplify some things and allow new possibilities. # Solution / Feature Overview Following recent changes in bootc, we could now instead use bootc to install the seed image directly to a new stateroot. This PR adds a new possible `SeedGenerator` CR annotation `unsupported-experimental.lca.openshift.io/use-bootc` that accepts only the value `Use`. If this annotation is present with this value, LCA will generate a seed image that is a valid bootc image. LCA will label the resulting image (at the OCI level) with a special label that identifies it as a bootc seed image. Then, during deployment, LCA will check if the image is a bootc seed image (by inspecting said label) and if so, it will use bootc to install the seed image directly to a new stateroot. # Implementation Details Nothing complicated, just new code paths # Other Information This is still experimental and unsupported, hence the label name. We should do some heavy testing and develop this further before letting anyone use it in production. Those bootc seed images can also be used with IBI using a simple Containerfile that adds the cluster configuration to the seed image, which will allow users to configure a cluster using a Containerfile and then simply switch to it like any other bootc image.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@omertuc: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Background / Context
Currently, LCA creates a seed image that is simply a bunch of files inside an empty container. Then during the deployment from a seed image LCA uses ostree-ext to pull the RHCOS container image corresponding to the seed image, creates a new stateroot from it, and then unpacks the seed image contents on top of that new stateroot.
Issue / Requirement / Reason for change
We do not leverage bootc for this, which could simplify some things and allow new possibilities.
Solution / Feature Overview
Following recent changes in bootc, we could now instead use bootc to install the seed image directly to a new stateroot.
This PR adds a new possible
SeedGeneratorCR annotationunsupported-experimental.lca.openshift.io/use-bootcthat accepts only the valueUse. If this annotation is present with this value, LCA will generate a seed image that is a valid bootc image. LCA will label the resulting image (at the OCI level) with a special label that identifies it as a bootc seed image.Then, during deployment, LCA will check if the image is a bootc seed image (by inspecting said label) and if so, it will use bootc to install the seed image directly to a new stateroot.
Implementation Details
Nothing complicated, just new code paths
Other Information
This is still experimental and unsupported, hence the label name. We should do some heavy testing and develop this further before letting anyone use it in production.
Those bootc seed images can also be used with IBI using a simple Containerfile that adds the cluster configuration to the seed image, which will allow users to configure a cluster using a Containerfile and then simply switch to it like any other bootc image.