From bfa491b25e36c3b5dfb21d3e19f396fbebdcfa46 Mon Sep 17 00:00:00 2001 From: ashokdevtron <141001279+ashokdevtron@users.noreply.github.com> Date: Fri, 10 Nov 2023 19:23:55 +0530 Subject: [PATCH] doc: ENT+OSS Bifurcation + Descriptions for System Variables (#4230) * ENT+OSS Bifurcation for scoped variable doc * Updates + Fixes * Added Deployment Template in Supported Screens --- .../global-configurations/scoped-variables.md | 45 +++++++++++-------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/docs/user-guide/global-configurations/scoped-variables.md b/docs/user-guide/global-configurations/scoped-variables.md index cb339adad5..055a1f949b 100644 --- a/docs/user-guide/global-configurations/scoped-variables.md +++ b/docs/user-guide/global-configurations/scoped-variables.md @@ -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** @@ -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. @@ -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) @@ -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 @@ -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.