Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Tekton 入門
Search
Mamoru Shimizu
May 28, 2019
Technology
4
1.6k
Tekton 入門
Red Hat Tech Night 2019.05 発表資料
https://ossbyredhat.connpass.com/event/130461/
Mamoru Shimizu
May 28, 2019
Tweet
Share
More Decks by Mamoru Shimizu
See All by Mamoru Shimizu
JBoss EAP for OpenShift
mamoru1112
0
88
Other Decks in Technology
See All in Technology
StrandsとNeptuneを使ってナレッジグラフを構築する
yakumo
1
120
Data Hubグループ 紹介資料
sansan33
PRO
0
2.7k
AI駆動開発を事業のコアに置く
tasukuonizawa
1
200
SREのプラクティスを用いた3領域同時 マネジメントへの挑戦 〜SRE・情シス・セキュリティを統合した チーム運営術〜
coconala_engineer
2
650
Ruby版 JSXのRuxが気になる
sansantech
PRO
0
150
Amazon S3 Vectorsを使って資格勉強用AIエージェントを構築してみた
usanchuu
3
450
OpenShiftでllm-dを動かそう!
jpishikawa
0
110
変化するコーディングエージェントとの現実的な付き合い方 〜Cursor安定択説と、ツールに依存しない「資産」〜
empitsu
4
1.4k
15 years with Rails and DDD (AI Edition)
andrzejkrzywda
0
190
OWASP Top 10:2025 リリースと 少しの日本語化にまつわる裏話
okdt
PRO
3
770
All About Sansan – for New Global Engineers
sansan33
PRO
1
1.3k
10Xにおける品質保証活動の全体像と改善 #no_more_wait_for_test
nihonbuson
PRO
2
290
Featured
See All Featured
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
0
2.3k
Skip the Path - Find Your Career Trail
mkilby
0
56
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.4k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
50
Code Reviewing Like a Champion
maltzj
527
40k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
60
42k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
6.9k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
270
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
120
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