Running the same application across dev, test, and prod on shared infrastructure risks configuration drift and accidental cross-environment interference. SAE namespaces let you deploy isolated copies of your application in the same region, with network-level separation enforced by Virtual Private Cloud (VPC) boundaries. Each namespace is bound to exactly one VPC, and applications in the same namespace are in the same VPC.
This topic shows you how to create three namespaces (dev, test, prod), deploy an application to dev, copy it to the other environments, and use batch operations to start or stop entire environments at once.
Assigning a different VPC to each namespace is what enforces network isolation. If two namespaces share a VPC, applications in those namespaces can communicate over the internal network and may interfere with each other.
Prerequisites
Before you begin, ensure that you have:
An Alibaba Cloud account with SAE access
Step 1: Create namespaces
Create a separate namespace for each environment and bind each to a different VPC. This topic uses China 1 (Hangzhou) as the example region.
Create the dev namespace
Log on to the SAE console. In the top menu bar, select the region where you want to deploy your application.
In the navigation pane, choose Namespace, then click Create Namespace. Set Namespace Name and Namespace ID to
dev.Click Create VPC to open the VPC Management Console. Make sure Region matches your application's deployment region. Set Name to
dev-vpcand configure the IPv4 CIDR Block as needed. For details, see Create and manage a VPC.Create two vSwitches in different zones within
dev-vpcto improve application availability. Set the Name, Zone, and IPv4 CIDR Block for each vSwitch, then click +Add to add the second vSwitch. For details, see Create and manage a vSwitch.vSwitches within the same VPC can communicate over the internal network.
Return to the Create Namespace panel in the SAE console. Set Virtual Private Cloud to
dev-vpc, then click OK.
Create the test and prod namespaces
Repeat the steps above to create the test and prod namespaces, binding each to a new, dedicated VPC.
Step 2: Deploy applications
Deploy your application to dev first, then copy it to test and prod. Copying preserves the application configuration so you can adjust it per environment — for example, by changing instance counts or environment variables.
In the navigation pane, choose Application Management > Applications. Set Namespace to
dev, then click Create Application. For each application, select the VPC and vSwitches you created in Step 1. For details, see Deploy an application.In the Applications list, select an application. In the Actions column, click Copy. Set Namespace to
testorprodand update the configuration for the target environment.Repeat for each application until all applications are deployed to
testandprod.
Step 3: Manage environments with batch operations
Use batch operations to start or stop all applications in a namespace at once. This is useful for shutting down dev and test outside business hours to reduce costs.
To start or stop applications manually, see Batch operations on applications.
To automate start/stop on a schedule, see Create scheduled start/stop rules.
What's next
To promote a tested application from
testtoprod, use the Copy action again and verify the production configuration before starting the application.