Environment management

Updated at:

This topic describes what an environment is in Alibaba Cloud DevOps AppStack and how to manage its lifecycle. An environment is a runtime for an application at a specific stage, typically corresponding to a set of Kubernetes resource instances or host services. In AppStack, you can create multiple environments for a single application, such as for development, testing, and production, and manage and monitor each one separately.

Create an environment

  • Navigate to Application > Environment and click Create Environment.

    • Enter an Environment name. This is the unique identifier for the environment within the application and cannot be changed after creation. It must be 1 to 63 characters long and can only contain lowercase letters, numbers, and hyphens (-). It cannot start or end with a hyphen.

    • Enter an Environment display name. This name is shown in the UI and can be changed later in the environment settings. It can be 1 to 64 characters long and can contain Chinese and English characters, numbers, and symbols.

    • Select a Deployment mode. The available deployment modes are determined by the application's orchestration type. Each environment must have a specified deployment mode.

    • Select Resources. These are the resources the environment uses for deployment. The available resource types depend on the selected deployment mode.

      • For a Kubernetes deployment, you can select a Kubernetes cluster for which you have permissions.

      • For a host deployment, you can select a host cluster for which you have permissions. You can associate an existing deployment group from the host cluster or directly select specific machines within the cluster. (Note: If you select specific machines, Alibaba Cloud DevOps AppStack automatically creates a deployment group for them. The unique name of the deployment group is ${application-name}-${environment-name}-group, and its display name is ${application-name}-${environment-display-name}-deployment-group. You can manage this deployment group from the Associated deployment groups list in the host cluster.)

    • Select a variable group. This group contains variables that dynamically replace placeholders in the application orchestration during deployment. You can change this association later in the environment settings.

    • Select Tags. These are key-value pairs used to classify environments.

    • Enter a Description for the environment.

  • Click Confirm to create the environment. After you create the environment, you are redirected to its details page.

View environment list

  • Navigate to Application > Environment to see a list of all environments for the current application.

    • Each environment card displays its name, tags, recent change information, current version, and the status of its last deployment.

    • Click Deploy Now on an environment card to submit a new deployment ticket.

    • Click an environment card to open its details page. For details, see View environment details.

  • Click Create Environment at the top of the list to create a new environment. For details, see Create an environment.

Note: When you create a new application, AppStack provides three out-of-the-box environments: development, testing, and production. These correspond to three organization-level tags: Environment Level/Development, Environment Level/Testing, and Environment Level/Production. You can use these environments after associating resources via Quick Settings on the environment card. You can modify or delete these preset environments, or create your own custom environments.

View environment details

  • Navigate to Application > Environment, and from the list, click the target environment card to open its details page. On this page, you can view basic information, specific resource details, deployment versions, environment settings, and access operational controls.

In the upper-right corner of the environment details page, you can find operational buttons such as Environment Settings, History, Scale, Rollback, and Deploy. The left panel provides an overview and basic information, including the orchestration version, deployment mode, and deployment policy. The resource area on the right displays the specific resources deployed in the environment, categorized under the Workload, Configuration, Network, Storage, and Others tabs.

Basic information

  • Environment overview: Shows information such as the application orchestration, variable groups, and deployment groups used by the current environment.

  • Change information: Displays details about the most recent change to the environment, including the change ticket, operator, time of the change, and current version.

  • Basic information: Shows fundamental details about the environment, including the creator, creation time, tags, and description.

Kubernetes environment resources

On the environment details page, you can view all resources currently deployed in this environment. The components in the application orchestration determine the specific resources. When the environment's deployment mode is Kubernetes deployment, resources may include workloads, configurations, networking, and storage.

Workload

The Workload tab displays all workload resources deployed in this environment. A workload is an application running on a Kubernetes cluster. Currently, Alibaba Cloud DevOps AppStack only supports stateless workloads, namely Deployments, which are suitable for scenarios with completely independent and identical instances, such as NGINX or WordPress.

  • You can view the instance information for the workload.

    • Instance name

    • Instance status

    • Deployment version

    • Creation time

    • Container information

  • Click YAML to view the YAML configuration of the Deployment component.

  • Click Details to view more Pod information.

    • Pod information

      • Pod status: The running status of the Pod.

      • Pod IP: The IP address of the Pod.

      • Node: The name and IP address of the node where the instance runs.

      • Creation time: The time the instance was created.

      • Uptime: The duration since the instance started.

    • Container information

      • Container name: The name of the container.

      • Image: The image used by the container.

      • Container status: The running status of the container.

      • Restarts: The total number of times the containers in the instance have restarted since startup.

    • Key events

      • You can view key events for the Pod, including the event time, reason, and detailed message. This information can help you diagnose Pod issues.

    • Container logs

      • You can view the standard output logs of the container.

  • Click Logs to view container logs, which can help with troubleshooting and issue diagnosis.

Configuration

The Configuration tab displays all configuration resources in this environment, which may include ConfigMaps and Secrets. A ConfigMap allows you to store non-confidential data in key-value pairs. It can be used as environment variables, command-line arguments, or configuration files in a volume for a Pod. A Secret object holds sensitive information, such as passwords, OAuth tokens, and SSH keys. This approach decouples your environment configuration from your container images, making it easier to modify application settings.

  • ConfigMap

    • Component name: The name of the component as defined in the application orchestration.

    • Deployment status: The deployment status of the component.

    • Deployment version: The version number of the latest deployment.

    • Update time: The time of the latest deployment.

    • YAML: Click to view the YAML configuration of the ConfigMap component.

  • Secret

    • Component name: The name of the component as defined in the application orchestration.

    • Deployment status: The deployment status of the component.

    • Deployment version: The version number of the latest deployment.

    • Update time: The time of the latest deployment.

    • YAML: Click to view the YAML configuration of the Secret component.

Network

The Network tab displays all network resources in this environment, which may include Services and Ingresses. A Service provides a stable access point for a set of Pods and enables load balancing across them. An Ingress manages external access to Services within the cluster. You can configure different routing rules in an Ingress resource to direct traffic to different backend Pods based on the specified rules.

  • Service

    • Component name: The name of the component as defined in the application orchestration.

    • Type: Can be ClusterIP, NodePort, LoadBalancer, Headless Service, or ExternalName, depending on the Service type defined in the application orchestration.

    • Cluster IP

    • Endpoint: The service's mapped endpoints.

    • Deployment status: The deployment status of the component.

    • Deployment version: The version number of the latest deployment.

    • Update time: The time of the latest deployment.

    • Click YAML to view the YAML configuration of the Service component.

  • Ingress

    • Component name: The name of the component as defined in the application orchestration.

    • Number of routing rules: The number of routing rules defined in the component. Click the number to view the specific forwarding rules:

      • Domain name

      • URL

      • Target Service

      • Service port

      • URL matching rule

    • Deployment status: The deployment status of the component.

    • Deployment version: The version number of the latest deployment.

    • Update time: The time of the latest deployment.

    • Click YAML to view the YAML configuration of the Ingress component.

Storage

The Storage tab displays all storage resources in this environment. Kubernetes uses the PersistentVolume (PV) and PersistentVolumeClaim (PVC) abstractions to define and consume storage. A PV describes a persistent storage volume, which mainly defines a directory on a host machine, such as a mounted directory for file storage. A PVC describes the properties of the persistent storage that a Pod requests, such as the volume size and read/write permissions. Typically, you can use a PV to describe an existing storage resource and then create a PVC to consume that storage.

  • PVC

    • Component name: The name of the component as defined in the application orchestration.

    • Type: The access mode, defined by the component in the application orchestration. It can be read-only or read-write.

    • Capacity: The declared size of the volume storage to be used.

    • Deployment status: The deployment status of the component.

    • Deployment version: The version number of the latest deployment.

    • Update time: The time of the latest deployment.

    • YAML: Click to view the YAML configuration of the PVC component.

Host environment resources

  • This section displays the machines deployed in the current host environment.

    • Host ID

    • Host name

    • IP

    • Connection status: The current agent connection status of the machine.

Configure environment

After an environment is created, you can use the Environment Settings feature to modify its basic information and deployment configuration.

  • Basic settings: You can modify the Environment display name, Tags, and Description.

  • Deployment settings: You can set the associated variable group for the environment. Modifying the environment's deployment mode and resources is not currently supported.

Lock environment

In daily development workflows, you may need to reserve an environment for regression testing or close a release window for special reasons. In such cases, you can use the Lock environment feature. Once an environment is locked, no further operational actions can be submitted, but existing ticket executions are not affected. You can find this feature in the "More" menu in the operations area of the environment details page. Only the user who locked the environment can unlock it.

History

During deployment and operations, you often need to trace an environment's history for troubleshooting or other purposes. The environment management feature provides a History function that records all modifications since the environment's creation. This includes Change history, which tracks operational tickets, and Operation history, which records changes to metadata such as basic information and configuration. You can access this feature by clicking History in the operations area of the environment details page.

  • Change history

    • This section displays all operational change records for the current environment. Each record includes:

      • Change ticket: The name of the operational ticket.

      • Type and status: The type and status of the ticket.

      • Version: The deployment version of the ticket.

      • Submission info: The submitter and submission time.

  • Operation history

    • This section displays all operational records for the current environment. Each record shows:

      • Operation title

      • Operation content

      • Operator

      • Operation time

Delete environment

When an environment is no longer needed, you can delete it. Deleting an environment releases its resources, making the application unavailable. This action is irreversible, so proceed with caution.

  • Delete an undeployed environment

    Navigate to the environment details page, click the Delete button in the upper-right corner, and confirm the deletion.

  • Delete a deployed environment

    • Create an environment deletion ticket

      1. Navigate to the environment details page and click the Delete button in the upper-right corner to open the create Delete Environment ticket page.

      2. Verify the environment information. The ticket page lists all Component information deployed in the current environment and the Recent changes. Carefully review this information to confirm that the environment is no longer in use.

      3. Enter the Environment display name to confirm the deletion.

      4. Click Submit to create the environment deletion ticket and navigate to its details page.

    • Observe the deletion process

      • The deletion ticket for a Kubernetes environment performs the following steps:

        • Step 1: All components deployed in this environment are deleted in the reverse order of their deployment. If some environment resources are not cleaned up correctly, you can contact the cluster administrator to perform a manual cleanup. For more information, see Manually delete an environment.

        • Step 2: The environment data is deleted during the Post-environment cleanup stage.

      • The deletion ticket for a host environment performs the following steps:

        • Step 1: The service is taken offline. This involves running the stop script and the cleanup script (if any) on each host in the environment. For more information, see Host deployment orchestration.

        • Step 2: The deployment group is disassociated from the environment. If you choose to delete the deployment group at the same time, the system deletes the associated group, releases the hosts back to the host cluster, and then deletes the environment's metadata.