This step describes how to publish one or more images in the TKE image repository, and how to use an image to create a Deployment in the TKE console.
Building configuration
- Log in to the Jenkins backend and click the task "test" created in the Slave pod building configuration step from the task list, as shown in the following figure:
- Click Build with Parameters in the left sidebar to open the "Project test" panel and configure the following parameters:
- mbranch: select the branch required for building. This document uses
origin/nginx
as an example.
- name: select the name of the image to be built based on your actual needs. This document uses
nginx
as an example.
- version: enter a custom image tag. This document uses
v1
as an example.
- Click Start Building.
After the building is successfully completed, go to the TKE console and choose Image Repository > My Images to view the built image.
Publishing in the Console
- Log in to the TKE console and click Clusters in the left sidebar.
- Select the target cluster ID and go to the cluster management page of the Deployment to be created.
- Click Create to go to the "Create a workload" page. See Creating a Deployment for the configuration of key parameters.
In "Containers in the pod", choose Select Image > My Images. Then, select the image that was successfully uploaded during the preceding building process.
- Click Save to finish creating the Deployment.
On the Pod Management page, the nginx pod is running normally if the deployment was successful.
- Log in to the Jenkins backend and click System Management in the left sidebar. Click System Configuration on the "Manage Jenkins" panel that appears.
- On the "System Configuration" page, customize the "number of executors". This document uses 10 as an example.
Note:
The number of executors is 10, indicating that 10 jobs can be executed at the same time.
- For other configuration items, ensure that they are consistent with those in the Configuring the slave pod template step.
- Create 10 tests by referring to the Slave pod building configuration step, as shown in the following figure.
- Configure building for multiple tasks by referring to the Building Configuration step.
- After the building is completed successfully, you can log in to the node and query the job pod by running the following command.
kubectl get pod
If the result similar to the following is returned, the call was successful.
Was this page helpful?