Skip to main content
Skip table of contents

AWS Konvoy Image Builder

You must have at least one image before creating a new cluster. As long as you have an image, this step in your configuration is not required each time since that image can be used to spin up a new cluster. However, if you need different images for different environments or providers, you will need to create a new custom image.

The following section describes how to use Konvoy Image Builder (KIB) with Amazon Web Services (AWS). There are two options:

Konvoy Image Builder has a more detailed section in the documentation if you need to refer there for compatible versions with DKP and other specific information.

Learn how to build a custom AMI for use with DKP

This procedure describes how to use the Konvoy Image Builder (KIB) to create a Cluster API compliant Amazon Machine Image (AMI). KIB uses variable overrides to specify base image and container images to use in your new AMI.

In previous DKP releases, AMI images provided by the upstream CAPA project would be used if you did not specify an AMI. However, the upstream images are not recommended for production and may not always be available.   Therefore, DKP now requires you to specify an AMI when creating a cluster. To create an AMI, use Konvoy Image Builder.

Prerequisites

Before you begin, you must:

Extract KIB Bundle

Extract the bundle and cd into the extracted konvoy-image-bundle-$VERSION folder. The bundled version of konvoy-image contains an embedded docker image that contains all the requirements for building.

The konvoy-image binary and all supporting folders are also extracted. When run, konvoy-image bind mounts the current working directory (${PWD}) into the container to be used.

  • Set environment variables for AWS access. The following variables must be set using your credentials including required IAM:

    CODE
    export AWS_ACCESS_KEY_ID
    export AWS_SECRET_ACCESS_KEY
    export AWS_DEFAULT_REGION
  • If you have an override file to configure specific attributes of your AMI file, add it.

1. Create a Custom AMI

Depending on which version of DKP you are running, steps and flags will be different. To deploy in a region where CAPI images are not provided, you need to use KIB to create your own image for the region. For a list of supported AWS regions, refer to the Published AMI information from AWS.

Execute the following to begin image creation:

Run the konvoy-image command to build and validate the image.

CODE
konvoy-image build aws images/ami/centos-79.yaml

By default it builds in the us-west-2 region. to specify another region set the --region flag:

CODE
konvoy-image build aws --region us-east-1 images/ami/centos-79.yaml

Ensure you have named the correct YAML file for your OS in the konvoy-image build command.

After KIB provisions the image successfully, the ami id is printed and written to the manifest.json file. This file has an artifact_id field whose value provides the name of the AMI ID as shown in the example below:

CODE
{
      "name": "rhel-7.9-fips",
      "builder_type": "amazon-ebs",
      "build_time": 1659486130,
      "files": null,
      "artifact_id": "us-west-2:ami-0f2ef742482e1b829",
      "packer_run_uuid": "0ca500d9-a5f0-815c-6f12-aceb4d46645b",
      "custom_data": {
        "containerd_version": "",
        "distribution": "RHEL",
        "distribution_version": "7.9",
        "kubernetes_cni_version": "",
        "kubernetes_version": "1.26.14+fips.0"
      }
    }

To use a custom AMI when creating your cluster, you must create that AMI using KIB first. Then perform the export and name the custom AMI for use in the command dkp create cluster

CODE
export AWS_AMI_ID=ami-<ami-id-here>

2. Air-gapped AMI

Create an Image using Konvoy Image Builder (KIB) for use in an air-gapped cluster

Prerequisites

The default AWS image is not recommended for use in production. We suggest using Konvoy Image Builder to create an AWS Air-gapped AMI to take advantage of enhanced cluster operations. Explore the KIB with AWS topics for more options.

Using KIB, you can build an AMI without requiring access to the internet by providing an additional --override flag.

  1. Assuming you have downloaded dkp-air-gapped-bundle_v2.6.2_linux_amd64.tar.gz , extract the tarball to a local directory:

    CODE
    tar -xzvf dkp-air-gapped-bundle_v2.6.2_linux_amd64.tar.gz && cd dkp-v2.6.2/kib
  2. Follow the instructions below to build an AMI.

Depending on which version of DKP you are running, steps and flags will be different. To deploy in a region where CAPI images are not provided, you need to use KIB to create your own image for the region. For a list of supported AWS regions, refer to the Published AMI information from AWS.

Execute the following to begin image creation:

Run the konvoy-image command to build and validate the image.

CODE
konvoy-image build aws images/ami/centos-79.yaml --overrides overrides/offline.yaml

By default it builds in the us-west-2 region. to specify another region set the --region flag:

CODE
konvoy-image build aws --region us-east-1 images/ami/centos-79.yaml --overrides overrides/offline.yaml

When the command is complete the ami id is printed and written to ./manifest.json.

Next Step:

Minimal Permissions and Role to Create Clusters

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.