Oracle Cloud Infrastructure Compute Images

Describes OCK images used to create Kubernetes nodes on Oracle Cloud Infrastructure.

Creating clusters with the Oracle Cloud Infrastructure provider requires a custom compute image in the target compartment. The bootable container image must be customized to work in Oracle Cloud Infrastructure, and must be converted into an appropriate format. After an appropriate image has been created, it must be imported to the target compartment.

Images can be created using the ocne image create command with the --type oci option. 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.

The resulting image can be imported into Oracle Cloud Infrastructure using the ocne image upload command, and used as the boot volume for compute instances. When you use the ocne image upload command to upload a Qcow2 image, the conversion to the appropriate format is performed automatically.

The image is uploaded to an Oracle Cloud Infrastructure Object Storage bucket. After the upload is complete, the object is imported as a custom compute image.

Note:

The object in the bucket isn't automatically removed, and must be cleaned up manually.

The custom image can then be used to create compute instances for a Kubernetes cluster.

Creating an OCK Image for the Oracle Cloud Infrastructure Provider

Create an Oracle Container Host for Kubernetes (OCK) image for the Oracle Cloud Infrastructure (oci) provider. Then upload the image to Oracle Cloud Infrastructure so it an be used as the boot disk for compute instances.

  1. Set up the Oracle Cloud Infrastructure provider.

    For information on setting up the provider, see Setting Up the Oracle Cloud Infrastructure Provider.

  2. (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.

  3. Create an OCK image.

    Use the ocne image create command to create an OCK image for Oracle Cloud Infrastructure. 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 oci --arch amd64

    The Kubernetes cluster is used to generate the Qcow2 image, and the image is saved to the $HOME/.ocne/images/ directory.

  4. Upload the OCK image to Oracle Cloud Infrastructure.

    Use the ocne image upload command to upload the image to Oracle Cloud Infrastructure. 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 --compartment ocid1.compartment.oc1..UniqueID --file $HOME/.ocne/images/boot.qcow2-1.30-amd64.oci --arch amd64

    The Kubernetes cluster is used to upload the Qcow2 image. The image is uploaded to the Object Bucket store, and then automatically converted to a custom compute image. The image can now be used to create Oracle Cloud Infrastructure instances to use in a Kubernetes cluster.

    Tip:

    Sign in to the Oracle Cloud Infrastructure console to monitor the upload of the image to the Object Bucket store, and the creation of a custom compute image.