Skip to content

Commit

Permalink
doc: ENT+OSS Bifurcation + Descriptions for System Variables (#4230)
Browse files Browse the repository at this point in the history
* ENT+OSS Bifurcation for scoped variable doc

* Updates + Fixes

* Added Deployment Template in Supported Screens
  • Loading branch information
ashokdevtron authored Nov 10, 2023
1 parent 30349ca commit bfa491b
Showing 1 changed file with 26 additions and 19 deletions.
45 changes: 26 additions & 19 deletions docs/user-guide/global-configurations/scoped-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

In any piece of software or code, variables are used for holding data such as numbers or strings. Variables are created by declaring them, which involves specifying the variable's name and type, followed by assigning it a value.

Devtron offers super-admins the capability to define scoped variables (key-value pairs). It means, while the key remains the same, its value can change depending on the following context:
Devtron offers super-admins the capability to define scoped variables (key-value pairs). It means, while the key remains the same, its value may change depending on the following context:

* **Global**: Variable values will be universally same for everybody in Devtron.
* **Cluster**: Variable values might differ for each Kubernetes cluster.
* **Environment**: Variable values might differ for each environment within a cluster, e.g., staging, dev, prod.
* **Application**: Variable values might differ for each application.
* **Environment + Application**: Variable values might differ for each application on a specific environment.
* **Global**: Variable value will be universally same throughout Devtron.
* **Cluster**: Variable value might differ for each Kubernetes cluster. [![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/elements/EnterpriseTag.svg)](https://devtron.ai/pricing)
* **Environment**: Variable value might differ for each environment within a cluster, e.g., staging, dev, prod. [![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/elements/EnterpriseTag.svg)](https://devtron.ai/pricing)
* **Application**: Variable value might differ for each application. [![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/elements/EnterpriseTag.svg)](https://devtron.ai/pricing)
* **Environment + Application**: Variable value might differ for each application on a specific environment. [![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/elements/EnterpriseTag.svg)](https://devtron.ai/pricing)

**Advantages of using scoped variables**

Expand Down Expand Up @@ -113,7 +113,7 @@ Here's a truncated template containing the specification of two variables for yo

---

## How to Edit an Exiting Scoped Variable
## How to Edit an Existing Scoped Variable

Only a super-admin can edit existing scoped variables.

Expand All @@ -135,7 +135,14 @@ Reuploading the YAML file will replace the previous file, so any variable that e

Once a variable is defined, it can be used by your authorized users on Devtron. A scoped variable widget would appear only on the screens that support its usage.

Currently, the widget is shown only on `Edit build pipeline` and `Edit deployment pipeline` screens under **App Configuration****Workflow Editor**.
Currently, the widget is shown only on the following screens in [App Configuration](../creating-application/README.md):
* Workflow Editor → Edit build pipeline → Pre-build stage (tab)
* Workflow Editor → Edit build pipeline → Post-build stage (tab)
* Workflow Editor → Edit deployment pipeline → Post-Deployment stage (tab)
* Workflow Editor → Edit deployment pipeline → Post-Deployment stage (tab)
* Deployment Template
* ConfigMaps
* Secrets

![Figure 8: Unexpanded Widget](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/global-configurations/scoped-variables/widget1.jpg)

Expand All @@ -157,10 +164,10 @@ It would appear in the following format upon pasting it within an input field: `

When multiple values are associated with a scoped variable, the precedence order is as follows, with the highest priority at the top:

1. Environment + App
2. App
3. Environment
4. Cluster
1. Environment + App [![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/elements/EnterpriseTag.svg)](https://devtron.ai/pricing)
2. App [![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/elements/EnterpriseTag.svg)](https://devtron.ai/pricing)
3. Environment [![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/elements/EnterpriseTag.svg)](https://devtron.ai/pricing)
4. Cluster [![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/elements/EnterpriseTag.svg)](https://devtron.ai/pricing)
5. Global

### Example
Expand All @@ -178,14 +185,14 @@ When multiple values are associated with a scoped variable, the precedence order

## List of Predefined Variables

There are some variables that exist by default in Devtron that you can readily use if needed:
There are some system variables that exist by default in Devtron that you can readily use if needed:

* DEVTRON_NAMESPACE
* DEVTRON_CLUSTER_NAME
* DEVTRON_ENV_NAME
* DEVTRON_IMAGE_TAG
* DEVTRON_IMAGE
* DEVTRON_APP_NAME
* **DEVTRON_NAMESPACE**: Provides name of the [namespace](../../reference/glossary.md#namespace)
* **DEVTRON_CLUSTER_NAME**: Provides name of the [cluster](../global-configurations/cluster-and-environments.md) configured on Devtron
* **DEVTRON_ENV_NAME**: Provides name of the [environment](../../reference/glossary.md#environment)
* **DEVTRON_IMAGE_TAG**: Provides [image tag](https://docs.docker.com/engine/reference/commandline/tag/) associated with the [container image](../../reference/glossary.md#image)
* **DEVTRON_IMAGE**: Provides full image path of the container image, e.g., `gcr.io/k8s-minikube/kicbase:v0.0.39`
* **DEVTRON_APP_NAME**: Provides name of the [application on Devtron](../create-application.md)

{% hint style="info" %}
Currently, these variables do not appear in the scoped variable widget, but you may use them.
Expand Down

0 comments on commit bfa491b

Please sign in to comment.