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
サーバーレスからコンテナまで。Knativeのお話
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Kazuto Kusama
August 28, 2018
Technology
11
2.1k
サーバーレスからコンテナまで。Knativeのお話
第38回PaaS勉強会で発表した資料です
Kazuto Kusama
August 28, 2018
Tweet
Share
More Decks by Kazuto Kusama
See All by Kazuto Kusama
OpenClawで回す組織運営
jacopen
3
690
SREの仕事を自動化する際にやっておきたい5つのポイント
jacopen
6
1.4k
AI時代のインシデント対応 〜時代を切り抜ける、組織アーキテクチャ〜
jacopen
4
320
AI時代の開発とPlatform Engineeringについて考える
jacopen
0
95
AI によってシステム障害が増える!? ~AI エージェント時代だからこそ必要な、インシデントとの向き合い方~
jacopen
4
360
インシデント対応に必要となるAIの利用パターンとPagerDutyの関係
jacopen
0
320
今日からはじめるプラットフォームエンジニアリング
jacopen
8
4.6k
Platform Engineeringで クラウドの「楽しくない」を解消しよう
jacopen
8
1.7k
トラシューアニマルになろう ~開発者だからこそできる、安定したサービス作りの秘訣~
jacopen
4
6.2k
Other Decks in Technology
See All in Technology
[E2]CCoEはAI指揮官へ。Bedrock×MCPで構築するコスト・セキュリティ自律運用基盤
taku1418
0
130
マネージャー版 "提案のレベル" を上げる
konifar
22
15k
JAWS DAYS 2026 ExaWizards_20260307
exawizards
0
410
複数クラスタ運用と検索の高度化:ビズリーチにおけるElastic活用事例 / ElasticON Tokyo2026
visional_engineering_and_design
0
130
us-east-1 に障害が起きた時に、 ap-northeast-1 にどんな影響があるか 説明できるようになろう!
miu_crescent
PRO
13
4.2k
8万デプロイ
iwamot
PRO
2
230
NewSQL_ ストレージ分離と分散合意を用いたスケーラブルアーキテクチャ
hacomono
PRO
2
250
情シスのための生成AI実践ガイド2026 / Generative AI Practical Guide for Business Technology 2026
glidenote
0
200
JAWS FESTA 2025でリリースしたほぼリアルタイム文字起こし/翻訳機能の構成について
naoki8408
1
340
脳内メモリ、思ったより揮発性だった
koutorino
0
210
新職業『オーケストレーター』誕生 — エージェント10体を同時に回すAgentOps
gunta
4
1.8k
20260311 ビジネスSWG活動報告(デジタルアイデンティティ人材育成推進WG Ph2 活動報告会)
oidfj
0
260
Featured
See All Featured
Skip the Path - Find Your Career Trail
mkilby
1
76
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.5k
Bash Introduction
62gerente
615
210k
Google's AI Overviews - The New Search
badams
0
930
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
1.9k
GitHub's CSS Performance
jonrohan
1032
470k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
480
Build your cross-platform service in a week with App Engine
jlugia
234
18k
The untapped power of vector embeddings
frankvandijk
2
1.6k
The SEO Collaboration Effect
kristinabergwall1
0
390
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
120
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Transcript
© Copyright 2018 Pivotal Software, Inc. All rights Reserved. Version
1.0 サーバーレスからコンテナまで。 Knativeのお話
Pivotal Japan - Solutions Architect Kazuto Kusama @jacopen
こういう勉強会の運営やってます
クラウドネイティブ時代 平成も終わろうとしていますが、この 業界の今を表すとしたらこういう感じ でしょうか
https://www.cncf.io/projects/ さまざまなツール・ プラットフォーム CNCFを中心として クラウドネイティブにまつわるツール がだいぶ出揃いました
Cloud Native Developers JP https://cnd.connpass.com/ Cloud Native Meetup Tokyo https://cloudnative.connpass.com/
Cloud Native Deep Dive https://www.meetup.com/ja-JP/Cloud-Native-Deep-Dive/ 国内だと、 Cloud Nativeと名の付く勉 強会だけでも3つあったりし ます
僕の考えた最強のクラウドネイティブ基盤 Microservices いろんな妄想が捗りますね。 まずはアプリをマイクロサービスで 作ってみて
僕の考えた最強のクラウドネイティブ基盤 Microservices Service Mesh Circuit Breaker Service Discovery Traffic Control
サービスメッシュなんかも入れたりし て
僕の考えた最強のクラウドネイティブ基盤 Microservices Service Mesh Circuit Breaker Canary Release Service Discovery
Blue-Green Deployment Traffic Control カナリアリリースやBlue Green Deploymentもプラットフォーム側で やれるようにして
僕の考えた最強のクラウドネイティブ基盤 Microservices Service Mesh Circuit Breaker Canary Release Distributed Tracing
Service Discovery Blue-Green Deployment Traffic Control ついでに分散トレーシング入れたり
僕の考えた最強のクラウドネイティブ基盤 Microservices Service Mesh Circuit Breaker Canary Release Serverless Distributed
Tracing Service Discovery Blue-Green Deployment Traffic Control さらにはサーバーレス的な要素いれ たりして
僕の考えた最強のクラウドネイティブ基盤 Microservices Service Mesh Circuit Breaker Canary Release Serverless Distributed
Tracing Service Discovery Blue-Green Deployment Traffic Control 強そう
コンテナをどうProductionに投入するか? どのくらい大きな規模で運用するか? を模索する時代 コンテナとは何か? どう活用するか? を模索する時代 世の中の興味の流れ 2013 2014 2015
2016 2017 2018 2019 ? 興味の流れとしてはこんな感じでしょうか。今は コンテナをどう実戦投入するかでKubernetesを 検討されているのでは。 では、2019年以降はどうでしょうか?
コンテナをどうProductionに投入するか? どのくらい大きな規模で運用するか? を模索する時代 コンテナとは何か? どう活用するか? を模索する時代 世の中の興味の流れ 2013 2014 2015
2016 2017 2018 2019 ? どうCloud Nativeな仕組みに していくか? おそらく、どうCloud Nativeな仕組み・プラットフォー ムにするかが焦点となるでしょう
でもちょっとまって
こんなのやりました Japan Container Daysでこんな 発表やってみたワケですけど、 結構好評でした。
『コンテナ疲れ』と戦う、k8s・PaaS・Serverlessの活用法 https://www.slideshare.net/jacopen/k8spaasserverless コンテナつらい・・・
『コンテナ疲れ』と戦う、k8s・PaaS・Serverlessの活用法 https://www.slideshare.net/jacopen/k8spaasserverless Kubernetes難しい・・・
で、その状態でさらにIstio入れる? さらにIstioの概念覚えて、 Manifest書きたいですか?
もっとシンプルに使える仕組みが必要
Serverless≒ AWS Lambda Cloud Native Technologies Are Scaling Production Applications
https://www.cncf.io/blog/2017/12/06/cloud-native-technologies-scaling-production-applications/ のデータを元に作成 Serverless Computingの重要性は 日に日に増しているが、現状としてAWS1強
さらに FaaS以外にもServerlessの概念が広がりつつある Amazon Aurora Serverless https://aws.amazon.com/jp/rds/aurora/serverless/
そんな状況で誕生したのが・・・
None
Kubernetes, Serverless, and You (Cloud Next '18) https://www.youtube.com/watch?v=LtELzpw1l1M Knative -
Serverless workloadのためのBuilding Block
Knative [kay-nay-tiv] ケイネイティブ 発音 “K”を発音せず『ネイティブ』と読ませる案もありま したが、公式に『ケイネイティブ』と 定められています。
誰が作っている? Google Pivotal IBM Red Hat SAP など
テクノロジースタック
テクノロジースタック Kubernetesの上で動くこと Istioを内包していること が大きなポイントです
Knativeでは 何ができるのか コンテナのデプロイ ソースコードからのデプロイ Blue-GreenデプロイやCanary Release ワークロードに応じたオートスケール イベントドリブンなワークロードの実行
DEMO 現地でデモした再現 apiVersion: serving.knative.dev/v1alpha1 kind: Service metadata: name: helloworld-go namespace:
default spec: runLatest: configuration: revisionTemplate: spec: container: image: gcr.io/knative-samples/helloworld-go env: - name: TARGET value: "Go Sample v1" k8sよりシンプルな Manifestを用意して $ kubectl apply -f deploy-container.yml service.serving.knative.dev/helloworld-go created $ kubectl get pods NAME READY STATUS RESTARTS AGE helloworld-go-00001-deployment-6df677c5cd-6h4kd 3/3 Running 0 40s kubectlでapplyすると なんか動いたっぽいぞ
DEMO 現地でデモした再現 $ knctl route list Routes in namespace 'default'
Name Traffic All Traffic Assigned Ready Domain Age helloworld-go 100% -> helloworld-go: - - helloworld-go.default.knative.udcp.info 4s 実はこの時点で、自動で ドメインが払い出されており もうブラウザで繋ぎにいくことが出来 ます
DEMO 現地でデモした再現 Kubernetesで同じことをやろうとすると、 Deployment、ReplicaSet、Pod、Service type:LoadBalancer、 Ingressなどなど、 定義しなきゃいけないもの沢山ありますよね。 それが10行ちょっとのYAMLで出来てしまうので、 これだけでも楽になっていることは分かるでしょう。
Knativeのしくみ
Serving Scale to zero, request-driven compute model • ゼロからスケールする、リクエストドリブンの コンピュートモデルを実現するコンポーネント
◦ サーバーレスのワークロードを素早くデプロイ ◦ 自動でスケールアップ・ダウン ◦ Istioを利用したルーティングの設定 ◦ デプロイされたコードや設定のスナップショット https://github.com/knative/docs/tree/master/serving ServingはKnativeのコンポーネン トで最も重要な存在です。
Serving Scale to zero, request-driven compute model • 4つのCustom Resourceを用いて実現
◦ Service - service.serving.knative.dev ◦ Route - route.serving.knative.dev ◦ Configuration - configuration.serving.knative.dev ◦ Revision - revision.serving.knative.dev https://github.com/knative/docs/tree/master/serving さっきのデモでは、このServiceを 定義してデプロイしました。 それにより自動でRouteと Configurationが作成されました
Builds Cloud-native source to container orchestration • ソースコードからのイメージ作成を実現するコンポーネント ◦ gitリポジトリからソースコードを取得
◦ 複数のジョブを実行(依存関係のインストールやテストの実行 など) ◦ コンテナイメージへの作成 ◦ イメージリポジトリへのpush • Build - Ship - RunのうちBuildとShipを担う • プラガブルであり、さまざまなイメージビルドの仕組みを利用可能 ◦ Buildpack (Cloud Foundry / Heroku) ◦ Google Container Builder ◦ Bazel ◦ Kaniko ◦ などなど
Eventing Universal subscription, delivery and management of events • よくあるイベント処理周り
イベントソース メッセージバス コード Publish Subscribe いろんなソース いろんなバス (Kafka, NATS, GCP PubSub) https://github.com/knative/docs/tree/master/eventing 現時点での実装 K8sevents GitHub GCP PubSub • Sources, Buses, Flowsというリソースで抽象化 現時点での実装 Stub Kafka GCP PubSub
何か ”Serverless” とは違うような
KnativeのいうServerless ≠ FaaS • ServerlessといってもAWS LambdaやGoogle Cloud Functionsのよ うなFaaSを指すわけではない •
Knativeが指すServerless Workloadとは ◦ ステートレス ◦ プロセスのスケールアウトモデルが適用可能 ◦ 主にアプリケーションレベル(L7、例えばHTTP)から リクエストされるトラフィックによって駆動 • CNCF Serverless Whitepapterの定義とはズレるかもしれない (https://github.com/cncf/wg-serverless/tree/master/whitepapers/serverless-overview)
“Building Block” https://content.pivotal.io/blog/knative-powerful-building-blocks-for-a-portable-function-platform
Riff Riff for functions • Pivotalが中心になって開発しているFaaS ( https://projectriff.io/ ) •
Kubernetes向けに作られていたが、Knativeを ベースにするように作り替え中
Kwsk Apache OpenWhisk on Knative 詳しく Apache OpenWhisk on Knative
https://github.com/projectodd/kwsk
所感 • 登場したときから異様にDocsが充実している ◦ とはいえ綺麗に整理されているわけではないので、色々漁る必要あり • 『一応動く』 ◦ GCPだとn1-standard-4 x3
(4Core 15GB) が必要 • Knative単体では、掲げているメリットの実現は難しい気がする ◦ 【理想】Kubernetes & Istioをラップして使いやすくする ◦ 【現実】Kubernetes + Istio + Knative + etc の知識が必要 • RiffやOpenWhiskなど、Knativeをベースにしたエコシステムの 充実を待つ必要がある
所感 • 現時点(2018年8月時点)では、正確にメリット・デメリットを 語れるレベルまで成熟していない ◦ 今すぐに導入して使えるようなものではない • Istio必須のため、軽く試すには敷居が高い ◦ GCPだとn1-standard-4
x3 (4Core 15GB) が必要 • Knative単体では、掲げているメリットの実現は難しい気がする ◦ 【理想】Kubernetes & Istioをラップして使いやすくする ◦ 【現実】Kubernetes + Istio + Knative + etc の知識が必要 • RiffやOpenWhiskなど、Knativeをベースにしたエコシステムの 充実を待つ必要がある
所感 • とはいえ、『2020年のプラットフォーム』を予想したときに 思いつく理想のプラットフォームは、Knativeのテクノロジースタックと ほぼ同じ構成になる (jacopenの主観) • あるべきプラットフォームを模索するのであれば、Knativeの動向は抑 えておくべき •
Knativeコマンドが実装されたらPaaSライクに使えるかも?
Knativeコマンド https://github.com/knative/serving/blob/master/docs/spec/normative_examples.md Knative Servingのドキュメントにある使い方イメージ 実装はまだない $ knative deploy --service my-service
Deploying app to service [my-service]: ✓ Starting ✓ Promoting Done. Deployed to https://my-service.default.mydomain.com $ knative revisions list --service my-service Name Traffic Id Date Deployer Git SHA next 0% v3 2018-01-19 12:16 user1 a6f92d1 current 100% v2 2018-01-18 20:34 user1 a6f92d1 v1 2018-01-17 10:32 user1 33643fc $ knative rollout next percent 5 [...] $ knative rollout next percent 50 [...] $ knative rollout finish [...]
knctl https://github.com/cppforlife/knctl knativeコマンドの構想に近いモノを実装しているCLI $ knctl deploy --service hello --image gcr.io/knative-samples/helloworld-go
--env TARGET=new-value $ knctl curl --service hello Running: curl '-H' 'Host: hello.default.example.com' 'http://0.0.0.0:80' Hello World: new-value!
GKE Serverless Addon GKEにKnativeの機能を加えるAddon early access request受付中
Pivotal Function Service Pivotal Container Service(PKS) の上で動作 Knative+Riffによる商用Serverless Platform +
= + + =
もくもく会やってます
その他詳しい情報 docs https://github.com/knative/docs Knative Serving https://github.com/knative/docs/tree/master/serving Riff https://projectriff.io/ Knativeが目指すもの、考え方を見てみよう https://repl.info/archives/2137/
まずは試そう Servingのドキュメントも 有用 Knativeの活用 イメージとして Knativeの目指すモノの 参考に
Transforming How The World Builds Software © Copyright 2017 Pivotal
Software, Inc. All rights Reserved.