OSTree Archive Images

Describes custom images in OSTree archive format to create Kubernetes nodes in Bring Your Own clusters.

Custom installations of OCK are done using the Anaconda and Kickstart automatic installation options of Oracle Linux. Anaconda requires OSTree content to be available in a particular format to install onto the root file system of the target host (an OSTree archive served over HTTP). The OCK container image used for updates isn't in this format. To use the content with Anaconda, it must be converted to an archive and made available using an HTTP server.

Images can be created using the ocne image create command with the --type ostree option. The resulting container image is stored in the Open Container Initiative archive format and can be imported to the local cache or pushed to a container registry. Building the container image pulls a base image from within the Kubernetes cluster (this is either the existing cluster set using a kubeconfig file, or an ephemeral cluster that's started for this purpose).

By default, the image is created for the architecture of the system where the command is run. Images can be created for other architectures using the --arch option.

Typically, OSTree archive images are copied to a container registry. You can copy the image to any target that works with the Open Container Initiative transports and formats. See containers-transports(5) for available options.

Creating an OSTree Image for the Bring Your Own Provider

Create an OSTree image for the Bring Your Own (byo) provider. Then upload the image to a container registry so it can be used as the boot disk for Virtual Machines (VMs).

You can load the image into several destinations. This example show you how to load the image into a container registry. For information on setting up a container registry, see Oracle Linux: Podman User's Guide.

You can load the image into any target available with the Open Container Initiative transports and formats. See containers-transports(5) for available options.

  1. (Optional) Set the location of the kubeconfig file for an existing cluster.

    A Kubernetes cluster is required to perform some steps. You can use an existing cluster for this purpose by setting the location of the kubeconfig file.

    You can set this using the KUBECONFIG environment variable, or using the --kubeconfig option with ocne commands. You could also set this in a configuration file.

    If you don't set the location of the kubeconfig file, an ephemeral cluster is created using the libvirt provider when required.

  2. (Optional) Set up the libvirt provider.

    If you don't set the location of an existing Kubernetes cluster, set up the localhost to provision ephemeral clusters using the libvirt provider. For information on setting up the libvirt provider, see Setting Up the libvirt Provider.

  3. Create an OSTree image.

    Use the ocne image create command to create a OSTree image. The syntax is:

    ocne image create 
    {-a|--arch} arch
    [{-t|--type} provider]
    [{-v|--version} version]

    For more information on the syntax options, see Oracle Cloud Native Environment: CLI.

    For example:

    ocne image create --type ostree --arch arm64 

    This command might take some time to complete.

    The Kubernetes cluster generates the OSTree image, and the image is saved to the $HOME/.ocne/images/ directory.

  4. Upload the OSTree image to a container registry.

    Use the ocne image upload command to upload the image to a container registry. The syntax is:

    ocne image upload 
    {-a|--arch} arch
    [{-b|--bucket} name]
    {-c|--compartment} name
    [{-d|--destination} path]
    {-f|--file} path
    {-i|--image-name} name 
    {-t|--type} provider
    {-v|--version} version

    For more information on the syntax options, see Oracle Cloud Native Environment: CLI.

    For example:

    ocne image upload --type ostree --file $HOME/.ocne/images/ock-1.30-amd64-ostree.tar --destination docker://myregistry.example.com/ock-ostree:latest --arch amd64

    The Kubernetes cluster uploads the OSTree image. A sign in prompt is provided if credentials aren't set for the target container registry. The image is uploaded to the container registry. The image can now be used to create VMs to use in a Kubernetes cluster.