Cloning Components in Batches
This avoids complex and repeated configurations because multiple microservice components may have same configurations, for example, scheduling policy, AS policy, data storage, log storage, and lifecycle configurations, and only minor differences need to be modified. ServiceStage provides the function of cloning and deploying components in batches to improve component deployment efficiency and user experience.
Prerequisites
Only container-deployed components in the Running, Not ready, or Abnormal state can be cloned. For details about how to check the component status, see Viewing Component Details.
Cloning Components in Batches
- Log in to ServiceStage.
- Choose Application Management.
- Click the application where the target components are located. The Overview page of the application is displayed.
- Select the components to be cloned in batches in Component List and click Bulk Clone.
- Set the version configuration information of the components to be cloned by referring to the following table.
Parameter
Description
Component
Name of a component, which cannot be changed after the component is cloned.
Enter 2 to 64 characters. Start with a letter and end with a letter or digit. Only use letters, digits, underscores (_), and hyphens (-).
- Components with the same name in different applications can be deployed in the same environment.
- Components with the same name in the same application can be deployed in different environments.
Component Version
Version number of a component.
- By default, the version number is the time when you start to clone components in batches. The format is yyyy.mmdd.hhmms, where s is the ones place of the second in the timestamp. For example, if the timestamp is 2022.0803.104321, the version number is 2022.0803.10431.
- You can also customize the version number in the format of A.B.C, or A.B.C.D. A. B, C, and D are natural numbers, for example, 1.0.0 or 1.0.0.0.
NOTE:You can perform the following operations to synchronize component versions in batches:
- Move the cursor to the Component Version text box of the specified component and click .
- Select other components whose versions need to be synchronized.
- Click OK.
Application
Select the application to which the component belongs. You can perform the following operations to synchronize the applications to which components belong in batches:
- Move the cursor to the Application drop-down list of the specified component and click .
- Select other components whose applications need to be synchronized.
- Click OK.
Environment
Select the component deployment environment. Only the Kubernetes environment can be selected.
You can perform the following operations to synchronize the environments to which components belong in batches:
- Move the cursor to the Environment drop-down list of the specified component and click .
- Select other components whose environments need to be synchronized.
- Click OK.
Namespace
Select the namespace of the CCE cluster in the environment where the build is executed, which is used to isolate build data. For details, see Managing Namespaces.
You can perform the following operations to synchronize the namespaces to which components belong in batches:
- Move the cursor to the Namespace drop-down list of the specified component and click .
- Select other components whose namespaces need to be synchronized.
- Click OK.
Image Package
Click .
- Select the component source again. For details, see Component Source.
- You can customize a container name.
The name contains 1 to 63 characters starting with a lowercase letter and ending with a lowercase letter or digit. Only lowercase letters, digits, and hyphens (-) are allowed.
Instances
Set the number of component instances running in the environment. The value range is 1–200.
You can perform the following operations to synchronize the number of component instances in batches:
- Move the cursor to the Instances text box of the specified component and click .
- Select other components whose number of component instances need to be synchronized.
- Click OK.
- Reset the component build parameters.
This parameter is available when the technology stack type is Java, Tomcat, Node.js, Python, or PHP.
- Locate the target component and click Build in the Operation column.
- Set the parameters by referring to the following table. Parameters marked with an asterisk (*) are mandatory.
Parameter
Description
*Command
If the component source is Source code repository, set Command based on service requirements.
- Default command or script: preferentially executes build.sh in the root directory. If build.sh does not exist, the code will be compiled using the common method of the selected language. Example: mvn clean package for Java.
- Custom command: Commands are customized using the selected language. Alternatively, the default command or script is used after build.sh is modified.
NOTICE:
- If Custom command is selected, exercise caution when inputting sensitive information in the echo, cat, or debug command, or encrypt sensitive information to avoid information leakage.
- To run the compilation command in the project subdirectory, you need to go to the project subdirectory and then run other script commands. Example:
mvn clean package
*Dockerfile Address
If the component source is Source code repository, set Dockerfile Address based on service requirements.
Dockerfile Address is the directory where the Dockerfile is located relative to the root directory (./) of the project. The Dockerfile is used to build an image.
If Dockerfile Address is not specified, the system searches for the Dockerfile in the root directory of the project by default. If the Dockerfile does not exist in the root directory, the system automatically generates the Dockerfile based on the selected operating environment.
*Organization
An organization is used to manage images generated during component build.
*Build
Select the type of the environment used to build an image. The build environment must be a Kubernetes environment, and can access the Internet.
You are advised to select Use current environment. If the CCE cluster in the current environment cannot access the Internet and you have planned an independent build environment, you can select Use independent environment.
- Use independent environment: Use an independent build environment to build an image. The CCE clusters in the independent build environment and in the current component deployment environment must have the same CPU architecture. Otherwise, the component deployment fails.
- Use current environment: Use the deployment environment to which the component belongs to build an image. In the current environment, masters and nodes in the CCE cluster must have the same CPU architecture. Otherwise, the component build fails.
*Environment
- If Use independent environment is selected for Build, select an independent build environment different from that to which the component belongs.
- If Use current environment is selected for Build, select the deployment environment to which the component belongs.
*Namespace
Select the namespace of the CCE cluster in the environment where the build is executed, which is used to isolate build data. For details, see Managing Namespaces.
Node Label
In the following cases, set a node label to deliver the build job to the fixed node bound with an EIP to ensure that the component can be successfully built and deployed:
- If Use independent environment is selected for Build, set a node label to deliver the build job to the node in the independent environment, to ensure that the node CPU architecture is the same as that of the node in the current component deployment environment.
- If Use current environment is selected for Build and the CPU architecture of a node is different from that of the master node in the environment, set a node label to deliver the build job to the node that has the same CPU architecture as the master node.
For details about how to add a label, see Managing Node Labels.
- Click OK.
- Locate the target component and click Advanced Settings in the Operation column.
- Click to enable public network access.
- Set Public Network Load Balancer.
- Select a load balancer that has been bound to an EIP in the selected environment.
- If no load balancer exists, click Add One. On the Edit Environment page that is displayed, click Add Optional Resource to add created load balancers to the environment.
- To create ELB resources, refer to the following table.
Scenario
Reference
Use the domain name to access an application.
- An EIP has been bound to the load balancer and must be in the same VPC and subnet as the compute resources managed in the current component deployment environment.
- Components must be bound with different load balancers in different deployment environments to avoid route errors.
- Set Client Protocol.
- HTTP has security risks. You are advised to select HTTPS.
- If HTTPS is selected, click Use existing to select an existing certificate.
If no certificate exists, click Create new to create a server certificate. For details, see Adding a Certificate.
- Set Domain Name.
- If Automatically generated is selected, the automatically generated domain name is valid only for seven days.
- If Bound is selected, enter a domain name.
- Set Listening Port.
Enter the listening port number of the application process.
Figure 1 Configuring public access
- Set Public Network Load Balancer.
- Set Cloud Service Settings by referring to Managing Cloud Service Settings of a Container-Deployed Component.
- You can perform the following operations to synchronize the bound microservice engines, distributed caches, or cloud databases of components in batches:
- Move the cursor to the microservice engine, distributed cache, or cloud database bound to the specified component, and click .
- Select other components whose configurations need to be synchronized.
- Click OK.
The change is synchronized only when the selected microservice engine, distributed cache, or cloud database is bound to the environment to which the selected component belongs.
- You can perform the following operations to delete microservice engines, distributed caches, or cloud databases for components in batches:
- Move the cursor to the microservice engine, distributed cache, or cloud database bound to the specified component, and click .
- Click Delete, select other components whose configurations need to be synchronized, and click OK.
To delete the microservice engine, distributed cache, or cloud database only for the current component, click Cancel.
- You can perform the following operations to rebind a microservice engine, distributed cache, or cloud database to a component:
- Move the cursor to the microservice engine, distributed cache, or cloud database bound to the specified component, and click .
- Select a managed microservice engine, distributed cache, or cloud database in the current environment, and click OK.
- You can perform the following operations to synchronize the bound microservice engines, distributed caches, or cloud databases of components in batches:
- Set Container Settings by referring to Managing Container Settings of a Container-Deployed Component.
- Set Advanced Settings by referring to Managing Advanced Settings of a Container-Deployed Component.
- Click OK.
- (Optional) Click Pre-check Advanced Settings to check whether the advanced settings of each component are correct.
If the component has been bound to a specified microservice engine, distributed cache, or cloud database instance but the specified instance is not bound to the environment to which the component belongs, an error is reported during advanced settings pre-check. Perform the following operations to reconfigure the parameters and then continue:
- In the Pre-check Advanced Settings dialog box that is displayed, confirm the information and click OK.
- Click Advanced Settings in the Operation column of the component for which the error is reported.
- Reset the cloud service settings of each component by referring to Managing Cloud Service Settings of a Container-Deployed Component.
- Click Complete and Execute.
If the component has been bound to a specified microservice engine, distributed cache, or cloud database instance but the specified instance is not bound to the environment to which the component belongs, an error is reported during advanced settings pre-check. Perform the following operations to reconfigure the parameters and then continue:
- In the Pre-check Advanced Settings dialog box that is displayed, confirm the information and click OK.
- Click Advanced Settings in the Operation column of the component for which the error is reported.
- Reset the cloud service settings of each component by referring to Managing Cloud Service Settings of a Container-Deployed Component.
If the advanced settings are correct, wait until the component status changes from Initializing to Running, which indicates that the components are successfully cloned in batches.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot