Skip to main content
Skip table of contents

Image Overrides

When using KIB to create an OS image that is compliant with DKP, the parameters for building and configuring the image are included in the file located in images/<builder-type>/<os-version.yaml where <builder-type> is infrastructure provider specific such as ami or ova.

Run the command for those files:

CODE
./konvoy-image build images/<builder-type>/{os}-{version}.yaml
Azure only

Azure also requires additional flags: --client-id --tenant-id as defined in Using KIB with Azure.

The YAML for each provider and OS is also located in GitHub.

Although there are several parameters specified by default in the Packer templates for each provider, it is possible to override the default values with flags and override files.

Using Flags

To execute KIB with specific flags to override the following values:

  1. the source AMI (--source-ami)

  2. AMI region (--ami-regions)

  3. AWS EC2 instance type (--aws-instance-type)

For a comprehensive list of these flags, please run:

CODE
./konvoy-image build --help

Using Override Files

Another option is by creating a file with the parameters to be overridden and specify the --overrides flag as shown below:

CODE
./konvoy-image build images/<builder-type>/<os>-<version>.yaml --overrides overrides.yaml

While CLI flags can be used in combination with override files, CLI flags take priority over any override files.

Create a Custom Override Examples

AWS Example:

For example, when using the AWS Packer builder to override an image with another image, create an override file and set the source_ami under the packer key. This overrides the image search and forces the use of the specified source_ami.

Create your AWS override file overrides-source-ami.yaml:

CODE
---
packer:
  source_ami: "ami-0123456789"   

After creating the override file for our source_ami, we can pass our override file by using the --overrides flag when building our image:

CODE
./konvoy-image build aws images/ami/centos-7.yaml --overrides override-source-ami.yaml

vSphere Example:

Create your vSphere overrides file overrides/vcenter.yaml and fill in the relevant details for your vSphere environment:

CODE
---
packer:
  vcenter_server: <FQDN of your vcenter>
  vsphere_username: <username for vcenter e.g. administrator@vsphere.local>
  vsphere_password: <password for vcenter>
  ssh_username: builder
  ssh_password: <password for your VMs builder user>
  linked_clone: false
  cluster: <vsphere cluster to use>
  datacenter: <vsphere datacenter to use>
  datastore: <vsphere datastore to use for templates>
  folder: <vsphere folder to store the template in>
  insecure_connection: "true"
  network: <a DHCP-enabled network in vcenter>
  resource_pool: <vsphere resource pool to use>

After creating the override file for your source_ova, pass your override file by using the --overrides flag when building your image:

CODE
konvoy-image build images/ova/ubuntu-2004.yaml \
  --overrides overrides/kube-version.yaml \
  --overrides overrides/vcenter.yaml

Next Topic

Pre-Provisioned Override Files

JavaScript errors detected

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

If this problem persists, please contact our support.