knative自v0.7.0开始废弃现有的build而拥抱tekton,由于均是基于google的项目,所以镜像下载成为一个大问题。本文采用类似于knative墙内安装 的方式来处理镜像和安装脚本,适用于墙内安装体验。
安装流程
主要是替换yaml中无法墙内无法拉取到的gcr镜像的流程,具体如下。
生成所需yaml
下面是下载tekton安装yaml文件,并替换其中的gcr.io的镜像为ljchen提供的镜像的脚本。
1 | TEKTON_PATH='tekton' |
部署
执行完脚本之后,会生成对应的文件目录如下图所示:
1 | ~/Desktop/tekton tree |
其中的release.yaml
文件就是我们所需的安装文件,直接kubectl apply -f release.yaml
即可安装。安装完后,在tekton-pipelines命名空间下,会生成对应的pod,看名称和knative的build很像。
1 | # 查看pod,同build一致,均包含controller和webhook |
安装dashboard
下载dashboard的yaml文件:
1
wget https://raw.githubusercontent.com/tektoncd/dashboard/master/config/release/gcr-tekton-dashboard.yaml
替换gcr-tekton-dashboard.yaml 中的镜像
gcr.io/tekton-nightly/dashboard:latest
为ljchen/tekton-nightly_dashboard:latest
;- 部署到k8s,并映射端口出来。
1
2
3
4
5
6
7
8
9
10
11
12
13
14~ kct get pod
NAME READY STATUS RESTARTS AGE
tekton-dashboard-9bddff6bb-rzj6d 1/1 Running 0 6m43s
tekton-pipelines-controller-6cf456fc89-sfjzs 1/1 Running 1 12h
tekton-pipelines-webhook-58c9896d9b-6qd7v 1/1 Running 1 12h
~ kct get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
tekton-dashboard ClusterIP 10.99.93.239 <none> 9097/TCP 6m45s
tekton-pipelines-controller ClusterIP 10.100.85.20 <none> 9090/TCP 12h
tekton-pipelines-webhook ClusterIP 10.97.218.191 <none> 443/TCP 12h
~ kct port-forward --address 0.0.0.0 pod/tekton-dashboard-9bddff6bb-rzj6d 8888:9097
Forwarding from 0.0.0.0:8888 -> 9097
以下是打开后的界面,主要从tekton抽象概念的视角分别展现内容。另外,还提供了对resources引入的快捷操作。
配套镜像生成脚本
正常情况下,你不需要关注该脚本,除非己希望在墙外生成镜像并推送到自己的镜像仓库。对于只希望安装tokton的读者,请直接使用上一步中的yaml文件部署。
1 | TEKTON_PATH='tekton' |
gcr镜像映射表
老问题,排版有点儿难看,见谅!
gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/controller@sha256:80e040a58ce6c4d58ae893eb934777bce013ef8be079967dc3db783d76fa5aaa
=> ljchen/tekton_pipeline_cmd_controller:v0.4.0gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/webhook@sha256:da75fbdaeb800813d85b99f7f54b665e8d0edbb2c5a7ffc6a99d66aede0291a3
=> ljchen/tekton_pipeline_cmd_webhook:v0.4.0gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/kubeconfigwriter@sha256:2000fdb77fd830719533756afe246c460949b46eb0c7fc1841de17656d6f5114
=> ljchen/tekton_pipeline_cmd_kubeconfigwriter:v0.4.0gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/creds-init@sha256:b4877c99d928fad3cf26c995d171674b34d206178d6f9f0efb337ebff01bb34b
=> ljchen/tekton_pipeline_cmd_creds-init:v0.4.0gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/git-init@sha256:4b91c31560f18a8f09c68d5288f2261797b6df31522a57a9d7350bc0060a1284
=> ljchen/tekton_pipeline_cmd_git-init:v0.4.0gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/nop@sha256:9160ed41b20b2822d06e907d89f6398ea866c86a971f83371efb9e147fba079f
=> ljchen/tekton_pipeline_cmd_nop:v0.4.0gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/bash@sha256:0355a9b21a7c0cc9466bf75071648e266de07b5e13fbfd271ec791c45a818bdb
=> ljchen/tekton_pipeline_cmd_bash:v0.4.0gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/gsutil@sha256:6b6b8e02f6f03fb33cf3007b6b501e07bf2f435a0309482b868712a20f1dfd78
=> ljchen/tekton_pipeline_cmd_gsutil:v0.4.0gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/entrypoint@sha256:4d1fe990ca06ecc671370dfeab31d857efa8ccf81d632a672561c60482fd9aae
=> ljchen/tekton_pipeline_cmd_entrypoint:v0.4.0gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/imagedigestexporter@sha256:3d36cb375da0e4b5b5cf8b0964ed3d80f4645142ac609679c3b26a369f3ed340
=> ljchen/tekton_pipeline_cmd_imagedigestexporter:v0.4.0gcr.io/tekton-nightly/dashboard:latest
=> ljchen/tekton-nightly_dashboard:latest (该镜像构建时间为2019-06-30)