tencent cloud

Tencent Kubernetes Engine

Release Notes and Announcements
Release Notes
Announcements
Release Notes
Product Introduction
Overview
Strengths
Architecture
Scenarios
Features
Concepts
Native Kubernetes Terms
Common High-Risk Operations
Regions and Availability Zones
Service Regions and Service Providers
Open Source Components
Purchase Guide
Purchase Instructions
Purchase a TKE General Cluster
Purchasing Native Nodes
Purchasing a Super Node
Getting Started
Beginner’s Guide
Quickly Creating a Standard Cluster
Examples
Container Application Deployment Check List
Cluster Configuration
General Cluster Overview
Cluster Management
Network Management
Storage Management
Node Management
GPU Resource Management
Remote Terminals
Application Configuration
Workload Management
Service and Configuration Management
Component and Application Management
Auto Scaling
Container Login Methods
Observability Configuration
Ops Observability
Cost Insights and Optimization
Scheduler Configuration
Scheduling Component Overview
Resource Utilization Optimization Scheduling
Business Priority Assurance Scheduling
QoS Awareness Scheduling
Security and Stability
TKE Security Group Settings
Identity Authentication and Authorization
Application Security
Multi-cluster Management
Planned Upgrade
Backup Center
Cloud Native Service Guide
Cloud Service for etcd
TMP
TKE Serverless Cluster Guide
TKE Registered Cluster Guide
Use Cases
Cluster
Serverless Cluster
Scheduling
Security
Service Deployment
Network
Release
Logs
Monitoring
OPS
Terraform
DevOps
Auto Scaling
Containerization
Microservice
Cost Management
Hybrid Cloud
AI
Troubleshooting
Disk Full
High Workload
Memory Fragmentation
Cluster DNS Troubleshooting
Cluster kube-proxy Troubleshooting
Cluster API Server Inaccessibility Troubleshooting
Service and Ingress Inaccessibility Troubleshooting
Common Service & Ingress Errors and Solutions
Engel Ingres appears in Connechtin Reverside
CLB Ingress Creation Error
Troubleshooting for Pod Network Inaccessibility
Pod Status Exception and Handling
Authorizing Tencent Cloud OPS Team for Troubleshooting
CLB Loopback
API Documentation
History
Introduction
API Category
Making API Requests
Elastic Cluster APIs
Resource Reserved Coupon APIs
Cluster APIs
Third-party Node APIs
Relevant APIs for Addon
Network APIs
Node APIs
Node Pool APIs
TKE Edge Cluster APIs
Cloud Native Monitoring APIs
Scaling group APIs
Super Node APIs
Other APIs
Data Types
Error Codes
TKE API 2022-05-01
FAQs
TKE General Cluster
TKE Serverless Cluster
About OPS
Hidden Danger Handling
About Services
Image Repositories
About Remote Terminals
Event FAQs
Resource Management
Service Agreement
TKE Service Level Agreement
TKE Serverless Service Level Agreement
Contact Us
Glossary

Step 2:Slave pod build configuration

PDF
Focus Mode
Font Size
Last updated: 2025-12-30 11:24:49
This document describes how to build a slave pod in Jenkins by creating and configuring a job.
Note
The UI of Jenkins varies with the product version. Select an appropriate version based on your business needs.

Creating a Job

1. Log in to the Jenkins backend and click New Item or Create an item.
2. On the page that appears, configure the basic information of the job.
Enter an item name: Enter a custom name. This document uses test as an example.
Select Freestyle project.
3. Click OK to go to the job parameter configuration page.
4. Configure the job basic information.
Description: Enter the descriptive information of the job. This document uses slave pod test as an example.
This project is parameterized: Check this option and choose Add Parameter > Git Parameter.

Configuring Job Parameters

1. On the Git Parameter panel, configure the following parameters as shown below:



The following describes the main parameters. For other parameters, simply keep them as their defaults:
Name: Enter mbranch, which can be used to match and obtain a branch.
Parameter Type: Select Branch or Tag.
2. Choose Add Parameter > Extended Choice Parameter. On the panel that appears, configure the following parameters as shown below:

The following describes the main parameters. For other parameters, simply keep them as their defaults:
Name: Enter name, which can be used to obtain the image name.
Basic Parameter Types: Check this option.
Parameter Type: Select Check Boxes.
Value: Check this option and enter a custom image name. The name will be passed to the name variable. This document uses nginx,php as an example.
3. Choose Add Parameter > Extended Choice Parameter. On the panel that appears, configure the following parameters as shown below:

The following describes the main parameters. For other parameters, simply keep them as their defaults:
Name: Enter version, which can be used to obtain the image tag variable.
Basic Parameter Types: Check this option.
Parameter Type: Select Text Box to obtain the image value in text format and pass it to the version variable.
4. Check Restrict where this project can be run. For Label Expression, enter the pod label jnlp-agent set in the Configuring the slave pod template step as shown below:




Configuring Source Code Management

In the Source Code Management tab, check Git and configure the following settings:
Repositories:
Repository URL: Enter your GitLab repository address, such as https://gitlab.com/user-name/demo.git.
Credentials: Select the authentication credential created in the Adding the GitLab credential step.
Branches to build:
**Branch Specifier (blank for 'any')**: Enter $mbranch, which is used to dynamically obtain the branch. Its value corresponds to the value of mbranch defined in "Git Parameter".

Configuring the Shell Packaging Script

1. In the Build tab, choose Add build step > Execute Shell.
2. Copy and paste the following script to the Command entry box. Then, click Save.
Note
In this script, information such as the GitLab repository address, TKE image address, and username and password of the image repository are used as examples only. In actual cases, replace them based on your needs.
Make sure that you build the package based on the source code of Docker build. In addition, the working directory /home/Jenkins/agent must be consistent with the working directory of the Container Template in the “Containers” list.
echo "GitLab address: https://gitlab.com/[user]/[project-name]].git"
echo "Selected branch (image): "$mbranch", set branch (image) version: "$version"
echo "TKE image address: hkccr.ccs.tencentyun.com/[namespace]/[ImageName]"

echo "1. Log in to the TKE image repository"
docker login --username=[username] -p [password] hkccr.ccs.tencentyun.com

echo "2. Build the package based on the source code of Docker build:"
cd /home/Jenkins/agent/workspace/[project-name] && docker build -t $name:$version

echo "3. Upload the Docker image to the TKE repository:"
docker tag $name:$version hkccr.ccs.tencentyun.com/[namespace]/[ImageName]:$name-$version
docker push hkccr.ccs.tencentyun.com/[namespace]/[ImageName]:$name-$version
The script provides the following features:
Obtain the selected branch, image name, and image tag.
Publish the docker image combined and built with the code to the TKE image repository.

Subsequent Operations

You have now successfully built the slave pod. Next, go to Building Tests to publish and verify images.

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback