|
| 1 | +import ConfigValuesExample from "../partials/configValues/_configValuesExample.mdx" |
| 2 | +import ConfigValuesRequirements from "../partials/configValues/_requirements.mdx" |
| 3 | +import GetConfigValues from "../partials/configValues/_config-values-procedure.mdx" |
| 4 | + |
| 5 | +# ConfigValues |
| 6 | + |
| 7 | +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. |
| 8 | + |
| 9 | +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](custom-resource-config). |
| 10 | + |
| 11 | +## Overview |
| 12 | + |
| 13 | +The ConfigValues resource lists the values and defaults for each application configuration item defined in the Replicated KOTS [Config](custom-resource-config) resource in the release. |
| 14 | + |
| 15 | +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](/enterprise/installing-embedded-automation). For information about performing headless installations with KOTS in an existing cluster, see [Install with the KOTS CLI](/enterprise/installing-existing-cluster-automation). |
| 16 | + |
| 17 | +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`](/reference/kots-cli-get-config) command. For more information, see [Download the ConfigValues for an Installation](#download) below. |
| 18 | + |
| 19 | +The following image shows how application configuration items defined a Config resource map to a ConfigValues resource: |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | +[View a larger version of this image](/images/configvalues-diagram.png) |
| 24 | + |
| 25 | +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). |
| 26 | + |
| 27 | +## Example |
| 28 | + |
| 29 | +<ConfigValuesExample/> |
| 30 | + |
| 31 | +## Requirements |
| 32 | + |
| 33 | +<ConfigValuesRequirements/> |
| 34 | + |
| 35 | +## Limitation |
| 36 | + |
| 37 | +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](custom-resource-config) resource. |
| 38 | + |
| 39 | +For more information about working with Replicated template functions, see [About Template Functions](/reference/template-functions-about). |
| 40 | + |
| 41 | +## Spec |
| 42 | + |
| 43 | +### values.[item_name].default |
| 44 | + |
| 45 | +The item's default value, as defined in the [Config](custom-resource-config) custom resource in the release. |
| 46 | + |
| 47 | +#### Example |
| 48 | + |
| 49 | +```yaml |
| 50 | +apiVersion: kots.io/v1beta1 |
| 51 | +kind: ConfigValues |
| 52 | +spec: |
| 53 | + values: |
| 54 | + certificate_source: |
| 55 | + default: generate_internal |
| 56 | + deploy_postgres: |
| 57 | + default: "1" |
| 58 | + value: "0" |
| 59 | + service_type: |
| 60 | + default: cluster_ip |
| 61 | + value: node_port |
| 62 | + node_port_port: |
| 63 | + default: "443" |
| 64 | + value: "3000" |
| 65 | +``` |
| 66 | +
|
| 67 | +### values.[item_name].value |
| 68 | +
|
| 69 | +The user-supplied value for the application configuration item. |
| 70 | +
|
| 71 | +#### Example |
| 72 | +
|
| 73 | +```yaml |
| 74 | +apiVersion: kots.io/v1beta1 |
| 75 | +kind: ConfigValues |
| 76 | +spec: |
| 77 | + values: |
| 78 | + slack_clientid: |
| 79 | + value: T057KR02S |
| 80 | + slackernews_domain: |
| 81 | + value: hello.ingress.replicatedcluster.com |
| 82 | + slackernews_admin_user_emails: |
| 83 | + |
| 84 | + service_type: |
| 85 | + value: node_port |
| 86 | + node_port_port: |
| 87 | + value: "443" |
| 88 | +``` |
| 89 | +
|
| 90 | +:::note |
| 91 | +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: |
| 92 | +* A value rendered by a Replicated template function. For example, a [`hidden`](/reference/custom-resource-config#hidden) item defined in the Config resource could use the Replicated [RandomString](/reference/template-functions-static-context#randomstring) template function to set the value with `value: 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 Template Functions](/reference/template-functions-about). |
| 93 | +* An encrypted empty string. For any `password` configuration 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. |
| 94 | +* An empty mapping (`{}`). For configuration items without a user-supplied `value` or a `default` set, the value is set to `{}`. |
| 95 | +::: |
| 96 | + |
| 97 | +### values.[item_name].valuePlainText {#valueplaintext} |
| 98 | + |
| 99 | +A plain text value. For any configuration items of type [`password`](/reference/custom-resource-config#password), the password must be provided in plain text in a `valuePlainText` property rather than in the `value` property. |
| 100 | + |
| 101 | +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: |
| 102 | + |
| 103 | + |
| 104 | + |
| 105 | +[View a larger version of this image](/images/configvalues-plaintext.png) |
| 106 | + |
| 107 | +#### Example |
| 108 | + |
| 109 | +```yaml |
| 110 | +apiVersion: kots.io/v1beta1 |
| 111 | +kind: ConfigValues |
| 112 | +spec: |
| 113 | + values: |
| 114 | + slack_bot_token: |
| 115 | + valuePlainText: examplebottoken |
| 116 | + slack_clientsecret: |
| 117 | + valuePlainText: exampleclientsecret |
| 118 | + slack_user_token: |
| 119 | + valuePlainText: exampleusertoken |
| 120 | +``` |
| 121 | + |
| 122 | +## Download the ConfigValues for an Installation {#download} |
| 123 | + |
| 124 | +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`](/reference/kots-cli-get-config) command. |
| 125 | + |
| 126 | +<GetConfigValues/> |
0 commit comments