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
Direct VPC egress for Cloud Run【2023/08/24 Clou...
Search
tsubaki kyosuke
August 24, 2023
Programming
170
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Direct VPC egress for Cloud Run【2023/08/24 Cloud Run 新機能祭り】
tsubaki kyosuke
August 24, 2023
More Decks by tsubaki kyosuke
See All by tsubaki kyosuke
AI エージェントの記憶検索における Vertex AI の活用【2023/11/16 Google Cloud Next Tokyo ’23】
tsubakiky
0
680
zk-SNARKの理論【2021/03/04 ETHTerakoya × Blockchain EXE】
tsubakiky
0
2.2k
zk-SNARKの理論
tsubakiky
0
57
Other Decks in Programming
See All in Programming
AI が書く Go コードの品質を劇的に向上させる Linter: “declscope”
mpyw
0
370
AI × TiDD / 2026.09.05 Redmine 大阪
tokudiro
1
170
すこし踏み込む CancellationToken
htkym
1
480
WebAssembly in Android Apps 〜 WASMはJNIの夢を見るか
keiji
1
110
The Good Stuff, Not the Slop: Engineering High-Quality Android Apps with Modern AI Tooling
danybony
1
250
巨大モノリシックアプリ モダン化大作戦
ktcryomm
1
1k
手動確認はもう限界 〜XCUITestでCustom URL Schemeの遷移を起動種別ごとに自動テストする〜 / Testing Custom URL Schemes with XCUITest
otouto
0
300
Omarchy Tokyo やると聞いて UMPC 買ってセットアップしてきた
mtsmfm
0
150
WebRTC映像をAirPlayに対応させる挑戦.pdf
monolithic_adam
0
280
iOSDC Japan 2026 - Swiftで作って学ぼう!データベース自作入門
kaseken
2
170
スマートフォンでモールス信号を送受信する 〜スマートフォンのLEDとカメラで作る光通信の設計と実装〜
atsuki_seo
0
130
そのリトライ、死んだコネクションを使い回していませんか ── GoのHTTPクライアントとHTTP/2を実プロダクト障害から学び直す
myus4a
0
150
Featured
See All Featured
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
490
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.7k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.8k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
240
How to train your dragon (web standard)
notwaldorf
97
6.8k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
690
Tell your own story through comics
letsgokoyo
1
1.1k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Transcript
Direct VPC egress for Cloud Run Gaudiy Inc. / Kyosuke
Tsubaki / Engineer
01 03 02 04 全体のアーキテクチャ Direct VPC egress とは 利用事例
自己紹介と会社・プロダクト紹介 05 導入の流れ 06 まとめ
自己紹介
自己紹介 2020 年、大学在学中にインターンとして株式会社 Gaudiyに参加。 2021 年 4 月入社。Enabling Team で横断的な技術導入や負荷対策、マルチテナ
ント移行、パフォーマンス改善などを行う。現在は Gaudiy Fanlink の機能開発を行 う Feature Team で、主に Generative Agents の開発に取り組んでいる。 椿京介
会社・プロダクト紹介
Gaudiy は Web 3 × エンタメ領域から グローバルに挑戦する、 日本発の Web 3
スタートアップです。 会社紹介 MISSION ファンと共に、時代を進める。 ブロックチェーンをはじめとした先進的なテクノロジーを駆使し、 誰もが創作や貢献のできるファン国家の創出を探求する。
プロダクト紹介 多種多様なドメインを扱う Gaudiy Fanlink コミュニティを起点に、自律分散的なファンによる経済圏を実現し、ファンの熱量をもとに幸せに暮らせる社会を作ろうとしている
全体のアーキテクチャ
microservices 全体のアーキテクチャ Cloud Load Balancing GraphQL Cloud Run gRPC Server
Cloud Run gRPC Server Cloud Run Database Cloud Spanner
Direct VPC egress とは
VPC VPCにトラフィックを送信するユースケース Cloud Run Memorystore Cloud SQL Compute Engine GKE
Service Internal Load Balancer On Premise Serverless VPC Access Connector instance
Direct VPC egress とは VPC Cloud Run Serverless VPC Access
Connector Resource with an internal IP address instance
Direct VPC egress とは VPC Cloud Run Serverless VPC Access
Connector Direct VPC egress Resource with an internal IP address instance
Direct VPC egress とは 利点(Serverless VPC Accessとの比較) https://cloud.google.com/blog/products/serverless/announcing-direct-vpc-egress-for-clou d-run?hl=en •
Setup ◦ アプリケーションコードの変更なし • Performance ◦ ネットワーク経路数が少ないため、 低レイテン シを実現 ◦ ダイレクトなネットワークパスを使用するた め、スループットが向上する • Cost ◦ コネクタインスタンスを利用しないため、コスト を削減することができる • Security ◦ ネットワークタグを使用することで、きめ細か なネットワークセキュリティを実現
利用事例
Cloud Run to GKE (Autopilot) VPC GKE Microservices Cloud Run
Autopilot Google Kubernetes Engine Internal Cloud DNS Cloud Trace Direct VPC egress Cloud Logging • OpenTelemetry Collector を GKE 上に建たせ、Cloud Run か ら Direct にデータを送信 • Private Cloud DNS を使い Collector の Internal IP を Cloud Run で DNS解決可能にし つつ、外部ネットワークに出ずに Cloud Run と GKE 間の通信を 実現 • 可能な限りネットワークレイテン シを抑えることに成功 SaaS
3rd Party への通信 実際のユースケースにおける満たすべき要件 • 外部サービスで管理しているデータと弊社で管理し ているデータベースで同期する • 一定時間に同期処理を行う必要がある •
大量なデータを一度に処理する必要がある • IP アドレスを固定する必要がある 外部サービス Cloud Run Cloud Spanner Cloud Scheduler 1 2 3 データの同期処理
3rd Party への通信(Serverless VPC Access) VPC Cloud Run Cloud NAT
Serverless VPC Access Connector 外部サービス xx.xx.xx.xx -> OK xx.xx.xx.xx Cloud Run はデフォルトで動的 IP アドレスプールを使用し て外部エンドポイントに接続する。 静的 IP アドレスからの接続を必要とする外部エンドポイン トの場合、サーバーレス VPC アクセスを利用して Cloud Run を VPC に接続し、Cloud NAT 経由ですべての送信ト ラフィックをルーティングするように設定する必要がある。
3rd Party への通信(Direct VPC egress) VPC Cloud Run Cloud NAT
Serverless VPC Access Connector 外部サービス xx.xx.xx.xx -> OK xx.xx.xx.xx Direct VPC egress 補足:プレビュー時点では Cloud NAT に未対応なのでこのような構成は取れないが、 GA のタイミングではわからない ...
導入の流れ
asia-northeast1 Cloud Run で Direct VPC egress 導入の流れ apiVersion: serving.knative.dev/v1
kind: Service metadata: name: SERVICE_NAME annotations: run.googleapis.com/launch-stage: BETA labels: cloud.googleapis.com/location: asia-northeast1 spec: template: metadata: annotations: run.googleapis.com.network-interface: ‘[{“network”: “NETWORK”, “subnetwork”: “SUBNET”}]’ run.googleapis.com/vpc-access-egress: EGRESS_SETTING spec: containers: - image: IMAGE Subnet 10.214.0.0/20 VPC 2 1 • VPC ネットワークとサブネットの 作成 • サブネット上で利用可能な IPアド レスの個数は Cloud Runのス ケール数に合わせる • network と subnetwork を追加 • 現在 Direct VPC egress はサービ スに対して最大 100 インスタンス (--max-instances=100)をサポー トしている .yaml Cloud Run 3 $ gcloud run services replace service.yaml Cloud RunのDeploy
まとめ ❏ Direct VPC egress により、サーバーレスVPC アク セスコネクタを使用せずに、 VPC ネットワークにトラ
フィックを送信できる ❏ ゼロダウンタイムで導入可能 ❏ アプリケーションコードの修正は不要で導入可能 ❏ パフォーマンスの向上
Thank you. Proprietary + Confidential We are Hiring! Our website: