Generate KOTS application ConfigValues file

The ConfigValues resource is a KOTS custom resource that contains configuration values for application releases. This file enables automation of KOTS-based installations, including Embedded Cluster and kURL deployments.

File Structure

The ConfigValues resource follows this YAML structure:

apiVersion: kots.io/v1beta1
kind: ConfigValues
spec:
  values:
    <field1_name>:
      value: <value>
    <field2_name>:
      value: <value>

Creating this file manually can be time-consuming for applications with extensive configuration options. The following methods can help generate ConfigValues files more efficiently.

Generating ConfigValues from Existing Installation

If you already have a KOTS installation running, you can extract the current configuration using either the CLI or Admin Console.

Using KOTS CLI

Extract the current configuration with this command:

kubectl kots get config -n <namespace> --current --appslug <app-slug> > config-values.yaml

Using Admin Console UI

Navigate to the View files tab in the Admin Console, then locate the configuration at upstream > userdata > config.yaml in the file tree.

Generating ConfigValues Without Existing Installation

When you don’t have an existing installation, you can still generate a template ConfigValues file using the KOTS CLI.

Pull Application manifests

Run the following command to pull the application manifests:

kubectl kots pull <app-slug>/<channel> --license-file license.yaml --shared-password <random-password>

This command may produce an error if required configuration values are missing:

  • Pulling upstream ✓  
  • Rendering KOTS custom resources ✓  
Error: failed to pull: version needs config

Despite the error, the command creates a folder named <app-slug> containing the application files.

Extract Default Configuration

Retrieve the default ConfigValues template from the generated folder:

cat <app-slug>/upstream/userdata/config.yaml

Copy this file to a new location and modify it with your required configuration values before using it in automated installations.