Releasing Apps on the CCSE Cluster Using Cloud Container Repository

2024-11-07 06:59:50

Scenario

Deploy a container application in the CCSE using container images from the CRS.

Before You Begin

        A CRS instance has been activated

        You have enabled a CCSE cluster

Procedure

Preparing Container Images

Based on your business requirements, you can build an image using a Dockerfile or use other pre-built images. This guide uses the official nginx image from https://hub.docker.com/ as an example. Execute the following command to pull the image:

docker pull nginx:stable-alpine

Pushing Container Images to Cloud Container Repository Instances

1.      Create a namespace in the Cloud Container Repository (optional: you can also use an existing namespace directly).

1.      Log in to the Cloud Container Repository console

2.      Click Container Image - Namespace in the left navigation pane

3.      On the Namespace page, click the Create Namespace button

4.      Create a namespace named "my-demo-ns"

 

2.      Create an image repository in the Cloud Container Repository (optional: when the namespace is set to allow automatic creation of repositories, you can create an image repository directly by pushing images)

1.      Log in to the Cloud Container Repository console

2.      Click Container Image - Image Repository in the left navigation pane

3.      On the Image Repository page, click the Create Repository button

4.      Create a private image repository named "nginx"

 

3.      Execute docker tag and push the image

docker tag nginx: stable-alpine <instance address>/my-demo-ns/nginx: stable-alpine
 
docker login<instanceaddress>
 
docker push <instance address>/my-demo-ns/nginx: stable-alpine

After a successful push, you can see the image edition in the created nginx image repository.

 

Creating Image Pull Credentials in CCSE (Optional)

If the image repository pushed in the previous step is public, this step is not necessary. However, if the repository is private, follow the steps below to create image pull credentials:

1.      Log in to the CCSE Console

2.      Click Cluster in the left navigation pane

3.      In the Cluster Management page, click the name of an existing cluster to access the Cluster Information page

4.      Click Namespaces in the left navigation pane, and click the Create button on the page to create a namespace (optional: you can also use an existing namespace directly).

5.      Click Configuration Management - Image Pull Credentials in the left navigation pane. Then, click the Add button on the page

6.      Fill in the relevant information to create image pull credentials, and click Submit to complete the creation.

Releasing Workloads in CCSE

1.      Log in to the CCSE Console

2.      Click Cluster in the left navigation pane

3.      In the Cluster Management page, click the name of an existing cluster to access the Cluster Information page

4.      Click Workloads - Stateless in the left navigation pane, and then click on the Add button on the page

5.      In the Instance Container section of the adding page, click Select Image and choose the image that has been previously pushed.

6.      On the adding page, click Show Advanced Settings. In the Image Pull Credentials section, click Add and select the image pull credential created earlier.

7.      After completing other related configurations, click Submit to release the workload.


r_sSma7hgOkU