1. 首页 > 软件下载 > 正文

CI/CD下载-Tekton下载地址-Tekton下载方法

1. Tekton简介与版本说明

Tekton是Kubernetes原生的CI/CD框架,提供灵活的构建、测试和部署工作流。Tekton通过自定义资源定义(CRD)在Kubernetes中定义Pipeline,实现可移植和可扩展的CI/CD系统。更多学习教程www.fgedu.net.cn

Tekton最新版本:

Tekton Pipeline v0.65.0(2026年3月发布)

Tekton Triggers v0.28.0(2026年3月发布)

Tekton Dashboard v0.50.0(2026年2月发布)

Tekton CLI v0.37.0(2026年2月发布)

Tekton核心组件:

Tekton Pipelines:核心组件,定义Task和Pipeline

Tekton Triggers:事件触发器,响应外部事件

Tekton Dashboard:Web管理界面

Tekton CLI:命令行管理工具

Tekton Catalog:可重用的Task模板库

2. Tekton下载地址

Tekton各组件可以从官方发布页面获取,支持多种安装方式。学习交流加群风哥微信: itpux-com

官方下载地址:

Tekton官方网站:https://tekton.dev/

Tekton Pipeline发布页面:https://github.com/tektoncd/pipeline/releases

Tekton Triggers发布页面:https://github.com/tektoncd/triggers/releases

Tekton Dashboard发布页面:https://github.com/tektoncd/dashboard/releases

Tekton CLI发布页面:https://github.com/tektoncd/cli/releases

# 查看Tekton Pipeline最新版本
$ curl -s “https://api.github.com/repos/tektoncd/pipeline/releases/latest” | grep -E ‘”tag_name”|”name”‘

输出示例如下:
“tag_name”: “v0.65.0”,
“name”: “v0.65.0”,

# 查看Tekton CLI最新版本
$ curl -s “https://api.github.com/repos/tektoncd/cli/releases/latest” | grep -E ‘”tag_name”|”browser_download_url”‘ | head -10

输出示例如下:
“tag_name”: “v0.37.0”,
“browser_download_url”: “https://github.com/tektoncd/cli/releases/download/v0.37.0/tkn_0.37.0_Linux_x86_64.tar.gz”,
“browser_download_url”: “https://github.com/tektoncd/cli/releases/download/v0.37.0/tkn_0.37.0_Darwin_x86_64.tar.gz”,
“browser_download_url”: “https://github.com/tektoncd/cli/releases/download/v0.37.0/tkn_0.37.0_Windows_x86_64.zip”

3. Tekton CLI工具下载安装

Tekton CLI(tkn)是命令行管理工具,用于管理Tekton资源。风哥提示:生产环境建议安装与集群版本匹配的CLI工具。

步骤1:Linux系统安装

# 下载最新版本CLI
# curl -LO https://github.com/tektoncd/cli/releases/latest/download/tkn_0.37.0_Linux_x86_64.tar.gz

输出示例如下:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 15.2M 100 15.2M 0 0 12.5M 0 0:00:01 0:00:01 –:–:– 12.8M

# 解压并安装
# tar xvzf tkn_0.37.0_Linux_x86_64.tar.gz -C /usr/local/bin tkn

输出示例如下:
tkn

# 验证安装
# tkn version

输出示例如下:
Client version: 0.37.0
Pipeline version: v0.65.0
Triggers version: v0.28.0
Dashboard version: v0.50.0

步骤2:macOS系统安装

# 使用Homebrew安装
$ brew install tektoncd-cli

输出示例如下:
==> Downloading https://ghcr.io/v2/homebrew/core/tektoncd-cli/manifests/0.37.0
==> Downloading https://ghcr.io/v2/homebrew/core/tektoncd-cli/blobs/sha256:abc123
==> Pouring tektoncd-cli–0.37.0.arm64_sonoma.bottle.tar.gz
🍺 /opt/homebrew/opt/tektoncd-cli/bin/tkn
==> Summary
🍺 /opt/homebrew/Cellar/tektoncd-cli/0.37.0: 10 files, 15MB

# 或手动下载安装
$ curl -LO https://github.com/tektoncd/cli/releases/latest/download/tkn_0.37.0_Darwin_x86_64.tar.gz
$ sudo tar xvzf tkn_0.37.0_Darwin_x86_64.tar.gz -C /usr/local/bin tkn

# 验证安装
$ tkn version

输出示例如下:
Client version: 0.37.0
Pipeline version: v0.65.0

步骤3:Windows系统安装

# 使用PowerShell下载
> Invoke-WebRequest -Uri “https://github.com/tektoncd/cli/releases/latest/download/tkn_0.37.0_Windows_x86_64.zip” -OutFile “tkn.zip”

# 解压文件
> Expand-Archive tkn.zip -DestinationPath C:\Tools\tkn

# 添加到PATH
> $env:PATH += “;C:\Tools\tkn”

# 验证安装
> tkn version

输出示例如下:
Client version: 0.37.0
Pipeline version: v0.65.0

4. Kubernetes安装Tekton

Tekton作为Kubernetes应用部署,支持多种安装方式。学习交流加群风哥QQ113257174

步骤1:安装Tekton Pipelines

# 安装最新版本Tekton Pipelines
# kubectl apply -f https://storage.googleapis.com/tekton-releases/pipeline/latest/release.yaml

输出示例如下:
namespace/tekton-pipelines created
namespace/tekton-pipelines-resolvers created
clusterrole.rbac.authorization.k8s.io/tekton-pipelines-admin created
clusterrole.rbac.authorization.k8s.io/tekton-pipelines-controller created
clusterrole.rbac.authorization.k8s.io/tekton-pipelines-webhook created
clusterrole.rbac.authorization.k8s.io/tekton-pipelines-resolver-rbac created

deployment.apps/tekton-pipelines-webhook created
deployment.apps/tekton-pipelines-resolvers created

# 查看部署状态
# kubectl get pods -n tekton-pipelines

输出示例如下:
NAME READY STATUS RESTARTS AGE
tekton-pipelines-controller-6b8c9d5f4d-abc12 1/1 Running 0 2m
tekton-pipelines-webhook-7c8f9d6b5d-abc34 1/1 Running 0 2m
tekton-pipelines-resolvers-8d9e0f1a2b-abc56 1/1 Running 0 2m

# 验证安装
# kubectl get crd | grep tekton

输出示例如下:
clustertasks.tekton.dev 2026-04-04T10:00:00Z
customruns.tekton.dev 2026-04-04T10:00:00Z
pipelineruns.tekton.dev 2026-04-04T10:00:00Z
pipelines.tekton.dev 2026-04-04T10:00:00Z
resolutionrequests.resolution.tekton.dev 2026-04-04T10:00:00Z
runs.tekton.dev 2026-04-04T10:00:00Z
taskruns.tekton.dev 2026-04-04T10:00:00Z
tasks.tekton.dev 2026-04-04T10:00:00Z

步骤2:安装Tekton Triggers

# 安装Tekton Triggers
# kubectl apply -f https://storage.googleapis.com/tekton-releases/triggers/latest/release.yaml

输出示例如下:
namespace/tekton-pipelines unchanged
clusterrole.rbac.authorization.k8s.io/tekton-triggers-admin created
clusterrole.rbac.authorization.k8s.io/tekton-triggers-core created
clusterrole.rbac.authorization.k8s.io/tekton-triggers-eventlistener created

deployment.apps/tekton-triggers-core-interceptors created

# 查看部署状态
# kubectl get pods -n tekton-pipelines | grep triggers

输出示例如下:
tekton-triggers-controller-9e0f1a2b3c-abc78 1/1 Running 0 1m
tekton-triggers-webhook-0f1a2b3c4d-abc90 1/1 Running 0 1m
tekton-triggers-core-interceptors-1a2b3c4d5e 1/1 Running 0 1m

步骤3:安装Tekton Dashboard

# 安装Tekton Dashboard
# kubectl apply -f https://storage.googleapis.com/tekton-releases/dashboard/latest/release.yaml

输出示例如下:
namespace/tekton-pipelines unchanged
serviceaccount/tekton-dashboard created
clusterrole.rbac.authorization.k8s.io/tekton-dashboard created
clusterrolebinding.rbac.authorization.k8s.io/tekton-dashboard created

deployment.apps/tekton-dashboard created

# 查看部署状态
# kubectl get pods -n tekton-pipelines | grep dashboard

输出示例如下:
tekton-dashboard-2b3c4d5e6f-abc12 1/1 Running 0 1m

# 暴露Dashboard服务
# kubectl port-forward -n tekton-pipelines svc/tekton-dashboard 9097:9097 &

输出示例如下:
[1] 12345
Forwarding from 127.0.0.1:9097 -> 9097
Forwarding from [::1]:9097 -> 9097

步骤4:安装Tekton Catalog Tasks

# 安装常用Task
# kubectl apply -f https://raw.githubusercontent.com/tektoncd/catalog/main/task/git-clone/0.9/git-clone.yaml

输出示例如下:
task.tekton.dev/git-clone created

# 安装Maven构建Task
# kubectl apply -f https://raw.githubusercontent.com/tektoncd/catalog/main/task/maven/0.2/maven.yaml

输出示例如下:
task.tekton.dev/maven created

# 安装Docker构建Task
# kubectl apply -f https://raw.githubusercontent.com/tektoncd/catalog/main/task/buildah/0.5/buildah.yaml

输出示例如下:
task.tekton.dev/buildah created

# 查看已安装的ClusterTask
# tkn clustertasks list

输出示例如下:
NAME DESCRIPTION AGE
git-clone Clone a git repository 1 minute ago
maven Build with Maven 1 minute ago
buildah Build container image 1 minute ago

5. Tekton Pipeline实战

Tekton Pipeline通过Task和Pipeline资源定义CI/CD工作流。更多学习教程公众号风哥教程itpux_com

步骤1:创建Task定义

# 创建构建Task
# cat > build-task.yaml << 'EOF' apiVersion: tekton.dev/v1 kind: Task metadata: name: build-task spec: params: - name: git-url type: string - name: git-revision type: string default: main - name: image-name type: string workspaces: - name: source steps: - name: clone image: alpine/git:v2.36.0 script: | git clone $(params.git-url) $(workspaces.source.path) cd $(workspaces.source.path) git checkout $(params.git-revision) - name: build image: maven:3.9.6-eclipse-temurin-17 workingDir: $(workspaces.source.path) script: | mvn clean package -DskipTests - name: test image: maven:3.9.6-eclipse-temurin-17 workingDir: $(workspaces.source.path) script: | mvn test - name: docker-build image: docker:latest workingDir: $(workspaces.source.path) script: | docker build -t $(params.image-name) . docker push $(params.image-name) volumeMounts: - name: docker-socket mountPath: /var/run/docker.sock volumes: - name: docker-socket hostPath: path: /var/run/docker.sock EOF # 应用Task定义 # kubectl apply -f build-task.yaml 输出示例如下: task.tekton.dev/build-task created

步骤2:创建Pipeline定义

# 创建Pipeline
# cat > build-pipeline.yaml << 'EOF' apiVersion: tekton.dev/v1 kind: Pipeline metadata: name: build-pipeline spec: params: - name: git-url type: string - name: git-revision type: string default: main - name: image-name type: string workspaces: - name: source tasks: - name: build taskRef: name: build-task params: - name: git-url value: $(params.git-url) - name: git-revision value: $(params.git-revision) - name: image-name value: $(params.image-name) workspaces: - name: source workspace: source EOF # 应用Pipeline定义 # kubectl apply -f build-pipeline.yaml 输出示例如下: pipeline.tekton.dev/build-pipeline created # 查看Pipeline # tkn pipeline list 输出示例如下: NAME AGE LAST RUN STARTED DURATION STATUS build-pipeline 10 seconds ago --- --- --- ---

步骤3:创建PipelineRun

# 创建PVC用于工作空间
# cat > workspace-pvc.yaml << 'EOF' apiVersion: v1 kind: PersistentVolumeClaim metadata: name: tekton-workspace spec: accessModes: - ReadWriteOnce resources: requests: storage: 5Gi EOF # kubectl apply -f workspace-pvc.yaml 输出示例如下: persistentvolumeclaim/tekton-workspace created # 创建PipelineRun # cat > pipeline-run.yaml << 'EOF' apiVersion: tekton.dev/v1 kind: PipelineRun metadata: name: build-pipeline-run spec: pipelineRef: name: build-pipeline params: - name: git-url value: https://github.com/fgedu/fgedu-app.git - name: git-revision value: main - name: image-name value: 192.168.1.51:5000/fgedu-app:latest workspaces: - name: source persistentVolumeClaim: claimName: tekton-workspace EOF # kubectl apply -f pipeline-run.yaml 输出示例如下: pipelinerun.tekton.dev/build-pipeline-run created

步骤4:查看Pipeline运行状态

# 查看PipelineRun状态
# tkn pipelinerun list

输出示例如下:
NAME STARTED DURATION STATUS
build-pipeline-run 1 minute ago 5m30s Succeeded

# 查看PipelineRun详情
# tkn pipelinerun describe build-pipeline-run

输出示例如下:
Name: build-pipeline-run
Namespace: default
Pipeline Ref: build-pipeline
Service Account: default
Timeout: 1h0m0s
Labels:
tekton.dev/pipeline=build-pipeline

Status
STARTED DURATION STATUS
1 minute ago 5m30s Succeeded

Message
Tasks Completed: 1 (Failed: 0, Cancelled 0), Skipped: 0

Taskruns
NAME TASK NAME STARTED DURATION STATUS
build-pipeline-run build 1 minute ago 5m30s Succeeded

# 查看TaskRun日志
# tkn pipelinerun logs build-pipeline-run

输出示例如下:
[clone] Cloning into ‘/workspace/source’…
[clone] remote: Enumerating objects: 100, done.
[clone] remote: Counting objects: 100% (100/100), done.
[clone] remote: Compressing objects: 100% (80/80), done.
[clone] Receiving objects: 100% (100/100), 1.20 MiB | 2.50 MiB/s, done.
[build] [INFO] Scanning for projects…
[build] [INFO] Building fgedu-app 1.0.0
[build] [INFO] Downloading from central: https://repo.maven.apache.org/maven2
[build] [INFO] BUILD SUCCESS
[test] [INFO] Running fgedu.app.AppTest
[test] [INFO] Tests run: 10, Failures: 0, Errors: 0, Skipped: 0
[docker-build] Sending build context to Docker daemon 50.2MB
[docker-build] Step 1/5 : FROM eclipse-temurin:17-jre
[docker-build] Successfully built abc123def456
[docker-build] Successfully tagged 192.168.1.51:5000/fgedu-app:latest

6. Tekton生产环境配置

生产环境需要对Tekton进行优化配置,确保稳定性和性能。from:www.itpux.com

步骤1:配置资源限制

# 创建ConfigMap配置资源限制
# cat > tekton-config.yaml << 'EOF' apiVersion: v1 kind: ConfigMap metadata: name: config-defaults namespace: tekton-pipelines data: default-timeout-minutes: "60" default-service-account: "default" default-managed-by-label-value: "tekton-pipelines" default-pod-template: | nodeSelector: kubernetes.io/os: linux resources: requests: cpu: "100m" memory: "256Mi" limits: cpu: "2" memory: "4Gi" EOF # kubectl apply -f tekton-config.yaml 输出示例如下: configmap/config-defaults configured

步骤2:配置私有镜像仓库认证

# 创建Docker Registry Secret
# kubectl create secret docker-registry registry-secret \
–docker-server=192.168.1.51:5000 \
–docker-username=admin \
–docker-password=admin123 \
–namespace=default

输出示例如下:
secret/registry-secret created

# 创建ServiceAccount
# cat > tekton-sa.yaml << 'EOF' apiVersion: v1 kind: ServiceAccount metadata: name: tekton-sa secrets: - name: registry-secret EOF # kubectl apply -f tekton-sa.yaml 输出示例如下: serviceaccount/tekton-sa created # 配置PipelineRun使用ServiceAccount # cat > pipeline-run-with-sa.yaml << 'EOF' apiVersion: tekton.dev/v1 kind: PipelineRun metadata: name: build-pipeline-run-sa spec: serviceAccountName: tekton-sa pipelineRef: name: build-pipeline params: - name: git-url value: https://github.com/fgedu/fgedu-app.git - name: image-name value: 192.168.1.51:5000/fgedu-app:latest workspaces: - name: source persistentVolumeClaim: claimName: tekton-workspace EOF

步骤3:配置监控

# 创建ServiceMonitor
# cat > tekton-monitor.yaml << 'EOF' apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: tekton-pipelines-monitor namespace: tekton-pipelines labels: release: prometheus spec: selector: matchLabels: app.kubernetes.io/component: controller app.kubernetes.io/name: tekton-pipelines endpoints: - port: http-metrics interval: 30s EOF # kubectl apply -f tekton-monitor.yaml 输出示例如下: servicemonitor.monitoring.coreos.com/tekton-pipelines-monitor created # 查看Tekton指标 # kubectl port-forward -n tekton-pipelines svc/tekton-pipelines-controller 9090:9090 & # curl http://localhost:9090/metrics | grep tekton | head -20 输出示例如下: # HELP tekton_pipelines_controller_pipelinerun_count Number of pipelineruns # TYPE tekton_pipelines_controller_pipelinerun_count gauge tekton_pipelines_controller_pipelinerun_count{status="running"} 5 tekton_pipelines_controller_pipelinerun_count{status="succeeded"} 150 tekton_pipelines_controller_pipelinerun_count{status="failed"} 10 # HELP tekton_pipelines_controller_taskrun_count Number of taskruns # TYPE tekton_pipelines_controller_taskrun_count gauge tekton_pipelines_controller_taskrun_count{status="running"} 8 tekton_pipelines_controller_taskrun_count{status="succeeded"} 450 tekton_pipelines_controller_taskrun_count{status="failed"} 25
生产环境建议:Tekton生产环境建议配置资源限制,避免Task占用过多资源。配置私有镜像仓库认证,确保镜像推送正常。使用PVC作为工作空间,支持多Task共享数据。配置监控告警,及时发现Pipeline执行失败。使用Tekton Triggers实现自动化触发,响应Git Webhook事件。定期清理历史PipelineRun,避免占用过多存储空间。

本文由风哥教程整理发布,仅用于学习测试使用,转载注明出处:http://www.fgedu.net.cn/10327.html

联系我们

在线咨询:点击这里给我发消息

微信号:itpux-com

工作日:9:30-18:30,节假日休息