Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
[SRETT] とある案件で実装している外形監視基盤について
RyoTozawa
March 18, 2022
Technology
0
370
[SRETT] とある案件で実装している外形監視基盤について
RyoTozawa
March 18, 2022
Tweet
Share
More Decks by RyoTozawa
See All by RyoTozawa
3-shake, inc における 「Progressive Dellivery」導入までの悩みと取り組み (CNDT2021)
tozastation
1
150
結合さん作ってみた (Vegeta × Kubernetes Event Exporter)
tozastation
0
400
Other Decks in Technology
See All in Technology
データサイエンティストとしてどう学んでいくべきか/東京大学講義: データマイニング概論: #10
yp_genzitsu
10
5.9k
Pentesting Password Reset Functionality
anugrahsr
0
180
LINEにおけるネットワーク自動化チーム / Network Automation Team in LINE
line_developers
PRO
0
210
成長が鈍化したチームを変えるためにやったこと / #RSGT2023
mongolyy
2
2.8k
OCIコンテナサービス関連の技術詳細 /oke-ocir-details
oracle4engineer
PRO
0
740
Dev Containers ことはじめ - 失敗から学ぶ開発環境運用法
streamwest1629
0
250
Startup Studio Sereal / Culture Deck
sereal
0
590
TypeScriptは10年でこんなに進化しました / TechFeed Experts Night 11
okunokentaro
5
1.1k
スタメンのLeSSの導入と 事業部全体を巻き込んだ アウトカム文化への道のり
uuushiro
2
3k
DID/VCを用いた自己主権型アイデンティティの実現
sbtechnight
0
360
F1 Ochanomizu GP '23
miholovesq
0
650
【Λ(らむだ)】いつのまにリスキリング / RPALT20230117
lambda
0
370
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
221
17k
10 Git Anti Patterns You Should be Aware of
lemiorhan
643
54k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
22
1.7k
GraphQLの誤解/rethinking-graphql
sonatard
39
7.8k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
13
1.1k
Keith and Marios Guide to Fast Websites
keithpitt
407
21k
Robots, Beer and Maslow
schacon
154
7.3k
For a Future-Friendly Web
brad_frost
166
7.7k
Building Adaptive Systems
keathley
27
1.3k
Three Pipe Problems
jasonvnalue
89
8.9k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
24
4.5k
The Web Native Designer (August 2011)
paulrobertlloyd
76
2.2k
Transcript
とある案件で実装している外形監視基盤について
Copyrights©3-shake Inc. All Rights Reserved. 2 自己紹介 - Sreake 事業部
- 金融サービスの SRE チームにお邪魔したり - 最近はデータ活用のパイプラインやダッシュボード整備に勤しんでいます - 社内プロダクトの SRE したり - 過去登壇 - 3-shake, inc における 「Progressive Delivery」導入までの悩みと取り組み(CloudNative Days Tokyo 2021) - 結合さん作ってみた ~Vegeta × Kubernetes EventExporter~ (SRETT) - リンク - https://speakerdeck.com/tozastation - https://github.com/tozastation 戸澤 涼(@tozastation)
Copyrights©3-shake Inc. All Rights Reserved. 3 今日お話しすること 外形監視基盤 PoC の作成
with GKE AutoPilot ~ ほぼ GKE AutoPilot の話 ~
Copyrights©3-shake Inc. All Rights Reserved. 4 作りたいもの いい感じなマルチテナントな外形監視基盤
Copyrights©3-shake Inc. All Rights Reserved. 5 こんな構成で実現しています ※ テナント名は例です GKE
(Autopilot) k6 http (Sreake) k6 http (Securify) k6 http (Reckoner) k6 grpc (Relance) インターネット ArgoCD Prometheus VictoriaMetrics Blackbox Exporter (SSL) Blackbox Exporter (TCP) [構成一覧] ワークロード管理: - GKE AutoPilot - ArgoCD 外形監視: - k6 (シナリオ形式) - blackbox-exporter メトリクス: - Statsd Exporter - Prometheus - VictoriaMetrics Statsd Exporter
Copyrights©3-shake Inc. All Rights Reserved. 6 GKE AutoPilot とは 仕様
- いくつか制限が設けられている - リソースの「最小・最大」が決まっている - 未指定でデフォルト,CPU (500m) / Memory (2GiB) / Storage (1GiB) - ノードラベルの追加は不可 - Node Pool 単位でラベルを分ける運用をしていたので変えなければ・・・ - 特定の Pod と同じノードにスケジュールしたくない場合は Affinity 等で調整が必要 - topologyKey は,kubernetes.io/hostname や failure-domain.beta.kubernetes.io/zone は使えそう - kube-system は参照のみ - 一部 Helm Charts は values に注意 GKE は、ノードやノードプールなどのクラスタの基盤となるインフラストラクチャをプロビジョニングし て管理します。また、ユーザーによる操作が不要な最適化されたクラスタを提供します.
Copyrights©3-shake Inc. All Rights Reserved. 7 GKE AutoPilot とは 仕様
- リソースが足りなくスケージュールできない場合は GKEが判断してノードをスケール - CronJob 等素早くデプロイしたい場合は Priority Class が低い Pod を常駐させて,入れ替える方法がある - 利用できるノードスペックは,e2 シリーズのみ - PSP (Pod Security Policy) から GateKeeper へ - 利用している Helm Chart は,一旦 PSP Off で対応 - 移行手段検討中 - こちらのツール気になっているので検証中です - https://github.com/appvia/psp-migration GKE は、ノードやノードプールなどのクラスタの基盤となるインフラストラクチャをプロビジョニングし て管理します。また、ユーザーによる操作が不要な最適化されたクラスタを提供します.
Copyrights©3-shake Inc. All Rights Reserved. 8 GKE AutoPilot とは 仕様
- リソースが足りなくスケージュールできない場合は GKEが判断してノードをスケール - CronJob 等素早くデプロイしたい場合は Priority Class が低い Pod を常駐させて,入れ替える方法がある - 利用できるノードスペックは,e2 シリーズのみ GKE は、ノードやノードプールなどのクラスタの基盤となるインフラストラクチャをプロビジョニングし て管理します。また、ユーザーによる操作が不要な最適化されたクラスタを提供します. (公式引用) Production での利用はまだ勧められてないみたいだけど Kubernetes 周辺のエコシステムを利用しつつ 運用は楽したい方に触ってみて欲しい! 弊社では プロダクトの開発環境とジョブ基盤として活躍しています.
Copyrights©3-shake Inc. All Rights Reserved. 9 選定理由などお話しします ~ ワークロード管理 ~
GKE (Autopilot) k6 http (Sreake) k6 http (Securify) k6 http (Reckoner) k6 grpc (Relance) インターネット ArgoCD [ワークロード管理の選定理由 ] - GKE AutoPilot 技術的に興味津々(クラスタ運用からの解放) - ArgoCD 過去の案件でも重宝していたので知見も豊富. 他クラスタで動くワークロードを管理したかった. (≒ 自前で実装したくなかった ) Prometheus VictoriaMetrics Blackbox Exporter (SSL) Blackbox Exporter (TCP) Statsd Exporter
Copyrights©3-shake Inc. All Rights Reserved. 10 選定理由などお話しします ~ 外形監視 ~
GKE (Autopilot) k6 http (Sreake) k6 http (Securify) k6 http (Reckoner) k6 grpc (Relance) インターネット ArgoCD Prometheus VictoriaMetrics Blackbox Exporter (SSL) Blackbox Exporter (TCP) Statsd Exporter [外形監視の選定理由 ] - k6 シナリオベースで 複数のリクエストを組み合わせて実装したい. SRE的にいうと CUL (Critical User Journey) をもとに監視して メトリクスを収集したい. - blackbox-exporter DNS/ICMP/TCP/TLS 等の監視で利用したい
Copyrights©3-shake Inc. All Rights Reserved. 11 選定理由などお話しします ~ 外形監視 ~
GKE (Autopilot) k6 http (Sreake) k6 http (Securify) k6 http (Reckoner) k6 grpc (Relance) インターネット ArgoCD Prometheus VictoriaMetrics Blackbox Exporter (SSL) Blackbox Exporter (TCP) Statsd Exporter [外形監視の選定理由 ] - k6 シナリオベースで 複数のリクエストを組み合わせて実装したい. SRE的にいうと CUL (Critical User Journey) をもとに監視して メトリクスを収集したい. - blackbox-exporter DNS/ICMP/TCP/TLS 等の監視で利用したい CUJ (Critical User Journey) とは あるユーザーの体験の中核をなす一連のタスクのことを指し ます. SLI (メトリクス) を決める際に重要となる用語です.
Copyrights©3-shake Inc. All Rights Reserved. 12 選定理由などお話しします ~ 外形監視 ~
GKE (Autopilot) k6 http (Sreake) k6 http (Securify) k6 http (Reckoner) k6 grpc (Relance) インターネット ArgoCD Prometheus VictoriaMetrics Blackbox Exporter (SSL) Blackbox Exporter (TCP) Statsd Exporter [外形監視の選定理由 ] - k6 シナリオベースで 複数のリクエストを組み合わせて実装したい. SRE的にいうと CUL (Critical User Journey) をもとに監視して メトリクスを収集したい. - blackbox-exporter DNS//TCP/Certificate 等の監視で利用したい
Copyrights©3-shake Inc. All Rights Reserved. 13 選定理由などお話しします ~ メトリクス ~
GKE (Autopilot) k6 http (Sreake) k6 http (Securify) k6 http (Reckoner) k6 grpc (Relance) インターネット ArgoCD Prometheus VictoriaMetrics Blackbox Exporter (SSL) Blackbox Exporter (TCP) Statsd Exporter [メトリクス選定理由] Statsd Exporter k6 のメトリクスにラベルを付与するために利用 k6 × Prometheus の選択肢もあったが,メトリクスに追加のタ グを付与したいだけなのに実装が複雑であった. k6 × Statsd Exporter であれば,環境変数の追加のみでタグ の付与ができた. Prometheus (kube-prometheus-stack) メトリクス収集役.監視セットが揃っているため採用 . VictoriaMetrics (victoria-metrics-cluster) メトリクスの長期保存役 . アプリからメトリクスの検索もした い.
Copyrights©3-shake Inc. All Rights Reserved. 14 運用で考えている箇所を少し紹介 GKE (Autopilot) k6
http (Sreake) k6 http (Securify) k6 http (Reckoner) k6 grpc (Relance) インターネット ArgoCD Prometheus VictoriaMetrics Blackbox Exporter (SSL) Blackbox Exporter (TCP) Statsd Exporter [運用を考える箇所] GKE AutoPilot - スケジューリング - 新しい Pod をスケジュールするまで,数分待機 する必要がある - CronJob 等だと頻繁にスケジュールする際に厳 しい. Victoria Metrics - バックアップ - クラスタ切り替えや障害のために バックアップを取っておきたい - vmrestore/vmbackup を一旦採用. velero も検討中 セキュリティ - 外形監視 - Pod 間通信はせず外にだけ出て欲しい - Network Policy の運用 etc …
Copyrights©3-shake Inc. All Rights Reserved. 15 おしまい お世話になった資料たち •
Adding spare capacity to GKE Autopilot with balloon pods (WILLIAM DENNISS: https://wdenniss.com/gke-autopilot-spare-capacity) • Managing Network Policies for namespaces isolation on a multi-tenant Kubernetes cluster (mercari engineering: https://engineering.mercari.com/en/blog/entry/20220214-managing-network-policies/) • Autopilot の概要 (Google Cloud: https://cloud.google.com/kubernetes-engine/docs/concepts/autopilot-overview) • k6 (k6: https://k6.io/docs/) • Victoria Metrics (VictoriaMetrics: https://docs.victoriametrics.com/) • Modeling User Joueneys (Google SRE: https://sre.google/workbook/implementing-slos/) • Google Cloud で実践する SRE (Google SRE: https://www.slideshare.net/GoogleCloudPlatformJP/google-cloud-sre-249557085)