AWS Custom AMI
To use a custom AMI when creating your cluster, you must create that AMI using Konvoy Image Builder(KIB) first.
Then perform the export and name the custom AMI for use in the command dkp create cluster
after this step:
export AWS_AMI_ID=ami-<ami-id-here>
IMPORTANT: The AMI must be created with Konvoy Image Builder in order to use the registry mirror feature.
Set the environment variable for the AMI you choose during the dkp create cluster
command. This will output the generated manifest into a new file as shown in the example command:
dkp create cluster aws --cluster-name=${CLUSTER_NAME} \
--ami=${AWS_AMI_ID} \
--dry-run \
--output=yaml \
> ${CLUSTER_NAME}.yaml
This step will be performed during both AWS Install in a Non-air-gapped Environment and AWS Install in an Air-gapped Environment and explained prior to cluster creation on a page in both of those scenarios:
There are two approaches to supplying the ID of your AMI during cluster creation. Either provide the ID of the AMI or provide a way for DKP to discover the AMI using location, format and OS information:
Option One - Provide the ID of your AMI:
Use the example command below leaving the existing flag that provides the AMI ID:
--ami AMI_ID
Option Two - Provide a path for your AMI with the information required for image discover:
Where the AMI is published using your AWS Account ID:
--ami-owner AWS_ACCOUNT_ID
The format or string used to search for matching AMIs and ensure it references the Kubernetes version plus the base OS name:
--ami-base-os ubuntu-20.04
The base OS information:
--ami-format 'example-{{.BaseOS}}-?{{.K8sVersion}}-*'
DKP uses AWS CSI as the default storage provider. You can use a Kubernetes CSI compatible storage solution that is suitable for production. See the Kubernetes documentation called Changing the Default Storage Class for more information.
Run this command to create your Kubernetes cluster using any relevant flags for Option One explained above:
CODEdkp create cluster aws \ --cluster-name=${CLUSTER_NAME} \ --additional-tags=owner=$(whoami) \ --with-aws-bootstrap-credentials=true \ --ami AMI_ID \ --self-managed
OR
Option Two is to run the command as shown from the explanation above:
CODEdkp create cluster aws \ --cluster-name=${CLUSTER_NAME} \ --additional-tags=owner=$(whoami) \ --with-aws-bootstrap-credentials=true \ --ami-owner AWS_ACCOUNT_ID \ --ami-base-os ubuntu-20.04 \ --ami-format 'example-{{.BaseOS}}-?{{.K8sVersion}}-*' \ --self-managed