tencent cloud

Producing an Installation Package
Last updated: 2025-04-23 15:12:39
Producing an Installation Package
Last updated: 2025-04-23 15:12:39

Terms and Descriptions

Term
Description
Installation Package
The installation package is a deliverable for automatic deployment submitted by partners that complies with CloudApp standards, integrating cloud resource orchestration, installation parameters, and output declarations, etc.
Users through Cloud App one-click deployment, just automatically perform resource creation, application configuration and process startup, achieving full process automation installation.

Creating an Installation Package

Currently, the installation package supports two ways to create. As follows:

Template Creation
Ordinary Creation
Advantage
Simple and quick, create using officially provided fixed templates.
Just input a small amount of template parameters to quickly create an installation package and submit the development edition.
High flexibility, can create complex applications.
Fully customize various types of resources and their parameters.
Shortage
Insufficient flexibility, only supports partial customization of parameters.
A certain level of development basis is required.
You need to install the Node.js environment and the CLI developer tool.
The specific creation steps are as follows:
Template Quick Creation
Ordinary Creation
1. In Installation Package Management, click Create Installation Package, select Created via Template, and fill in the installation package name and some template parameters to complete the creation.

2. After the installation package is created, click Version Management under the operation column of the target application to enter the version management interface of the installation package.

1. In Installation Package Management, click Create Installation Package, fill in the installation package name, and select Ordinary Creation to complete the creation.

2. After the installation package is created, click Version Management under the operation column of the target application to enter the version management interface of the installation package.


Logging in to the Developer Tool (CLI)

1. In the version management interface, click How to Upload Development Edition to bring up the tool installation and login guide.
Note:
Node.js environment is required. Node.js environment is required. The CloudApp developer tool is developed based on Node.js. Please confirm that Node.js is installed in the development environment before installation. If not installed, please visit Node.js official website to download and install it.


2. After installing the developer tool as instructed, use the cloudapp command to view the instructions for using the tool.

3. After the tool is installed, please use the cloudapp login command to log in to the local developer center. You need to use the developer's CAM key to log in.
The SecretId and SecretKey are the corresponding CAM keys in the developer information submitted when registering the application developer entity. The developer and developer name will be displayed after a successful login. If you forget the key information, you can query it in the CAM console.
cloudapp login $SECRET_ID@$SECRET_KEY

Installation Package Initialization (CLI Tool)

Note:
The installation package is represented as a file system directory locally on the developer's machine. It is generally recommended to use the .cloudapp directory under the project root directory as the installation package directory.
Recommended to read Demo source code of the minimal installation package to understand the components of the installation package.
Use the cloudapp init command to generate a sample installation package:
# Initialize a local project. You can specify an initial template with -t. For reference, supported templates are listed in the Github template list (default template: CVM instance + public IP address).
cloudapp init hello-world

# Example
# cloudapp init hello-world -t CT_001
Note:
cloudapp init command is currently in preview edition. Its usage and parameters may be adjusted subsequently. Currently, cloudapp init only downloads template code locally. More template codes can be viewed in the Cloud App's GitHub repository.

Composition of Installation Package

The installation package consists of content delivered by the developer (divided into two modes: CVM deployment and container deployment). See the table below for specific differences:
CVM Deployment
Container Deployment
Note:
If your application uses container deployment, please switch to Container Deployment to view the content required for delivery.
Content
Position
Description
Meta-information of Installation Package
.cloudapp/package.yaml
The description file of the meta-information of the installation package.
Contains declarations of information such as installation package ID, application installation parameters, and CAM permission policies.
Resource and variable declaration
.cloudapp/infrastructure/**/*.tf
Resource and variable declaration using Terraform syntax.
Resources are declared in the form of resource blocks; variables are variables that can be used during resource deployment and need to be declared before use.
CVM image (artifact)
Cloud App Artifact Hosting Center
Cloud App provides CVM image hosting.
Note:
If your application uses CVM deployment, please switch to CVM Deployment to view the content required for delivery.
Content
Position
Description
Meta-information of Installation Package
.cloudapp/package.yaml
The description file of the meta-information of the installation package.
Contains declarations of information such as installation package ID, application installation parameters, and TencentCloud API permissions.
Resource and variable declaration
.cloudapp/infrastructure/**.tf
Resource and variable declaration using Terraform syntax.
Resources are declared in the form of resource blocks; variables are variables that can be used during resource deployment and need to be declared before use.
Container image (artifact)
Cloud App TCR repository
Cloud App provides TCR repositories to provide image hosting services for applications that need to host container images.
Service orchestration
.cloudapp/software/charts/**/*.yaml
Service orchestration, adopting Helm Chart orchestration specification.
Orchestrate StatefulSet, Service, Job, Secret, etc. in a container cluster.

Meta-Information of Installation Package

The meta-information of the installation package is declared in package.yaml, including declarations of information such as installation package ID, application installation parameters, and TencentCloud API permissions.
# Installation package ID, corresponding to the app ID in the developer center
id: pkg-8lve2gn1

# Application parameters, defining the parameters that allow customers to set during the installation process, such as associated network, application specifications, payment method, etc.
args:
- name: app_target
label: target network
widget: subnet-select

# Application permission declaration (optional). If you need to call TencentCloud API within the application, declare it here.
role:
policy:
version: "2.0"
statement:
- action:
- cloudapp:VerifyLicense
resource: "*"
effect: allow
Note:
Please provide the correct installation package ID. When the developer tool pushes the application, it will authenticate and push based on the installation package ID recorded in package.yaml. If the application is not registered, or the currently logged-in developer is not the corresponding application developer, the push will fail.

Resource and Variable Declaration

Resource Declaration

The resource declaration in the installation package is the core content of the installation package. Cloud applications use Terraform grammar to declare cloud resources for software dependencies.
resource "tencentcloud_eks_cluster" "eks" {
availability_zone = var.app_target.subnet.zone
k8s_version = "1.20.6"
vpc_id = var.app_target.vpc.id
subnet_ids = [var.app_target.subnet.id]
service_subnet_id = var.app_target.subnet.id
}
The above is the declaration syntax of a resource block. resource indicates a resource block declaration. "tencentcloud_eks_cluster" indicates the resource type. "eks" is the resource name.
Note:
The resources that can be declared supported by the installation package are roughly divided into two types:
Tencent Cloud IaaS / SaaS resources, prefixed with tencentcloud as the resource type.
Resources encapsulated by the Cloud App, with the resource prefix cloudapp.

Variable Declaration

The associated VPC, subnet and other information of the above-declared EKS resources are obtained from variables. In the installation package, all variables used need to be declared before use.
# Declare a variable using the variable keyword. app_target is the "variable name". You can use this variable through var.app_target.
variable "app_target" {
type = object({
region = string
region_id = string
vpc = object({
id = string
cidr_block = string
})
subnet = object({
id = string
zone = string
})
})
}
Similar to a resource block, we use a variable block variable to declare a variable. In the above declaration, app_target is the variable name, which can be referred to as var.app_target in the resource block.
Variables can be used to obtain users' installation parameters and can also be used to obtain the system's installation parameters. For details, see Using Installation Parameters, Variables and Output in the document description.

Image Hosting

CVM Image Hosting
Container Image Hosting
Note:
After you create a CVM image, you need to host the image in the Cloud Application Product Management Center so that during user installation, the Cloud App can automatically share the corresponding image with users.
1. In CloudApp developers, select artifact management of the application.



2. Select the CVM image that the current application needs to be hosted in the product management center.






3. Adjust the available regions of the mirror according to the regions where the application allows installation.



Note:
Cloud App provides TCR repositories to provide image hosting services for applications that need to host container images. Customers can pull from the private network when installing this repository, without the need for public network support.
1. Use the cloudapp docker command to obtain the repository login command.



2. Use cloudapp docker --url to obtain the repository push address.



3. Use cloudapp docker --auth to obtain the Docker authorization file separately, suitable for CI build scenarios.



4. After logging in to the Docker repository, you can push images to the hosted repository.
Valid period and permissions of the repository invoice
The repository invoice obtained by the cloudapp docker command can only be used for the application side to push software container images. The valid period of this invoice is 2 hours, so it should not be stored for use. It is recommended to obtain the invoice in real time through the cloudapp docker command after the CI process is built.
The installation invoice used during customer installation is read-only, while the invoice obtained by cloudapp docker can operate the software images of the application developer.

Service Orchestration (Container Deployment)

Declare service orchestration by claiming resources of type cloudapp_helm_app.
resource "cloudapp_helm_app" "helm_charts" {
cluster_id = tencentcloud_eks_cluster.eks.id
chart_src = "../software/chart"
chart_username = var.cloudapp_repo_username
chart_password = var.cloudapp_repo_password

chart_values = {
SUBNET_ID = var.app_target.subnet.id
IMAGE_CREDENTIALS = {
REGISTRY = var.cloudapp_repo_server
USERNAME = var.cloudapp_repo_username
PASSWORD = var.cloudapp_repo_password
}
}
}
Requires specifying the target container cluster for orchestration as well as the location of the Helm Chart source code for orchestration (generally recommended to be placed at .cloudapp/software/chart).
Pass resource information to Helm Chart Values through chart_values. This information will be transmitted to Helm during deployment. Thus, infrastructure can be directly used during orchestration. See the above example. Transmit the subnet ID to the orchestration. When orchestrate the service, specify this subnet ID to generate a private network CLB type. Another common example is to import the connection information of the instantiated DB into the orchestration, so that the workload can refer to it from the environmental variable or generate it into a configmap.
Note:
Transmitting the resource attributes declared in TF to Helm Chart Values is an important characteristic. Use this feature to directly orchestrate the actual deployment of hardware resources during software orchestration, without the need for secondary settings.

Advanced

Continue reading the follow-up content and learn the implementation of advanced installation package features.

Resource

Go to Github repository to view more sample source code.

Next

After completing the production and uploading of the installation package, you need to push, verify, and list the installation package. For details, see Installation Package Management.

Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback