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
Kubernetes Meetup Tokyo #20 / KubeCon Recap: Te...
Search
jyoshise
June 18, 2019
Technology
250
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Kubernetes Meetup Tokyo #20 / KubeCon Recap: Tekton
jyoshise
June 18, 2019
More Decks by jyoshise
See All by jyoshise
GitLab Duo Agent Platform + Local LLMサービングで幸せになりたい
jyoshise
0
820
米軍Platform One / Black Pearlに学ぶ極限環境DevSecOps
jyoshise
2
1k
AIがコード書きすぎ問題にはAIで立ち向かえ
jyoshise
14
15k
Nutanix Kubernetes PlatformでLLMを動かす話
jyoshise
0
580
CNDT2023_Nutanix_jyoshise
jyoshise
0
660
クラウドネイティブインフラおじさんがNutanixに入社することになったので以下略
jyoshise
0
1.3k
これは分散KVS? NoSQL? NewSQL? 謎の HarperDBにせまる
jyoshise
0
650
全てがクラウドネイティブで良いのか。その謎を明らかにすべく我々はエンプラの奥地に向かった
jyoshise
8
6.1k
Kubeadmによるクラスタアップグレード・その光と闇
jyoshise
3
4.8k
Other Decks in Technology
See All in Technology
負債のメタファと2026年 / Debt Metaphor in Agentic Engineering Age 202609 Edition
twada
PRO
5
2.3k
Claude in Chrome 入門 / Introduction to Claude in Chrome
cielo1985
0
810
AIによるクリエイティブ生成を行う上での試行錯誤
plaidtech
PRO
0
140
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
3
500
LTのテーマ どうきめてる?〜5つの型と私のやり方〜
yama3133
1
100
30座EKS, 180次升級淬煉的EKS Upgrade Skill 的歷程
eric8230
0
160
Amazon Quick on DesktopがIAM Identity Centerで動かない理由
yukiogawa
0
190
越境するなら専門用語を使うな高校校歌 / If you wanna cross border, you shouldn't use jargon
vtryo
0
140
AI de Idea
kawaguti
PRO
2
110
現場で役立つ技術負債の効果的な返済方法
masuda220
PRO
8
4k
aws-iot-platform-architecture-use-cases.pdf
ma2shita
0
120
Deployment の 先にある AI Agent 基盤 - kagent vNext、Agent Substrate、Hermes から読み解く Agent Runtime の現在地 / k8s-matsuri-2-ai-agent-platform-amsy810
masayaaoyama
3
550
Featured
See All Featured
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
880
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.8k
Abbi's Birthday
coloredviolet
4
10k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.3k
How to Think Like a Performance Engineer
csswizardry
28
2.8k
New Earth Scene 8
popppiees
4
2.6k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.3k
Optimizing for Happiness
mojombo
378
71k
Building the Perfect Custom Keyboard
takai
2
870
[SF Ruby Conf 2025] Rails X
palkan
3
1.4k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
330
Transcript
Modern CI/CD with Tekton and Prow Automated via Jenkins X
Kubernetes Meetup #20 @jyoshise
Slide: https://static.sched.com/hosted_files/kccnceu19/ 98/Modern%20CI_CD%20with%20Tekton%20and %20Prow%20Automated%20via%20Jenkins%20X. pdf Video: https://www.youtube.com/watch?v=4EyTGYB7Gv A
whoami 3 • Junichi Yoshise / 吉瀬 淳一 • @jyoshise
• Chief Architect, Cloud Native Computing • Hewlett Packard Enterprise
4
私のふだんの仕事によくあるパターン DevOpsの見積もりをください。 コンテナの。 ( ゚Д゚)ざっくりしてんな!
「DevOpsがやりたい」とエンタープライズなお客さん(インフラ/運 用部門)が言ったとき • だいたい以下のようなことを意味している • インフラ構築の手間を減らしたい →コンテナで解決するんでしょ? • アプリケーションリリースの手間を減らしたい →CI/CDで解決するんでしょ?(開発ベンダーはCIやってるみたいだけど)
• クラウドネイティブっぽいことがやりたい →時代はクラウドネイティブなんでしょ? • というわけで、「クラウド Kubernetesネイティブな、コンテナアプ リケーションのCI/CD」の検討が始まる • やっぱ違うね、となることもしばしば
CI/CDのざっくりイメージ Code Build/UT IT Deploy Continuous Stage
レガシーなCI/CD さすがにGit (SVNとかまだ 見るけど) ビルドサーバー でMavenとか ステージング環 境でテスト実行 本番環境のアプ リケーション
サーバーにデプ ロイ Code Build/UT IT Deploy Continuous Stage ステージング環 境のアプリケー ションサーバー にデプロイ • Artifact • Trigger
Continuous Delivery Foundation • The Linux Foundationの下位組織(CNCFと横並び)として2019年3月に発足 • 夢はCI/CDのAPI標準化 •
https://cd.foundation
Continuous Delivery Summit Presentations: https://github.com/cdfoundation/presentat ions/tree/master/2019-summit-barcelona Video: https://www.youtube.com/watch?v=P7hFp bAJNVY&list=PL2KXbZ9- EY9RB8bVvmiSOqB39eNMs-fAe
CI/CDツールの生まれた時代 11 2011 2015 2018 2019 オンプレベアメタル/仮想マシン クラウド仮想マシン コンテナ Kubernetes
Kubernetes Nativeであることとは • あらゆるプロセスはコンテナとして実行できる • オブジェクトはDeclarative(宣言的)に記述される • 状態の変更は拡張可能なKubernetes APIを通じて行われる
レガシーなCI/CD さすがにGit (SVNとかまだ 見るけど) ビルドサーバー でMavenとか ステージング環 境でテスト実行 本番環境のアプ リケーション
サーバーにデプ ロイ Code Build/UT IT Deploy Continuous Stage ステージング環 境のアプリケー ションサーバー にデプロイ • Artifact • Trigger
Kubernetes NativeなCI/CD さすがにGit (SVNとかまだ 見るけど) ビルドサーバー でMavenとか ステージング環 境でテスト実行 本番環境のアプ
リケーション サーバーにデプ ロイ Code Build/UT IT Deploy Continuous Stage ステージング環 境のアプリケー ションサーバー にデプロイ • Artifact • Trigger • Source Repo • Dockerfile / Docker Image • Kubernetes Manifest / Template • 各タスクをKubernetes上で(それぞれのタスクに特化 したコンテナとして)実行 • スケール、ログ、認証などはKubernetesエコシステム を利用 • Eventing (webhook) • Kube API
突然ですがGitOpsについて • GitOps とは • Desired Stateを全てコードとして、Git Repositoryで管理する • Git
Repository上の状態と実環境の状態は常に一致させる(Continuous Deployment) •そのためのツールは必要 • 変更はGit Repositoryに対するPull Request → Merge • 実環境上でコマンドを叩くオペレーションは原則禁止 • 状態定義がDeclarativeにできることが前提 • Kubernetesに最適(みんな大好きYAML) 15
各レイヤーでのGitOpsが考えられる • アプリのGitOps • Pod, Service • いわゆるCI/CD • インフラのGitOps
• Ingress Controller, 共通の Operator/CRD(Rook, Prometheus)など • secretは除く • そもそもKubernetes自体 • CI/CDパイプラインのGitOps • Pipeline as Code 16
Kubernetes NativeなCI/CD さすがにGit (SVNとかまだ 見るけど) ビルドサーバー でMavenとか ステージング環 境でテスト実行 本番環境のアプ
リケーション サーバーにデプ ロイ Code Build/UT IT Deploy Continuous Stage ステージング環 境のアプリケー ションサーバー にデプロイ • Artifact • Trigger • 各タスクをKubernetes上で(それぞれのタスクに特化 したコンテナとして)実行 • スケール、ログ、認証などはKubernetesエコシステム を利用 パイプライン定義も Kubernetes Object • Source Repo • Dockerfile / Docker Image • Kubernetes Manifest / Template • Eventing (webhook) • Kube API
そこでTektonですよ • 出身はKnative: Kubernetes上でのPaaS/Serverlessプラットフォームを 実現するプロジェクト 18 Knative-build Knative-serving Knative-eventing Knative-build-
pipeline https://github.com/tektoncd
tektoncd/pipelineの実体 • Deployment: • controller • webhook 19 $ kubectl
apply -f https://storage.googleapis.com/tekton-releases/latest/release.yaml その他サブプロジェクト: • tektoncd/dashboard • ダッシュボード(Web UI) • tektoncd/cli • tkn(CLI) • tektoncd/catalog • Taskの見本帳 • CRD: • PipelineResource • Task • TaskRun • Pipeline • PipelineRun • ClusterTask
Example(簡単なPipeline) image build source Dockerfile Manifest template Deploy Tekton Manifests
GitHub Repo Pipeline DockerHub kaniko Manifest 加工 kubectl Kubernetes Pipeline Task PipelineResource Step
PipelineResource CRD image build source Dockerfile Manifest template Deploy Tekton
Manifests GitHub Repo Pipeline DockerHub kaniko Manifest 加工 kubectl Kubernetes Pipeline Task PipelineResource Step
PipelineResource CRD • TaskがInput/Outputとして使うリソースを 定義 • typeは現時点で以下の四つだけ • git :
Gitレポジトリ • image : コンテナイメージのレジストリ • cluster : Kubernetesクラスタ • storage : GCS 22 apiVersion: tekton.dev/v1alpha1 kind: PipelineResource metadata: name: git-tektondemo spec: type: git params: - name: revision value: master - name: url value: https://github.com/jyoshise/tekton-demo- app.git
Task CRD image build source Dockerfile Manifest template Deploy Tekton
Manifests GitHub Repo Pipeline DockerHub kaniko Manifest 加工 kubectl Kubernetes Pipeline Task PipelineResource Step
Task CRD • 実行するタスクを定義 • spec.inputs / spec.outputs でタスクの入力/ 出力となるリソースの型を指定
• 実際にどのPipelineResourceを使うかは PipelineRun/TaskRunで実行時に指定する • spec.stepsはコンテナのspec • stepは複数指定可能。順番に実行される 24 apiVersion: tekton.dev/v1alpha1 kind: Task metadata: name: deploy-using-kubectl spec: inputs: resources: - name: source type: git - name: image type: image params: - name: path description: Path to the manifest to apply - name: yqArg description: Arg passed to yq - name: yamlPathToImage description: The path to the image to replace in the yaml manifest (arg to yq) steps: - name: replace-image image: mikefarah/yq command: ["yq"] args: - "w" - "-i" - "${inputs.params.yqArg}" - "${inputs.params.path}" - "${inputs.params.yamlPathToImage}" - "${inputs.resources.image.url}" - name: run-kubectl image: lachlanevenson/k8s-kubectl command: ["kubectl"] args: - "apply" - "-f" - "${inputs.params.path}"
Catalog • Taskの見本帳 • Knative-buildプロジェク トもいずれこちらに統 合されるかも 25
Pipeline CRD image build source Dockerfile Manifest template Deploy Tekton
Manifests GitHub Repo Pipeline DockerHub kaniko Manifest 加工 kubectl Kubernetes Pipeline Task PipelineResource Step
Pipeline CRD • パイプラインを定義 • 複数のTaskを並べ、Taskごとにパラメー ターとinputs/outputsを宣言する • inputとして前のTaskのoutputを指定する ことで依存関係が指定できる
27 apiVersion: tekton.dev/v1alpha1 kind: Pipeline metadata: name: demo-pipeline spec: resources: - name: source-repo type: git - name: web-image type: image tasks: - name: build-web taskRef: name: build-docker-image-from-git-source params: ... - name: deploy-web taskRef: name: deploy-using-kubectl resources: inputs: - name: source resource: source-repo - name: image resource: web-image from: - build-web params: - name: path value: /workspace/source/manifests/deployment.yaml - name: yqArg value: "-d1" - name: yamlPathToImage value: "spec.template.spec.containers[0].image"
PipelineRun/TaskRun CRD • PipelineやTaskを起動するためには、 PipelineRun/TaskRunのオブジェクトを生 成する必要がある • Event Triggeringがまだ実装されていないため •
権限を要するTaskを実行するには、ここ でserviceAccountを指定する • PipelineResourceはここで指定する 28 apiVersion: tekton.dev/v1alpha1 kind: PipelineRun metadata: name: demo-pipeline-run-1 spec: serviceAccount: build-bot pipelineRef: name: demo-pipeline resources: - name: source-repo resourceRef: name: git-tektondemo - name: web-image resourceRef: name: image-tektondemo
いちおうDashboardもあります 29
Demo 30
Tektonに今のところ足りてないモノ • Event Triggering • Log Persistence • SCM support
• Pipeline Resource / Taskの拡張性 31
Tektonの使い方いろいろ 32 https://www.slideshare.net/ChristieWilson3/tekton-showcase-cdf-summit-kubecon-barcelona-2019
Jenkins X + Prow + Tekton • Prow https://github.com/kubernetes/test-infra/tree/master/prow •
Kubernetes自体のCI/CDのために開発された • 各種プラグインによりGitHub上でChatOpsを実現する • Jenkins X Pipelines (Tekton Mode) https://jenkins-x.io/getting-started/next-gen- pipeline/ • まだearly work(隠しモード的な)。たぶんGKEでしか動かない • PipelineはJenkinsfileではなくjenkins-x.yamlで記述される→Tekton Pipelineに内部で変換される • Pipelineの実行はTektonのPipeline Controllerが行う。Jenkins Serverがいらない • デモは動画見てください! 33
まとめ 34
まとめ • Kubernetesを拡張してなんでも載せていく方向性としては、Tektonは筋が いい、なぜなら • Kubernetesの上で実行するCI/CDパイプラインをKubernetes Nativeに記述できる • それによってCI/CDパイプラインも宣言的に管理できる •
とはいえ現時点では単体でCI/CDツールとして完結するものではない • Jenkins Xのように、他ツールがTektonを利用する動きはこれから出てくる のでは • なのでTekton流のPipeline as Codeに親しんでおいて損はない 35
Thank You 36