Create
Environment templates are a collection of resource templates and static resources that contain environment variables, lifecycle hooks, dependencies, etc. For example, an environment template could represent a full operating environment required for a complex Kubernetes application.
Did you know ?
Environment Templates can be managed through various methods:
- UI
- CLI (RCTL)
- Terraform
- API
- GitOps
Create an Environment Template¶
- In a project, select Environments > Environment Templates.
- Select New Environment Template.
- Type a name for the environment template. Optionally, type a description.
- See below for information about each configuration category.
- Select Save to save the environment template. Click Cancel to close the configuration and go back to the environment template list.
General¶
The environment template new version is created and the General configuration page displays
Setting | Description |
---|---|
Version Name | Enter the version for the resource. Examples: v1, 0.1, 3 |
Name | Enter a name for the resource |
Description | Enter a description for the resource. This is optional |
Labels | Add a label to the resource. Use labels to specify identifying attributes of objects that are meaningful and relevant to users, but do not directly imply semantics to the core system. This is a key-value pair. For example, the key is environment and the value is dev |
Annotations | Annotations can be added to display information such as Category and the IaC source code information for the environment template. For example, if the category of the environment template is 'Developer Productivity', use the key eaas.envmgmt.io/category and the value Developer Productivity. To display the IaC source code information, use the key eaas.envmgmt.io/github |
Resources¶
- Click + Resource to add resource(s) to this environment Template
- Select the Resource Kind. Based on the selection, user can provide the required information
Resource
Setting | Description |
---|---|
Resource Name | Select an existing Resource from the drop-down |
Environment
Setting | Description |
---|---|
Environment Name | Select an existing Environment from the drop-down |
Resource Template
Setting | Description |
---|---|
Resource Template Name | Select an existing Resource Template from the drop-down |
Version | Select the required Resource Template version |
Dedicated | If the resource is dedicated, all of these resources will be created when the workload publish environment trigger is activated |
Depends On | Adding Dependency Value ensure that the resource(s) from the added resource template are deployed first before deploying this resource |
Click Save
Note: When adding a Resource Template to an Environment Template, the resource template with System Provider can include only one cluster kind and one credential kind.
Agents¶
Parameter | Description |
---|---|
Name | Select an agent to associate with this resource |
Config Contexts¶
Setting | Description |
---|---|
Context | Select a Context to associate with this resource |
Upon furnishing the essential details, choose either Save as Active Version or Save as Draft Version
Input Variables¶
- Click + Variable to add variable(s) to this environment Template
Setting | Description |
---|---|
Name | The name of the variable |
Description | A brief description of the variable |
Value | The variable value |
Value Type | The type of value |
-- HCL | Hashicorp configuration language |
-- JSON | JavaScript Object Notation (JSON) is a lightweight data-interchange format |
-- Expressions | Expressions are valid units of code that resolve to a value |
-- Text | Text value |
Override Type | Controls if a user can change a variable or not |
-- Allowed | Allows the user to override the value |
-- Not Allowed | Does not allow the user to override the value |
-- Restricted | Allows the user to override the value by selecting a different, pre-defined value |
Restricted Values | If Restricted is selected for the Override Type, enter the values that are allowed |
Sensitive | Does not display the value in the UI |
Required | The variable is required when using this Context |
Hooks¶
Environment Hooks¶
Setting | Description |
---|---|
On Completion | Set a hook that is triggered when resource creation or updating is complete |
On Failure | Set a hook that is triggered when resource creation or updating fails to complete |
On Init | Set a hook that is triggered when resource creation or updating is initialized |
On Success | Set a hook that is triggered when resource creation or updating is successful |
Hook Types¶
When adding a Resource or Terraform hook, select a hook type and set the appropriate parameters.
Approval¶
Setting | Description |
---|---|
Name | Enter a name for the hook |
Approval Type | Select the approval type. Supported values are: Internal and Email |
-- Internal | |
Agent Name | Select the agent to associate with this hook |
Continue on Failure | Set the hook to run even if the resource creating or updating process fails |
Timeout | Enter a value to set the timeout duration. If the timeout duration is exceeded, the resource creation or updating is terminated |
Container¶
Setting | Description |
---|---|
Name | Enter a name for the container hook |
Container Configuration | |
-- cpuLimitMilli | Specify the CPU Limit to be used by the container |
-- Image | Specify the underlying container image to be used |
-- Memory Limit in MB | Specify the container memory limit to be set (in MB) |
-- Working Directory Path | The working directory for commands to run in |
-- Success Condition | Specify the success condition to be evaluated when a container completes execution |
Arguments | Arguments to the entrypoint. The docker image's CMD is used if this is not provided |
Commands | Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided |
Environment Variables | Provide list of environment variables to set in the container |
Agent Name | Name of the agent responsible for execution |
Continue on Failure | Set the hook to continue execution even in case of failure |
Timeout | Enter a value to set the timeout duration for container execution, if this exceeds container execution will be terminated |
HTTP¶
Setting | Description |
---|---|
Name | Enter a name for the http hook |
HTTP Configuration | |
-- Body | Provide message body which is the data bytes transmitted during an HTTP transaction message |
-- Endpoint | Specify the http endpoint which is a targetable URL to be invoked |
-- Method | Specify the http method e.g. PUT, POST, GET that corresponds to the endpoint provided |
-- Success Condition | Specify the success condition to be evaluated when a http call completes execution |
Headers | Specify additional context and metadata about the request |
Agent Name | Name of the agent responsible for execution |
Continue on Failure | Set the hook to continue execution even in case of failure |
Timeout | Enter a value to set the timeout duration for http call, if this exceeds execution will be terminated |
Driver Hook Type
Driver¶
Setting | Description |
---|---|
Name | Enter a name for the driver hook |
Driver Configuration | |
-- Type | Select the driver type. Supported values are: container, http |
Agent Name | Name of the agent responsible for execution |
Continue on Failure | Set the hook to continue execution even in case of failure |
Timeout | Specify the duration in the Timeout field for HTTP or Container. When a user specifies a timeout in both Hooks and Drivers, the timeout specified in Hooks takes precedence |
Environment Template - Schedules - Coming Soon
Schedules¶
- Click + Schedule to configure tasks such as deployments, resource destruction, or workflows within an environment template.
Setting | Description |
---|---|
Name | Enter the name of the scheduled task |
Description | Provide a description of the task for more context |
Frequency | Define when and how frequently the action will run |
-- Action | - Run once: Executes the task only once at a specified time - Run on schedule: Allows setting up a recurring schedule using a cron expression |
-- Time Zone | Select the time zone from the drop-down where the schedule will operate. By default, it is set to 'UTC', but it can be changed if needed |
-- Cron Expression | Specify timing using a cron expression (Minute, Hour, Day, Month, Week) for fine-grained control over task scheduling - * : Represents any value - , : Lists values - - : Represents a range of values - / : Represents step values |
Actions | Configure what actions will be taken as part of the schedule - Deploy: Schedule a deployment - Destroy: Schedule the destruction of the environment - Workflow: Schedule a workflow execution |
Config context type | Choose the configuration type - Select existing: Choose from existing configuration contexts |
Config context | Select an existing configuration context from drop-down, which determines the parameters under which the selected action will run |
Refer to Schedules for more information
Version Management¶
Upon saving the configurations, users have the ability to review the list of environment templates with versions. To delve into specific version details, click on the corresponding version number.
There are three (3) distinct states for environment template versions:
- Draft
- Active
- Disabled
Users can create a draft version of environment templates and make multiple edits to it during the testing/validation phase. Once it is verified that the template is working as expected, users can transition the status from Draft to Active. However, it's important to note that no further edits can be made to the template in the active status. A new version has to be created for any edits to an Active version. Draft versions are project scoped which means that these versions are not shared with downstream projects (when the template is shared).
If a version of a template needs to be made unavailable for security related reasons or compliance, users can disable it by clicking on the Disable icon. Disabling effectively restricts further use of this version, meaning it can no longer be referenced in any new environments that are created. However, existing environments already using this version will remain unaffected.
Draft Status¶
In the draft status, the following rules apply:
- Inaccessible from shared projects
- Usable within the same project
- Editable multiple times
- Can be marked as active (accessible from shared projects)
- Can be marked as disabled and restored to an active state by enabling
Active Status¶
For versions in the active status:
- Cannot be reverted back to draft from any other state
- Accessible from shared projects
- No further changes allowed
- Can be marked as disabled and restored to an active state by enabling
Disabled Status¶
Versions in the disabled status adhere to the following rules:
- Cannot be used in the future; no impact on existing projects
- Can be restored to an active state by enabling
Important
- Use the delete icon to remove a version if it is not currently in use. Versions cannot be deleted if they are in use
- GitOps and Terraform do not support version management; they will always synchronize with the latest active version