KOP Environment Manager - Create Environment - Rafay Product Documentation

Create

Did you know ?

Environments can be managed using the following methods:

Create an environment from a template.

Launch Environment

Add Agent

🔔 Important Information: Form-Based Parameter Configuration

For input variables configured with Value Type set to JSON or HCL in the associated Environment Template, parameters can be edited using the Edit icon during environment creation.

When a JSON schema is defined for such variables:

After making the required changes in the form-based editor, click Update to apply the updated values.

If a JSON schema is not defined for a JSON or HCL parameter:

For parameters configured with Value Type set to Text or Expressions:

Form-based rendering occurs only when a valid JSON schema is present and strictly reflects the structure and default values defined in the environment template.

Refer below for details on each field

Setting Description
Name Enter a name for the environment
Description Enter a description for the environment
Environment Template Select an environment template to use to create an environment
Environment Template Version Select the version to use to create an environment
Agents Select one or more agents for running the environment provisioning tasks
Labels Add labels to the environment, along with any labels defined during environment template creation
Parameters Provide the environment parameters (example: instance configuration parameters such as disk type, disk size, and region)

🔔 Important Note:

Input variables are organized into sections according to the Grouping Section settings defined in the Environment Template Input Variables. The order of these sections follows the Order/Weight value, with lower numbers appearing first.

Input Variables that are added but not assigned an Order/Weight or Section will be placed under the "Others" category.

Schedules

If the schedules are defined in the associated environment template, they will be available on the environment page, allowing users to opt out of these scheduled actions. The table displays the scheduled actions associated with the current environment. It includes the following details for each scheduled action:

To modify specific scheduled actions, click Do you want to opt out? next to the desired schedule in the environment configuration. This option allows you to delay the scheduled tasks, providing flexibility in managing the schedule associated with your environment.

The configuration context attached to the schedules will appear under environment input variables when the schedules are triggered.

The scheduled action will be deferred for the specified duration, preventing it from being triggered within that period.

Note: If the environment template does not include any schedules, the opt-out options will not be displayed, and the status will be shown as "Not scheduled"

The deployment section indicates the current status and upcoming scheduled actions related to the environment, with the next schedule displaying the immediate action (e.g., "Destroy-ec2-instance") and its trigger time, typically within the next 24 hours. Users can opt out of this immediate action if needed.

Once the environments are deployed, they will be listed in the right pane along with the activities performed on them. The activity section displays the events executed by various users.

Filtering Environments by Status

The My Environments page includes a comprehensive filter panel that allows narrowing down environments based on multiple criteria. These filter options help streamline environment management by displaying only those that match the selected criteria:

These filter options help streamline environment management by displaying only those that match the selected criteria.

Selective Resource Reconciliation

During day 2 operations, redeploying an environment traditionally triggers the redeployment of all associated resources, even if no changes exist. This can result in longer update or failover times.

Selective resource reconciliation enables the redeployment of only specific resources within an environment by specifying the reconcile_resources field in the environment specification. This allows targeted redeployment of resources that actually require changes, leaving other resources untouched.

For example, in a failover scenario where only a DNS change is required, it is possible to reconcile just the DNS resource instead of redeploying the entire environment. If no resources are specified in reconcile_resources, the system redeploys all resources by default.

This functionality is supported both in the UI and through environment YAML specifications.

Reconcile Resources in the UI

If no resources are selected in this section, the system will deploy all available resources by default.

YAML Specification

Selective resource reconciliation can also be configured directly in the environment YAML specification using the reconcile_resources field. Specify the resources that need to be reconciled during day 2 operations.

Example:

apiVersion: eaas.envmgmt.io/v1
kind: Environment
metadata:
  name: test-env
  project: defaultproject
spec:
  template:
    name: test-np-et
    version: with-action
  agents:
    - name: docker-2502
  reconcile_resources:
    - name: test-np-rt

Note: If a full redeployment is needed later, resources listed under Reconcile Resources must be removed manually before executing the Deploy action again.

Force Unlock for Terraform Resource Templates

When using a Resource Template defined with Terraform or Tofu within an Environment Template, and this environment is published, a series of activities are triggered, where all these activities are executed by the CD Agent.

Execution Flow

  1. During environment publication, Terraform is used to apply the resource configurations
  2. As part of the terraform apply process, Terraform first acquires a state lock to prevent concurrent modifications
  3. Once the lock is acquired, Terraform begins provisioning the defined resources (e.g., an EC2 instance in AWS)

If the Terraform activity is interrupted for any reason (e.g., network issues, process termination, or unexpected errors):

Note: If the user encounter a lock-related error during publishing, refer to the specific error message for details. In such cases, you may need to manually remove the stale lock using terraform force-unlock icon.

Force Unlock

To force unlock,

A side panel titled Unlock Status appears, where users need to select the resource templates that are currently locked.

After the Release Lock run is complete, publish the environment again.

Destroy or Delete an Environment

An environment can be destroyed, which removes the provisioned resources from the cloud provider but retains the environment record in the Environment Manager, or deleted, which removes both the resources and the environment metadata completely.

The delete (trash) icon is enabled only for environments in the Active or Deleted Failed status.

Click the trash icon next to the environment name to begin the delete process. In the confirmation dialog, review the details and enter the environment name to confirm deletion. Then select Delete this Environment to proceed.