Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Tekton 入門
Search
Mamoru Shimizu
May 28, 2019
Technology
1.6k
4
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Tekton 入門
Red Hat Tech Night 2019.05 発表資料
https://ossbyredhat.connpass.com/event/130461/
Mamoru Shimizu
May 28, 2019
More Decks by Mamoru Shimizu
See All by Mamoru Shimizu
JBoss EAP for OpenShift
mamoru1112
0
100
Other Decks in Technology
See All in Technology
カンファレンスに参加した後の浮遊感とセルフケア
pauli
0
320
OpenSharing について熱く語る〜AI アセットの共有について〜
kameitomohiro
0
250
今こそ知りたいAmplifyGen2
mkdev10
2
160
Kiro Crewをはじめよう
kizawa2020
1
120
しろおびから始める!ログ活用の第一歩
shumei_ito
0
860
AI時代に必要な脅威モデリング― 変化の速度に負けない理解とリスク判断
masakane55
5
1.2k
二歩目のフロントエンド・ウェブアクセシビリティ
camiha
2
300
生成AIと進める探索的データ分析(2026.10.03 第122回Tokyo.R勉強会)
tatamiya
2
1.5k
12 個 Tool と、 4,096 Token
hlum
0
110
IoTデバイスを繋げるプロトコルMatterをAndroidで使用する方法
harutiro
0
130
"優秀な誰か"の下位互換にならないために
yut0naga1_fa
0
1.6k
OSC2026on_the-world-is-waiting-for-your-voice.pdf
naruoga
0
370
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1033
470k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
68
58k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Making the Leap to Tech Lead
cromwellryan
135
10k
BBQ
matthewcrist
90
10k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
203
77k
Designing for humans not robots
tammielis
254
26k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.4k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
320
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
300
Transcript
Red Hat Tech Night 2019.05 Tekton 入門 Mamoru Shimizu Global
Professional Service / Consultant May 28th, 2019 1
Copyright 2019 Red Hat K.K. 2 自己紹介 • 名前: Mamoru
Shimizu ◦ Twitter / Qiita: @mamomamo • Role: Consultant • 最近の仕事 ◦ OpenShift 上のアプリケーション開発支援 ◦ OpenShift の設計・構築支援 ◦ JBoss EAP を使ったアプリケーション開発支援
Copyright 2019 Red Hat K.K. 3 Tekton 概要 • Kubernetes
ネイティブな CI/CD パイプラインを作るOSSのフレームワーク • CI/CD ツールとプロセスの標準化に役立つOSSのコンポーネント群を提供、クラウド プラットフォームに依存しないパイプラインを構築可能 • コンテナを実行ブロックの単位として扱う • 2019年3月に発足した “Coutinuous Delivery Foundation” がホストしている中で最 も知られてないプロジェクト
Copyright 2019 Red Hat K.K. 4 インストール方法 • 以下のコマンドでインストール可能 (cluster-admin
で実行必須) • カスタムコントローラのデプロイと CRD (Custom Resource Definition) を作成 • 以下の2つの Pod が作成される $ oc new-project tekton-pipelines $ oc adm policy add-scc-to-user anyuid -z tekton-pipelines-controller $ oc apply --filename https://storage.googleapis.com/tekton-releases/latest/release.yaml $ oc get po NAME READY STATUS RESTARTS AGE tekton-pipelines-controller-54d7bd8956-z7gjp 1/1 Running 0 1m tekton-pipelines-webhook-66cfc6cd57-kl5mt 1/1 Running 0 1m
Copyright 2019 Red Hat K.K. 5 Custom Resource Definition 種別
• Pipeline >- Task >- Step の包含関係 • CRD (Custom Resource Definition) の種別は以下の通り 種別 説明 PipelineResource Task で利用するインプット /アウトプットを指定するリソース Task 最小の実行単位、複数の Step から構成されたリソース TaskRun Task を実行するためのリソース Pipeline 複数の Task から構成されたリソース PipelineRun Pipeline を実行するためのリソース
Copyright 2019 Red Hat K.K. 6 PipelineResource 設定例 • type:
インプット/アウトプットのタイプを 指定 • 現在サポート対象のタイプ ◦ Git Resource ◦ Image Resource ◦ Cluster Resource ▪ 他の k8s クラスタへのアプリケーショ ンのデプロイ ◦ Storage Resource ▪ GCS(Google Cloud Storage) のみサ ポート apiVersion: tekton.dev/v1alpha1 kind: PipelineResource metadata: name: skaffold-git spec: type: git params: - name: revision value: master - name: url value: https://github.com/GoogleContainerTools/skaffold
Copyright 2019 Red Hat K.K. 7 Task 設定例 • inputs:
インプットに必要な PipelineResource とパラメータの指定 • outputs: Task によって作成される PipelineResource を指定 • steps: 実行したいコンテナイメージを指 定、コンテナが実行ブロックの単位 apiVersion: tekton.dev/v1alpha1 kind: Task metadata: name: build-docker-image-from-git-source spec: inputs: resources: - name: docker-source type: git params: - name: pathToDockerFile ・・・ outputs: resources: - name: builtImage type: image steps: - name: build-and-push image: gcr.io/kaniko-project/executor command: - /kaniko/executor args: - --dockerfile=${inputs.params.pathToDockerFile} ・・・
Copyright 2019 Red Hat K.K. 8 TaskRun 設定例 • taskRef:
実行したい Task を指定 • resources: インプット/アウトプットとなる PipelineResource を指定 • serviceAccount: Task を実行するサー ビスアカウントを指定 • nodeSelector / tolerations / affinity: Pod と同様に Task を実行するノードを 制御可能 apiVersion: tekton.dev/v1alpha1 kind: TaskRun metadata: name: build-docker-image-from-git-source-task-run spec: taskRef: name: build-docker-image-from-git-source inputs: resources: - name: docker-source resourceRef: name: skaffold-git params: - name: pathToDockerFile value: Dockerfile - name: pathToContext value: /workspace/docker-source/examples/microservices/leeroy-web outputs: resources: - name: builtImage resourceRef: name: skaffold-image-leeroy-web
Copyright 2019 Red Hat K.K. 9 Pipeline 設定例 • tasks:
実行する一連の Task を指定 • from: 先行する Task のアウトプットの PipelineResource がある場合に指定 • runAfter: 別の Task の完了後に実行す る場合に指定、アウトプットを連携する 必要はない • retries: Task の実行に失敗した際にリト ライした場合に指定 apiVersion: tekton.dev/v1alpha1 kind: Pipeline metadata: name: tutorial-pipeline spec: resources: ・・・ tasks: - name: build-skaffold-web taskRef: name: build-docker-image-from-git-source params: ・・・ resources: inputs: ・・・ outputs: ・・・ - name: deploy-web taskRef: name: deploy-using-kubectl resources: inputs: ・・・ - name: image resource: web-image from: - build-skaffold-web params: ・・・
Copyright 2019 Red Hat K.K. 10 PipelineRun 設定例 • pipelineRef:
実行したい Pipeline を指 定 • resources: インプット/アウトプットとな る PipelineResource を指定 • serviceAccount: Task を実行するサー ビスアカウントを指定 • nodeSelector / tolerations / affinity: Pod と同様に Task を実行するノードを 制御可能 apiVersion: tekton.dev/v1alpha1 kind: PipelineRun metadata: name: tutorial-pipeline-run-1 spec: pipelineRef: name: tutorial-pipeline resources: - name: source-repo resourceRef: name: skaffold-git - name: web-image resourceRef: name: skaffold-image-leeroy-web
Copyright 2019 Red Hat K.K. 11 TaskRun / PipelineRun 実行方法
• PipelineResource -> Task -> Pipeline -> PipelineRun の順にリソースを作成 • 以下のようなコマンドでパイプラインの実行結果を確認 $ oc apply -f <name-of-file.yaml> $ oc get pipelineruns/<name-of-pipeline> -o yaml
Copyright 2019 Red Hat K.K. 12 まとめ (所感) • Kubernetes
ネイティブな CI/CD パイプラインを作るOSSのフレームワーク • クラウドプラットフォームに依存しないパイプラインの記述方法が可能であり、コンテ ナを実行ブロックの単位として扱うことが可能 • 普段から Kubernetes / OpenShift のYAMLを書き慣れている人にとって、Task / Pipeline の書き方は理解し易いように感じた。 • 真面目にLT発表してみましたが、RHTNの雰囲気に合っているか正直分かりません。
linkedin.com/company/red-hat youtube.com/user/RedHatVideos facebook.com/redhatinc twitter.com/RedHat Red Hat is the world’s leading
provider of enterprise open source software solutions. Award-winning support, training, and consulting services make Red Hat a trusted adviser to the Fortune 500. Thank you 13