Skip to content

Commit

Permalink
Mention Namespace variables (#749)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuri1969 authored Jan 5, 2024
1 parent e1ddf51 commit 2bd3580
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
3 changes: 2 additions & 1 deletion content/docs/04.user-interface-guide/09-namespaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ You can click on the **+** icon at the right of a namespace to create it.
![Kestra User Interface Home Page](/docs/user-interface-guide/15-EE-Namespace-Create.png)

After creating a namespace, you can configure it:
- The **Variables** tab allows setting variables scoped to a namespace.

- The **Variables** tab allows setting [variables](../05.developer-guide/03.variables/01.index.md#namespace-variables-ee) scoped to a namespace.
- The **Task defaults** tab allows setting task default scoped to a namespace.
- The **Secrets** tab allows setting secrets accessible via the [secret function](../05.developer-guide/03.variables/04.function/secret.md).
- The **Groups**, **Roles**, and **Access** tabs allow managing role-based access control.
Expand Down
23 changes: 20 additions & 3 deletions content/docs/05.developer-guide/03.variables/01.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ To access an environment variable `KESTRA_FOO` from one of your tasks, you can u

You can define global variables inside Kestra's configuration files and access them using `{{ globals.foo }}`, see [Variables configuration](../../09.administrator-guide/01.configuration/05.others.md#variables-configuration) for more information.


## Flow variables

You can declare variables at the flow level with the `variables` property, then refer to these variables using the `vars.my_variable` syntax, for example:
Expand Down Expand Up @@ -130,9 +129,28 @@ tasks:

Secrets can be provided on both open-source and [Enterprise Edition](https://kestra.io/enterprise). Check the [Secrets](../10.secrets.md) documentation for more details. Also, see the [Administrator Guide](../../09.administrator-guide/01.configuration/03.enterprise-edition/secrets/index.md) for detailed instructions on Secrets Manager configuration.

## Namespace variables (EE)

::alert{type="warning"}
This is an [Enterprise Edition](https://kestra.io/enterprise) feature.
::

Within a namespace it is possible to declare variables scoped to the namespace level. Your flow then refers to these variables using the `namespace.my_variable` syntax, for example:

```yaml
id: context-namespaces
namespace: io.kestra.tests
tasks:
- id: myTask
type: io.kestra.core.tasks.debugs.Return
format: "{{ namespace.my_variable }}"
```

## Outputs variables

You can use any task [output](../05.outputs.md) attributes using `outputs.taskId.outputAttribute` where:

- `taskId` is the ID of the task.
- `outputAttribute` is the attribute of the task output you want to use. Each task output can emit different attributes; refer to the task documentation for the list of output attributes.

Expand All @@ -159,7 +177,6 @@ The `Return` task has an output attribute `value` which is used by the `log-both
In the `log-both-variables` task, you can see two ways to access task outputs: the dot notation (`outputs.firstExample`) and the subscript notation (`outputs['second-example']`). The subscript notation must be used when a variable contains a special character, such as `-` that is a Pebble reserved character.
::


## Pebble templating: example

The example below will parse the Pebble expressions within the `variables` based on the `inputs` and `trigger` values. Both variables use the [Null-Coalescing Operator](02.basic-usage.md#null-coalescing-operator) to use the first non-null value.
Expand Down Expand Up @@ -191,8 +208,8 @@ tasks:
message: "{{ vars.input_or_yesterday }}"
```


## Pebble templating: deep dive

Pebble templating offers a myriad of ways to process variables. For a deep dive, check the following section:

<ChildTableOfContents :max="1" />

0 comments on commit 2bd3580

Please sign in to comment.