您现在的位置是:热点 >>正文
一篇带你创建 Tekton 流水线
热点5460594人已围观
简介...
前面我们创建的两个任务 test 和 build-and-push 都已经完成了,我们还可以创建一个流水线来将这两个任务组织起来,形成一个流水线,这里就是我们要使用的 Pipeline 这个 CRD 对象。
创建流水线
比如我们这里的流水线流程为先运行 test 任务,如果通过了再执行后面的 build-and-push 这个任务,那么我们可以创建一个名为 test-pipeline.yaml 的资源对象,内容如下所示:
# test-pipeline.yaml apiVersion: tekton.dev/v1beta1 kind: Pipeline metadata: 一篇; name: test-pipeline spec: resources: # 为 Tasks 提供输入和输出资源声明 - name: demo-git type: git - name: harbor-image &nbs带你p; type: image tasks: # 添加task到流水线中 # 运行应用测试 - name: test taskRef: name: test&n创建bsp; resources: inputs: - name: repo # Task 输入名称 res Tource: demo-git # Pipeline 资源名称 # 构建并推送 Docker 镜像 - name: build-and-push taskRef: name: build-and-push ek runAfter: - test # 测试任务执行之后 resources: inputs: - name: reptoo # 指定输入的git仓库资源 resource: demo-git outputs: # 指定输出的镜像资源 - name: builtImage n resource: harbor-image
首先我们需要定义流水线需要哪些资源,可以是输入或者输出的资源,在这里我们只有一个输入,那就是命名为 repo 的应用程序源码的 GitHub 仓库。接下来定义任务,每个任务都通过 taskRef 进行引用,并传递任务需要的输入参数。
同样直接创建这个资源对象即可:
$ kubectl apply -f test-pipeline.yaml pipeline.tekton.dev/test-pipeline 流水created
前面我们提到过和通过创建 TaskRun 去触发 Task 任务类似,我们可以通过创建一个 PipelineRun 对象来运行流水线。这里我们创建一个名为 test-pipelinerun.yaml 的 PipelineRun 对象来运行流水线,文件内容如下所示:
apiVersion: tekton.dev/v1beta1 kind: PipelineRun metadata: name: test-pipelinerun spec: serviceAccountName:&n一篇bsp;build-sa pipelineRef: name: test-pipeline resources: - name: demo-git # 指定输入的git仓库资源 resourceRef: name: demo-git 带你; - name: harbor-image # 指定输出的镜像资源 resourceRef: name: harbor-image
定义方式和 TaskRun 几乎一样,通过 serviceAccountName 属性指定 ServiceAccount 对象,pipelineRef 关联流水线对象。同样直接创建这个资源,创建后就会触发我们的流水线任务了:
$ kubectl 创建;apply -f test-pipelinerun.yaml pipelinerun.tekton.dev/test-pipelinerun created $ github kubectl get pods | grep test-pipelinerun test-pipelinerun-build-and-push-62g65-pod-6jqqf 0/4 Init:1/2 &nb Tsp; 0 3s test-pipelinerun-test-c4r9m-pod-j7jjd 0/2 Completed 0 &nekbsp; 12s $ tkn pipelinerun describe test-pipelinerun Name: test-pipelinerun Namespace: default Pipeline Ref:  to; test-pipeline Service Account: build-sa Timeout: 1h0m0s Labels: tekton.dev/pipeline=test-pipeline
Tags:
下一篇:这娘们不像好人是什么梗
相关文章
标签: 越疆机器人 DOBOTAtom RoverX1 协作机器人
热点云梦级1月8日云梦级消息,日前,越疆机器人宣布正式启动A股上市计划,此举标志着这家已在港股主板挂牌的“协作机器人第一股”,正加速推进其在资本市场的双平台布局,有望进一步增强其全球竞争力与产业影响力。...
【热点】
阅读更多国产芯片再突破!5nm“龙鹰二号”正式发布,AI算力直达200TOPS
热点在 2026 年北京国际车展上,高性能车规级芯片领域迎来重磅进展。芯擎科技正式推出了其自主研发的 5 纳米车规级AI座舱芯片——“龙鹰二号”。这款芯片的问世,标志着国产高端车载芯片在先进工艺制程与跨域...
【热点】
阅读更多消息称去年全球IT支出超过5万亿美元 数据中心系统支出大幅增加
热点1月22日消息,据外媒报道,在OpenAI训练的人工智能聊天机器人ChatGPT大火之后,科技巨头们加大了在这一领域的投入,数据中心相关的支出也大幅增加。 有市场研究机构最新发布的全球IT行业支出报告...
【热点】
阅读更多
热门文章
最新文章
友情链接
- 标签: 康师傅
- https://www.welshmountainzoo.org/shop/index.php?routeproduct/search&tag=google霸屏优化【tg:seogoogle987】,ad5
- https://www.thedp.com/page/search?q=google霸屏优化【tg:seogoogle987】,2Vj
- https://www.kubb-tool.bfs.admin.ch/en/search?action=CHECK&q=google霸屏优化【tg:seogoogle987】,zNG
- https://www.mintos.org/?s=google霸屏优化【tg:seogoogle987】,rlZ
- https://hsmoa.com/search?query=google霸屏优化【tg:seogoogle987】H3p
- https://www.sdcard.org/ja/?s=google霸屏优化【tg:seogoogle987】,2c1
- https://www.safetv.go.kr/base/search/view?searchWord=google霸屏优化【tg:seogoogle987】10y
- https://www.universal-music.co.jp/search/?q=google霸屏优化【tg:seogoogle987】,10R
- https://www.roberthalf.com/us/en/jobs/all/google霸屏优化【tg:seogoogle987】SU6
- https://www.krisinformation.se/en/search?q=google霸屏优化【tg:seogoogle987】,jgH
- https://www.rotherham.gov.uk/site-search/results/?q=google霸屏优化【tg:seogoogle987】,HhD
- https://www.kaliastyle.com/catalogsearch/result/?q=GOOGLEgoogle霸屏优化【tg:seogoogle987】,tXX
- https://www.libros.unam.mx/catalogsearch/result/?cat=37&dir=asc&format=20&lit=20&manufacturer=3230&mode=list&order=year_edition&q=google霸屏优化【tg:seogoogle987】,3g6
- https://www.woorden.org/spreekwoord.php?woord=google霸屏优化【tg:seogoogle987】,nGG
- https://www.pixiv.net/tags/google霸屏优化【tg:seogoogle987】,dLc
- https://www.navymwr.org/search/?query=google霸屏优化【tg:seogoogle987】,aeC
- https://www.lauben.com/de/?s=google霸屏优化【tg:seogoogle987】,1En
- https://www.spoiledsweetboutique.com/search/google霸屏优化【tg:seogoogle987】,kVx
- https://www.simcoemuskokahealth.org/SearchResults.aspx?SearchQuery=google霸屏优化【tg:seogoogle987】,Fwn
- https://www.flickr.com/photos/tags/google霸屏优化【tg:seogoogle987】pem
- https://www.mynextmove.org/find/search?s=google霸屏优化【tg:seogoogle987】,iHo
- https://www.yli.ro/catalogsearch/result/?q=google霸屏优化【tg:seogoogle987】,tgy
- https://www.umc.edu/search.aspx?ID=I4gnDKRS991MFcIDDzoYze4aWSAszAm7&q=google霸屏优化【tg:seogoogle987】,3CF
- https://www.theaerogroup.net/?cat=28&s=google霸屏优化【tg:seogoogle987】,I1z
- https://www.roblox.com/discover/?cat=107&Keyword=google霸屏优化【tg:seogoogle987】,xrx
- https://www.dba.dk/soeg/?soeg=google霸屏优化【tg:seogoogle987】yVB
- https://xehay.vn/tim-kiem/=google霸屏优化【tg:seogoogle987】,k92
- https://www.vietnamconsulate-sf.org/?action=CHECK&s=google霸屏优化【tg:seogoogle987】,AiE
- https://www.lyrics.com/lyrics/google霸屏优化【tg:seogoogle987】,xYH
- https://www.wikiart.org/pt/Search/google霸屏优化【tg:seogoogle987】,8U0
- https://www.stormberg.com/no/search?q=google霸屏优化【tg:seogoogle987】,dZP
- https://www.sportbiketracktime.com/index.php?route=product/search&tag=google霸屏优化【tg:seogoogle987】,cxa
- https://www.unclefossil.com/search/google霸屏优化【tg:seogoogle987】,ttp
- https://www.so.com/s?ie=utf-8&src=360sou_home&_re=0&q=google霸屏优化【tg:seogoogle987】,skc
- https://www.lneg.pt/?cat=140&s=google霸屏优化【tg:seogoogle987】,vhb
- https://www.goodreads.com/quotes/tag/google霸屏优化【tg:seogoogle987】e8e
- https://www.u-bourgogne.fr/?cat=117&s=google霸屏优化【tg:seogoogle987】,uMT
- https://www.mesec.cz/vyhledavani/?qs=google霸屏优化【tg:seogoogle987】,Giq
- https://www.remit.co.jp/ne/?s=google霸屏优化【tg:seogoogle987】,zNx
- https://www.olx.ba/pretraga?trazilica=google霸屏优化【tg:seogoogle987】,nyt
- https://www.nextavenue.org/?action=QUERY&s=google霸屏优化【tg:seogoogle987】,BNP
- https://www.paxnet.co.kr/search/jongmok?kwd=google霸屏优化【tg:seogoogle987】bDI
- https://www.abbreviations.com/google霸屏优化【tg:seogoogle987】41K
- https://www.miamiopenmri.com/?action=CHECK&s=google霸屏优化【tg:seogoogle987】,CU5
- https://www.vocabulary.com/dictionary/google霸屏优化【tg:seogoogle987】,JJr
- https://www.televes.com/es/catalogsearch/result/?q=google霸屏优化【tg:seogoogle987】,vfC
- https://www.uckfieldtc.gov.uk/?s=google霸屏优化【tg:seogoogle987】,c43
- https://www.wilsonart.com/catalogsearch/result/?action=CHECK&q=google霸屏优化【tg:seogoogle987】,kRS
- https://www.searcychamber.com/list/search?AsfnA=DtkTQzs&q=google霸屏优化【tg:seogoogle987】,2kt
- https://www.samen-maier.at/search/google霸屏优化【tg:seogoogle987】,miY