In scenarios in which Docker container images are used, we recommend that you use container image deployment packages to deploy services. Compute Nest provides a public Container Registry repository to manage and store container images. Each service provider corresponds to a namespace to implement multi-tenant data isolation. This topic describes the scenarios of container image deployment packages, how container image deployment packages work, and how to create and use a container image deployment package.
Scenarios
If you want to use a Docker container image that is pulled over the Internet to deploy a service but do not want to make the container image publicly available, you can use a container image deployment package that is pulled by using a temporary key.
Container image deployment packages are not applicable to scenarios in which auto scaling is required or images need to be frequently pulled.
Implementation
Container images of multiple service providers are stored in the same image repository. To implement multi-tenant data isolation, Compute Nest assigns each service provider to a separate namespace. Container images of service providers are stored in their corresponding namespaces. Temporary keys for uploading and pulling images are generated for a namespace based on the Alibaba Cloud account ID of the corresponding service provider. This way, access control is implemented based on namespaces.
Usage notes
You must define the following identifiers in a Resource Orchestration Service (ROS) template of a service. The identifiers are replaced with actual values during service deployment.
{{ computenest::acrimage::yourimage }}: the identifier of the container image deployment package. When you deploy the service template, Compute Nest replaces the identifier with the URL of the associated container image deployment package, such ascompute-nest-registry.cn-hangzhou.cr.aliyuncs.com/aliUid1/volcanosh/vc-controller-manager:1.0.{{ computenest::acr::dockerconfigjson }}: the identifier of the key that is used to pull the container image. When you deploy the service template, Compute Nest replaces the identifier with a temporary key that is used to pull the container image.
The following sample YAML file shows how to deploy a service by using a container image deployment package. The {{ computenest::acr::dockerconfigjson }} key that is used to pull the container image is stored in the computenestrepo Secret. The Secret is used as the imagePullSecret to pull the container image after the deployment package identifier is replaced with the URL of the container image deployment package.
Create and use a container image deployment package
Prerequisites
Docker is installed, and a Docker image is created. For more information, see Install and use Docker.
Create a container image deployment package
Configure the basic information about the deployment package.
Log on to the Compute Nest console. In the left-side navigation pane, click Service Deployment Package. In the Deployment Package section of the Service Deployment Package page, click Create Deployment Package.
In the Deployment Package Information section, configure the parameters described in the following table.
Parameter
Description
Deployment Package Name
The name of the deployment package. The name must be 3 to 128 characters in length, and can contain letters, digits, and underscores (_). The name cannot be changed after the deployment package is created.
Version Name
The name of the deployment package version. The name must be 3 to 50 characters in length, and can contain letters, digits, and underscores (_).
Description
The description of the deployment package. The description must be 10 to 500 characters in length.
Resource Group
The name of the resource group to which the deployment package belongs.
Resource groups are used to group your resources by usage, permission, and region. You can use resource groups to organize your resources in a hierarchical manner and group resources based on users and projects. For more information, see Manage resource groups.
Tag Settings
The tags that you want to add to the deployment package. Select or enter complete tag keys and tag values. You can add up to 20 tags to a deployment package. If no tag key or tag value are available, you can create a custom tag. For more information, see Add a custom tag.
Configure the container image deployment package.
In this example, the
apache-php5image is uploaded.In the Deployment Package Content section, set the Deployment Package Type parameter to Container Image.
Click Obtain Access Credential to obtain the command that is used to log on to the Container Registry repository of Compute Nest and upload a container image to the Container Registry repository of Compute Nest.

Log on to the CLI and run the command obtained to log on to the Container Registry repository of Compute Nest.

Tag your container image.

Push the tagged container image to the Container Registry repository of Compute Nest.

Configure the Select Product parameter and click Publish Deployment Package.
View the deployment package.
Return to the Service Deployment Package page. On the Packages tab, find the deployment package and click its ID. On the Deployment Package Details page, view the deployment progress.
If the deployment package is in the Available state, the deployment package is created.
Use a container image deployment package
In this example, a private service is created to describe how to use a container image deployment package.
Log on to the Compute Nest console.
In the left-side navigation pane, click My Services. On the Created Services tab of the My Services page, click Create Service.
On the Create Service page, set Select Service Creation Method to Custom Launch, Select Service Type to Private Service, and then click Next: Configure Settings.

On the Create Service page, configure the parameters in the Basic Information section as prompted. In the Service Deployment section, set the nst.vendor.create.tplInputType.label parameter to Custom Template, select Manually Import Template, set the Deployment Method parameter to ROS, and then enter template content.
In the
ALIYUN::CS::ClusterApplicationresource of the ROS template, define the{{ computenest::acr::dockerconfigjson }}identifier that specifies the access credential and the{{ computenest::acrimage::yourimage }}identifier that specifies the container image deployment package.In the Deployment Package Association section, find Set Container Image Association and click Select Deployment Package. In the Select Deployment Package (Container Image Association) dialog box, select a deployment package and a version and click OK.
Configure other parameters and click Create Service. After the service is created, test the service. After the service passes the test, check whether the service meets the review criteria of Compute Nest service and submit the service for review. For more information, see Review criteria.
After the service is created, go to the details page of the service. On the Service Details tab, find the Service Deployment section and click the Associated Deployment Packages tab. On the Associate Container Image tab, view the associations with deployment packages.
References
For more information about how to create a service in Compute Nest, see Create a service.
If you no longer need a deployment package or deployment package version, you can delete it. For more information, see Delete a deployment package.
If you need to modify a deployment package such as the content, you can create a new version. For more information, see Create a version.
For more information about how to configure the update settings of a deployment package, see Configure service update settings.