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
Knativeを使うと何が嬉しいの?
Search
小野佑大
June 24, 2023
Technology
700
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Knativeを使うと何が嬉しいの?
2023.06.24 インフラ技術基礎勉強会#3
小野佑大
June 24, 2023
More Decks by 小野佑大
See All by 小野佑大
変化に強くなる!ソフトウェア定義型生産ラインの道標
yudaiono
0
37
分断された OT と IT を繋ぐ架け橋 -Kubernetes が切り拓く 産業用組み込み製品の現在地 -
yudaiono
1
220
クラウドネイティブがもたらす組み込み開発のパラダイム
yudaiono
0
280
製造DXを加速するIT/OT融合プラットフォーム
yudaiono
0
330
組み込み開発でクラウドネイティブを始める方法
yudaiono
1
250
30分で分かるKnative実践ガイド
yudaiono
1
300
リアルとバーチャルを繋ぐエッジネットワーキング動向
yudaiono
1
410
SAS Viyaの基盤にOpenShiftが最適の理由
yudaiono
0
870
オープンソースから見るエッジコンピューティングの現在と未来
yudaiono
0
320
Other Decks in Technology
See All in Technology
Sigmaで作る業務アプリ
kazushiro_honma
0
110
日経電子版を支えていく Kasane Design System/fec_fukuoka
nikkei_engineer_recruiting
0
630
Reactの設計論
uhyo
14
7.7k
Redmine 7.0で私が開発した新機能の狙いと背景
vividtone
1
160
From Vanilla Kubernetes to a Batteries-Included Platform: Developer Experience at 1,300+ Clusters
yosshi_
0
680
アプリをもっと"iOSアプリっぽく"する小さな工夫 / Small Touches That Make Your App Feel More Like an iOS App
matsuji
1
410
Multica × 長期記憶:40個のミニプロジェクト管理
eiei114
1
230
生成AIのテナント制御とシャドーMCP対策 | AIを"止めずに"、情報を守る
yukun
0
140
「重なり」は迎える側がつくる ― 人もAIエージェントも歓迎するプロダクトエンジニアリング ―
go0517go
PRO
0
280
「図書館」という名前のままでいいのか -Code4Lib JAPANカンファレンス2026 アンカンファレンス報告- / Code4Lib JAPAN Conference 2026: Unconference Report
ykiyota
0
160
薬剤師(ドメインエキスパート)と一緒に育てる薬局向けAIアシスタント
kakehashi
PRO
2
140
[2026-09-11]SREは誰のもの?運用エンジニアが始める 「SRE領域への越境」とチームの進化の軌跡 〜Road to NEXT CRE
tosite
0
120
Featured
See All Featured
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.3k
エンジニアに許された特別な時間の終わり
watany
108
250k
GraphQLとの向き合い方2022年版
quramy
50
15k
Darren the Foodie - Storyboard
khoart
PRO
3
3.9k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
370
[RailsConf 2023] Rails as a piece of cake
palkan
59
7k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.8k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.6k
A better future with KSS
kneath
240
18k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
67k
Transcript
Knativeを使うと何が嬉しいの? Yudai Ono
レッドハット株式会社 OpenShiftのソリューションアーキテクト エッジコンピューティング 所属 小野 佑大 @pinkink_yudai 2 自己紹介
役割 出版
SERVING K8sへのアプリのデプロイの抽象化 (APIの簡単デプロイ) EVENTING アプリの非同期連携を抽象化 (簡単データ連携) Knativeは、アプリ開発チームがKubernetesを簡単に使えるようにするために Kubernetesを「抽象化する」APIを提供するソフトウェアです。 3 What
is Knative ?
Knative Serving Service Route Revision Configuration Ingress Ingress Controller Ingress
Gateway 各Revisionへのトラフィック振り 分けルール Revisionの管理 Ingress設定 Serviceの更新毎に新規作成 Knative ServiceのAPIを使ってアプリをデプロイすると アクセス先のURLが返る(アプリデプロイの手順の簡素化) HTTPS K8s Service K8s Pod Deployment Kubernetes を抽象化 $ kn service create app --image app:latest … https://xxx 4
Route Activator Pod Revision K8s Deployment Pod Queue Proxy User
app AutoScaler Reconciler Serverless Service Reconciler Replicasを調整 メトリクス報告 Serveモード切り替え Endpointを動的に変更しトラフィックパスへの Activatorの挿入・削除を制御 メトリクス報告 通常時の経路 (Serve Mode = Serve) Podが0台の時の経路 (Serve Mode = Proxy) HTTPリクエストをキューイング HTTPリクエスト 5 Knative Servingのネットワーキング Knative ServingはHTTPリクエストを自身のコンポーネントでキューイングし、 HTTPリクエストに基づくオートスケールをデフォルト適用する。( PodのHTTP負荷の隠蔽)
apiVersion: eventing.knative.dev/v1 kind: Trigger metadata: name: kafka-to-trigger spec: broker: kafka-broker
filter: attributes: Source: sample subscriber: ref: apiVersion: serving.knative.dev/v1 kind: Service name: sample-app-py 対象イベントを特定 Knative EventingがイベントをHTTP POST Broker Trigger filter A Source Knative Service Trigger filter B Source Event Source Knative Service HTTPリクエストを受信して起動 6 Knative Eventing Kafka等の外部システムで管理される「イベント」を アプリへルー ティングすることで、アプリ間の非同期連携を実装 Event Source連携を抽象化
Knative Eventingを用いた非同期連携 # イベントを受信し、在庫情報を更新する @app.route("/", methods=["POST"]) def receive_cloudevents(): # ①イベントを受信する
event = json.loads( request.data ) # ②処理ロジック foo = bar(...) # ③HTTPレスポンスのヘッダをCloudEvents形式とすると、 # Knative Eventingがイベントの発生と判断してくれる … response = make_response( json.dumps(value).encode('utf-8') ) response.headers["Ce-Id"] = str(uuid.uuid4()) response.headers["Ce-Source"] = "dev.knative.serving#stock" … return response, status_code ①受信 Kafka ②Logic アプリA Knative Eventing Topic ③返信 アプリB Kafka固有の実装を吸収 イベント送信先をYAMLで 定義しアプリ間連携 7
source code Build Rev: 1.5 95 % Rev: 2.0 5
% Event Source HTTP requests https://xxx… 8 さいごに.... Knativeの提供する6つの体験 まとめ! 簡単 アプリ実装 簡単 アプリデプロイ 簡単 アクセス設定 簡単 オートスケール 簡単 トラフィック管理 簡単 データ連携 Knative Functions (CLIツール)
❏ Knativeの公式GitHubリポジトリで公開されているサン プルコード https://github.com/knative/docs/tree/main/code-samples ❏ Red Hat が公開しているKnativeのTutorial https://redhat-developer-demos.github.io/knative-tutorial/knative-tuto rial/index.html
❏ KafkaとKnativeを使用したデータパイプラインデモ https://medium.com/analytics-vidhya/automated-data-pipeline-using-c eph-notifications-and-kserving-5e1e9b996661 ❏ 自己学習型のハンズオンコンテンツ (Instruqt) https://github.com/mayumi00/OpenShiftLearning ❏ Istio Bookinfoを活用したハンズオン https://gitlab.com/yono1/openshift-serverless-bookinfo 9 その他の参考情報 Knative等クラウドネイティブ系コンテンツを体 験できますのでぜひご活用ください。
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
Knative Serving 11 参考. 同期・非同期のマイクロサービスの実装イメージ https://gitlab.com/yono1/openshift-serverless-bookinfo Product page Reviews Rating
Details Order (注文) Stock (在庫) Delivery (配送) Knative Eventing Kafka 注文 Topic 在庫 Topic 配送 Topic ①注文イベント ②注文イベント ③在庫イベント ④在庫イベント ⑤配送イベント ⑥配送イベント
CLIツールを通じて、開発者がアプリを簡単に作成するためのテンプレートや、コンテナのビルド、 Knative Servingによるアプリのデプロイを自動化する CLIツール 複数の言語とフレームワークに対応 kn func create --language python
--template http ① Functionの開発テンプレートの作成 kn func deploy --image ${IMAGE_DIGEST} ②Functionのビルド&デプロイ • Quarkus • Typescript • Nodejs • Go • Rust • Spring Boot • Python kn func invoke ③Functionへの疎通試験 12 おまけ. Knative Functions