import ConfigValuesExample from "../partials/configValues/_configValuesExample.mdx" import ConfigValuesRequirements from "../partials/configValues/_requirements.mdx" import GetConfigValues from "../partials/configValues/_config-values-procedure.mdx"
This topic describes the Replicated KOTS ConfigValues resource. ConfigValues is used to set application configuration values during automated or headless installations from the command line.
For information about the Replicated KOTS Config custom resource, which is used to customize the application-specific configuration fields on the Admin Console config screen, see Config.
The ConfigValues resource lists the values and defaults for each application configuration item defined in the Replicated KOTS Config resource in the release.
In automated or headless installations, end users provide a ConfigValues resource with the install command to set the application configuration values from the command line rather than through the Admin Console UI. For more information about performing headless installations with Replicated Embedded Cluster, see Automate Embedded Cluster Installations. For information about performing headless installations with KOTS in an existing cluster, see Install with the KOTS CLI.
Additionally, for each installation, the Admin Console automatically generates a ConfigValues resource and makes it available for download in the Admin Console View files tab or with the kots get config command. For more information, see Download the ConfigValues for an Installation below.
The following image shows how application configuration items defined a Config resource map to a ConfigValues resource:
View a larger version of this image
As shown in the image above, the values key in the ConfigValues resource lists each item from the Config resource by its name. For each item, the ConfigValues resource lists the user-supplied value as well as the default that was defined in the Config resource (if applicable).
Replicated template functions are not supported in the ConfigValues resource. To set an application configuration item to a value rendered by a template function, you can use a template function in the default or value property for the item in the Config resource.
For more information about working with Replicated template functions, see About Replicated Template Functions.
The item's default value, as defined in the Config custom resource in the release.
apiVersion: kots.io/v1beta1
kind: ConfigValues
spec:
values:
certificate_source:
default: generate_internal
deploy_postgres:
default: "1"
value: "0"
service_type:
default: cluster_ip
value: node_port
node_port_port:
default: "443"
value: "3000" The user-supplied value for the application configuration item.
apiVersion: kots.io/v1beta1
kind: ConfigValues
spec:
values:
slack_clientid:
value: T057KR02S
slackernews_domain:
value: hello.ingress.replicatedcluster.com
slackernews_admin_user_emails:
value: mandy@nitflex.com, jeff@nitflex.com, anil@nitflex.com
service_type:
value: node_port
node_port_port:
value: "443" :::note
In the ConfigValues resource that is automatically generated by the Admin Console as part of installation, the value property might also be set to one of the following:
- A value rendered by a Replicated template function. For example, a
hiddenitem defined in the Config resource could use the Replicated RandomString template function to set the value withvalue: repl{{ RandomString 40}}. In this case, the value for the item in the ConfigValues would be generated by the template function and not user-supplied. For more information about using Replicated template functions, see About Replicated Template Functions. - An encrypted empty string. For any
passwordconfiguration items without a user-supplied value, the Admin Console sets the value to an empty string. In the ConfigValues generated for the installation, this empty string is automatically encrypted. - An empty mapping (
{}). For configuration items without a user-suppliedvalueor adefaultset, the value is set to{}. :::
A plain text value. For any configuration items of type password, the password must be provided in plain text in a valuePlaintext property rather than in the value property.
During installation, the Admin Console encrypts the values set in valuePlaintext. In the ConfigValues resource that is automatically generated as part of installation, these encrypted values are saved in value properties. The image below shows how a valuePlaintext value is encrypted and added to a value property during installation:
View a larger version of this image
apiVersion: kots.io/v1beta1
kind: ConfigValues
spec:
values:
slack_bot_token:
valuePlaintext: examplebottoken
slack_clientsecret:
valuePlaintext: exampleclientsecret
slack_user_token:
valuePlaintext: exampleusertokenFor each installation, the Admin Console automatically generates a ConfigValues resource and makes it available for download in the Admin Console View files tab or with the kots get config command.

