more updates to envRefs in template docs

pull/765/head
Scott Anderson 2020-02-19 15:37:41 -07:00
parent cb5e5f3c0f
commit 8b84f1ef54
1 changed files with 22 additions and 20 deletions

View File

@ -115,22 +115,26 @@ influx pkg export all \
After exporting a template manifest, replace resource names with **environment references** After exporting a template manifest, replace resource names with **environment references**
to let users customize resource names when installing your template. to let users customize resource names when installing your template.
In your template manifest, replace a [supported resource field](#resource-fields-that-support-environment-references) 1. [Export a template](#export-a-template)
with an `envRef` object. 2. Select any of the following resource fields to update:
A `envRef` object contains a single `key` property.
`key` is a string that references the key of a key-value pair a user should
provide when installing the template.
During installation, the `envRef` object is replaced by the value of the
referenced key-value pair.
If the user does not provide the environment reference key-value pair, InfluxDB
uses the `key` string as the default value.
{{< code-tabs-wrapper >}} - `metadata.name`
{{% code-tabs %}} - `associations[].name`
- `endpointName` _(unique to `NotificationRule` resources)_
3. Replace the resource field value with an `envRef` object with a `key` property
that reference the key of a key-value pair the user provides when installing the template.
During installation, the `envRef` object is replaced by the value of the
referenced key-value pair.
If the user does not provide the environment reference key-value pair, InfluxDB
uses the `key` string as the default value.
{{< code-tabs-wrapper >}}
{{% code-tabs %}}
[YAML](#) [YAML](#)
[JSON](#) [JSON](#)
{{% /code-tabs %}} {{% /code-tabs %}}
{{% code-tab-content %}} {{% code-tab-content %}}
```yml ```yml
apiVersion: influxdata.com/v2alpha1 apiVersion: influxdata.com/v2alpha1
kind: Bucket kind: Bucket
@ -139,8 +143,8 @@ metadata:
envRef: envRef:
key: bucket-name-1 key: bucket-name-1
``` ```
{{% /code-tab-content %}} {{% /code-tab-content %}}
{{% code-tab-content %}} {{% code-tab-content %}}
```json ```json
{ {
"apiVersion": "influxdata.com/v2alpha1", "apiVersion": "influxdata.com/v2alpha1",
@ -154,8 +158,8 @@ metadata:
} }
} }
``` ```
{{% /code-tab-content %}} {{% /code-tab-content %}}
{{< /code-tabs-wrapper >}} {{< /code-tabs-wrapper >}}
Using the example above, users are prompted to provide a value for `bucket-name-1` Using the example above, users are prompted to provide a value for `bucket-name-1`
when [installing the template](/v2.0/influxdb-templates/use/#install-templates). when [installing the template](/v2.0/influxdb-templates/use/#install-templates).
@ -176,9 +180,7 @@ exist in the template and what keys to use to replace them._
#### Resource fields that support environment references #### Resource fields that support environment references
Only the following fields support environment references: Only the following fields support environment references:
- `metadata.name`
- `associations[].name`
- `endpointName` _(unique to `NotificationRule` resources)_
{{% /note %}} {{% /note %}}
## Share your InfluxDB templates ## Share your InfluxDB templates