Redeploying a Job Component
Container-deployed components whose Workload Type is Job can be redeployed as required.
Prerequisites
- Only the components whose Workload Type is Job and that are created and deployed using the following methods support this operation:
- The component status is Completed or Failed. For details about how to check the component status, see Viewing Component Details.
Redeploying a Job Component
- Log in to ServiceStage.
- Use either of the following methods to go to the component Overview page.
- On the Application Management page, click the application to which the target component belongs, and click the component in Component List.
- On the Component Management page, click the target component.
- Click Redeployment in the upper right corner of the page.
- Configure the component version by referring to the following table. Parameters marked with an asterisk (*) are mandatory.
Parameter
Description
Stack
Select a component technology stack and version.
For details, see Technology Stack.
*YAML Mode
Whether to use YAML configurations to redeploy components.
- Disabled: The UI configurations are used to redeploy components.
- Enabled: The YAML configurations are used to redeploy components. The latest load information of the component is automatically synchronized from CCE where the target component is deployed for component redeployment after modification. Alternatively, click Import YAML File to import the edited YAML configuration file of the target component. If YAML configurations are used to redeploy components, the parameters in the YAML configuration file are described in Deployment.
*Software Package/Image
The value is fixed to the package type selected during component creation and deployment.
- YAML Mode disabled: If you select Source code repository, create authorization by referring to Creating Repository Authorization and set the code source. If you select a software package or image package, the option is fixed to the software package type (JAR, WAR, or ZIP) or image package type selected during component creation and deployment. It is determined by the selected technology stack type. For details, see Table 1.
- YAML Mode enabled: If you select Source code repository, create authorization by referring to Creating Repository Authorization and set the code source. If you select a software package, the option is fixed to the software package type (JAR, WAR, or ZIP) selected during component creation and deployment. It is determined by the selected technology stack type. For details, see Table 1.
*Upload Method
- YAML Mode disabled: If the component source is software package or image package, select an uploaded software package or image package. For details about the upload method, see Component Source.
If you select an image package:
- If Multi-container is selected in Creating and Deploying a Component, select a container and click
to specify it as the initialization container for installing tools or scripts before the service container starts. At least one container must be specified as the service container (non-initialization container). For details about container initialization, see Init Containers.
- If Multi-container is selected in Creating and Deploying a Component, click Select Image Package to add a container and select an image package source.
- If Multi-container is selected in Creating and Deploying a Component, choose
> Modify Image Package in the upper right corner of the selected container card to modify the image package source of the container.
- If Multi-container is selected in Creating and Deploying a Component, choose
> Delete in the upper right corner of the selected container card to delete the container.
- If Multi-container is selected in Creating and Deploying a Component, deselect Multi-container to deploy a component based a single container.
- If Multi-container is not selected in Creating and Deploying a Component, select Multi-container to deploy a component based on multiple containers. Click Select Image Package to add a container, select an image package source, and set Container Name.
- You can customize the container name. The name contains 1 to 63 characters, including lowercase letters, digits, and hyphens (-), and must start with a lowercase letter and end with a lowercase letter or digit.
- If Multi-container is selected in Creating and Deploying a Component, select a container and click
- YAML Mode enabled: If the component source is software package, select an uploaded software package. For details about the upload method, see Component Source.
- If the package type is software package and you need to use JFrog (example) as the software package repository, you can select Custom file address.
- Enter the HTTP/HTTPS custom file address where the software package is located.
- Determine whether to enable authentication.
If authentication is disabled, any user can download the software package in the custom file address by default.
Click
to enable authentication. Only authenticated users can download the software package in the custom file address. Authentication mode can be User name and password authentication or User-defined Header Authentication. The authentication mode and the corresponding authentication parameters are determined by the authentication mode supported by the server where the custom file directory is located.
Image Access Credential
An image access credential is a secret, which is used to store the authentication information required for pulling images from a private repository. For a public repository image, you can retain the default settings or do not set this parameter. For a private repository image, this parameter is mandatory. Otherwise, the image fails to be pulled.
- You can select up to 16 image access credentials.
- Click Create Secret to create an image access credential. Secret Type must be kubernetes.io/dockerconfigjson. For details, see Creating a Secret.
*Command
This parameter is mandatory when YAML Mode is disabled, the package type is Source code repository, the component is deployed in the Kubernetes environment, and the selected technology stack type is Java, Tomcat, Node.js, Python, or PHP.
- 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.
- 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
This parameter is mandatory when YAML Mode is disabled, the package type is Source code repository, the component is deployed based on a container, and the selected technology stack type is Java, Tomcat, Node.js, Python, or PHP.
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.
*Component Version
Component version number, which can be automatically generated or customized.
- Automatically-generated: Click Generate. By default, the version number is the timestamp when you click Generate. 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.
- Customized: Enter a value 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.
The customized version number must be unique and cannot be the same as any historical version number of the component. Otherwise, the current deployment record will overwrite the historical deployment record of the same version.
*Container Name
This parameter is mandatory when the technology stack is not Docker and YAML Mode is disabled.
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.
Resources
This parameter is available when YAML Mode is disabled.
You can customize CPU and Memory to set their quota, and set the maximum/minimum number of CPU cores and memory size (GiB) that can be used by components. In this way, you can set the number of resources required by each component instance.
When resource Request is specified for a component instance, CCE uses this information to determine the node to which the component instance is scheduled. When resource Limit is specified for a component instance, CCE ensures that the resources occupied by the running component instance do not exceed the limit. CCE will also reserve the requested number of system resources for the component instance. For details about how to configure them, see Resource Management.
To modify them, select the item to be changed and enter a new value. Unselected parameters indicate no restriction.
If the package type selected for Upload Method is image package and multi-container deployment is enabled, set this parameter for each container instance as required.
JVM Parameters
This parameter is available when YAML Mode is disabled and the technology stack type is Java or Tomcat. It configures the memory size during Java code running.
Enter the JVM parameter. For example:
-Xms256m -Xmx1024m
Multiple parameters are separated by spaces.
Tomcat
This parameter is available when YAML Mode is disabled and the technology stack type is Tomcat. It configures parameters such as the request path and port number of Tomcat.
- Select Tomcat. The Tomcat dialog box is displayed.
- Click Use Sample Code and edit the template file based on service requirements.
In Tomcat configuration, the default server.xml configuration is used. The context path is /, and no application path is specified. If you need to customize an application path, customize the Tomcat context path by referring to How Do I Customize a Tomcat Context Path?
- Click OK.
Cloud Service Settings
If YAML Mode is disabled, set this parameter as required by referring to Managing Cloud Service Settings of a Component.
Container Settings
If YAML Mode is disabled, set the following parameters as required by referring to Managing Container Settings of a Container-Deployed Component.
- Set Environment Variable by referring to Adding an Environment Variable of a Component.
- Set Startup Command by referring to Configuring the Startup Command and Lifecycle of a Component.
- Set Data Storage by referring to Configuring Data Storage.
- Set Lifecycle by referring to Configuring the Startup Command and Lifecycle of a Component.
- Set Log Collection by referring to Configuring a Log Policy of an Application.
Application Settings
Set this parameter as required by referring to Managing Application Settings of a Container-Deployed Component.
If the package type selected for Upload Method is image package and multi-container deployment is enabled, set this parameter for each container instance as required.
Log Settings
If YAML Mode is enabled, set this parameter as required by referring to 14.
Advanced Settings
If YAML Mode is disabled, set this parameter as required by referring to Configuring Component Job Settings.
- Click Redeployment and wait until the component is deployed.
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