Skip to content

Commit c603197

Browse files
authored
Merge pull request #3510 from replicatedhq/128361
Add ConfigValues reference topic
2 parents 4e08a58 + fd5b66b commit c603197

File tree

8 files changed

+158
-12
lines changed

8 files changed

+158
-12
lines changed

docs/enterprise/installing-embedded-automation.mdx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import ConfigValuesExample from "../partials/configValues/_configValuesExample.mdx"
22
import ConfigValuesProcedure from "../partials/configValues/_config-values-procedure.mdx"
3+
import ConfigValuesRequirements from "../partials/configValues/_requirements.mdx"
34

45
# Automate Installation with Embedded Cluster
56

@@ -13,12 +14,18 @@ With headless installation, you provide all the necessary installation assets, s
1314

1415
## Prerequisite
1516

16-
Create a ConfigValues YAML file to define the configuration values for the application release. The ConfigValues file allows you to pass the configuration values for an application from the command line with the install command, rather than through the Admin Console UI. For air-gapped environments, ensure that the ConfigValues file can be accessed from the installation environment.
17+
Create a ConfigValues resource to define the configuration values for the application. The ConfigValues resource allows you to pass the configuration values for an application from the command line with the install command, rather than through the Admin Console UI. For air-gapped environments, ensure that the ConfigValues file can be accessed from the installation environment.
1718

18-
The KOTS ConfigValues file includes the fields that are defined in the KOTS Config custom resource for an application release, along with the user-supplied and default values for each field, as shown in the example below:
19+
The ConfigValues resource includes the fields that are defined in the Replicated KOTS Config custom resource for the release, along with the user-supplied and default values for each field, as shown in the example below:
1920

2021
<ConfigValuesExample/>
2122

23+
#### ConfigValues Requirements
24+
25+
<ConfigValuesRequirements/>
26+
27+
For more information, see [ConfigValues](/reference/custom-resource-configvalues).
28+
2229
## Limtiation
2330

2431
Automating deployment with Embedded Cluster is supported only for the initial installation. Performing automated (headless) updates of existing installations with Embedded Cluster is not supported. For information about how to update an existing installation through the Admin Console UI, see [Perform Updates in Embedded Clusters](/enterprise/updating-embedded).

docs/enterprise/installing-existing-cluster-automation.mdx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import ConfigValuesExample from "../partials/configValues/_configValuesExample.mdx"
2-
import ConfigValuesProcedure from "../partials/configValues/_config-values-procedure.mdx"
2+
import ConfigValuesRequirements from "../partials/configValues/_requirements.mdx"
33
import PlaceholdersGlobal from "../partials/install/_placeholders-global.mdx"
44
import PlaceholderAirgapBundle from "../partials/install/_placeholder-airgap-bundle.mdx"
55
import PlaceholderNamespaceExisting from "../partials/install/_placeholder-namespace-existing.mdx"
@@ -39,13 +39,17 @@ The following shows an example of the output from the kots install command:
3939

4040
## Prerequisite
4141

42-
Create a ConfigValues YAML file to define the configuration values for the application release. The ConfigValues file allows you to pass the configuration values for an application from the command line with the install command, rather than through the Admin Console UI. For air-gapped environments, ensure that the ConfigValues file can be accessed from the installation environment.
42+
Create a ConfigValues resource to define the configuration values for the application. The ConfigValues resource allows you to pass the configuration values for an application from the command line with the install command, rather than through the Admin Console UI. For air-gapped environments, ensure that the ConfigValues file can be accessed from the installation environment.
4343

44-
The KOTS ConfigValues file includes the fields that are defined in the KOTS Config custom resource for an application release, along with the user-supplied and default values for each field, as shown in the example below:
44+
The ConfigValues resource includes the fields that are defined in the Replicated KOTS Config custom resource for the release, along with the user-supplied and default values for each field, as shown in the example below:
4545

4646
<ConfigValuesExample/>
4747

48-
<ConfigValuesProcedure/>
48+
#### ConfigValues Requirements
49+
50+
<ConfigValuesRequirements/>
51+
52+
For more information, see [ConfigValues](/reference/custom-resource-configvalues).
4953

5054
## Online (Internet-Connected) Installation
5155

docs/partials/configValues/_configValuesExample.mdx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@ apiVersion: kots.io/v1beta1
33
kind: ConfigValues
44
spec:
55
values:
6-
text_config_field_name:
7-
default: Example default value
8-
value: Example user-provided value
9-
boolean_config_field_name:
6+
config_item_name:
7+
default: example_default_value
8+
value: example_value
9+
boolean_config_item_name:
1010
value: "1"
11-
password_config_field_name:
12-
valuePlaintext: examplePassword
11+
password_config_item_name:
12+
valuePlainText: exampleplaintextpassword
13+
select_one_config_item_name:
14+
default: default_option_name
15+
value: selected_option_name
1316
```
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
The ConfigValues resource must meet the following requirements:
2+
* Must be valid YAML.
3+
* It is not necessary to set a `value` for each configuration item in the ConfigValues, unless the item is [`required`](/reference/custom-resource-config#required) and has no [`default`](/reference/custom-resource-config#default) set in the Config resource.
4+
* For any configuration items of type [`password`](/reference/custom-resource-config#password) defined in the Config resource, set the value in plain text in the ConfigValues [`valuePlainText`](/reference/custom-resource-configvalues#valueplaintext) property rather than in the `value` property. For example, `valuePlainText: somesecretvalue`. Values set in `valuePlainText` are automatically encrypted during installation.
5+
* All values must be strings. For booleans, integers, or floats, wrap the value in quotes (for example, `value: "1"`, `value: "0"`, or `value: "443"`).
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
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+
![Config fields mapped from Config resource to ConfigValues resource](/images/configvalues-diagram.png)
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+
![valuesPlainText field in ConfigValues](/images/configvalues-plaintext.png)
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/>

sidebars.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ const sidebars = {
335335
'reference/custom-resource-about',
336336
'reference/custom-resource-application',
337337
'reference/custom-resource-config',
338+
'reference/custom-resource-configvalues',
338339
'reference/custom-resource-helmchart-v2',
339340
'reference/custom-resource-helmchart',
340341
'reference/custom-resource-lintconfig',
99.2 KB
Loading
82.3 KB
Loading

0 commit comments

Comments
 (0)