SlideShare a Scribd company logo
Elastic オブザーバビリティを
活⽤した Kubernetes のアプリ監視
鈴⽊ 章太郎
Elastic テクニカルプロダクトマーケティングマネージャー/エバンジェリスト
内閣官房 IT 総合戦略室 政府 CIO 補佐官
Elastic
Technical Product Marketing
Manager/Evangelist
内閣官房 IT 総合戦略室
政府 CIO 補佐官
元 Microsoft Technical Evangelist
Twitter : @shosuz
Shotaro Suzuki
Elastic 概要
3 Solutions, 1 Stack, Deploy Anywhere
Elastic スタックで実現
Kibana
Elasticsearch
Beats Logstash
Elastic エンタープライズサーチ Elastic セキュリティ
Elastic オブザーバビリティ
3つのソリューション
SaaS
(AWS/Azure/GCP)
IaaS
(クラウド & オンプレ)
Elastic Cloud
on Kubernetes
Elastic Cloud Elastic Cloud
Enterprise
豊富なデプロイ選択肢
Kubernetes
(クラウド & オンプレ)
蓄積、検索、分析
可視化 & 管理
収集
Kubernetes 監視における課題
Kubernetes の課題
Infrastructure
Dev
Ops
Container
Runtime
Kubernetes のログとメトリック、トレースを組み合わせる
● コマンド1つで Kubernetes のアプリからログをストリーミング可能
● テレメトリーのインフラデータから Prometheus のメトリック、Jaeger のトレースまで収集し、オープンソースの Elastic APM
エージェントで分散トレーシングを実施可能
● 事前設定済みの Kibana ダッシュボードですぐに確認でき、Metricsアプリで横断的に検索できる
Kubernetes サービスの変化を把握する
● MetricbeatとFilebeatの⾃動
探知機能 で、環境のあらゆる変化
を把握できる
● モジュールを追加したり、パスを記録
するプロセスは⾃動化され、
Docker や Kubernetes の API
フックを使って監視設定が動的に
調整される
● さらにメタデータが付記されることに
より、すべてのデータの出所を把握
できる
9
filebeat
metricbeat
packetbeat
APM
MySQL
Elastic Search Service (Elastic Cloud)
Elastic Cloud on Kubernetes (ECK)
or
Kubernetes に Elastic Observability を適⽤したサンプル
Azure Kubernetes Service
Elastic Cloud on Azure と
サンプルアプリのデプロイ
Kubernetes クラスターのセットアップとデモアプリのデプロイ
https://www.elastic.co/blog/kubernetes-observability-tutorial-k8s-cluster-setup-demo-app-deployment
GitHubのレポジトリ:
https://github.com/michaelhyatt/k8s-o11y-workshop
Elastic Cloud デプロイ (Elastic & 各 Marketplace)
https://www.elastic.co/jp/
https://portal.azure.com/#create/hub
https://aws.amazon.com/marketplace/
https://console.cloud.google.com/marketplace
Elastic
Azure
AWS
GCP
Elastic Cloud on Azure デプロイ https://www.elastic.co/jp/
# Get credentials for
create_secrets.sh
# - cloud_id,
cloud_auth,
apm_url,
apm_token
https://github.com/michaelhyatt/k8s-o11y-
workshop/tree/cc6095210180f8526a9fdc518cf9
e3894b9ea9d0#elastic-cloud
Secrets の設定、Beats のセットアップ
# create_secrets.sh を更新して実⾏する
$HOME/k8s-o11y-workshop/install/create_secrets.sh
./create_secrets.sh
# metricbeat と filebeat を動かしてセットアップする
kubectl create -n kube-system -f metricbeat/metricbeat-setup.yml
kubectl create -n kube-system -f filebeat/filebeat-setup.yml
# 完了状況をウォッチする (completed になれば OK)
kubectl get pods --namespace=kube-system
Demo
Secrets の設定、Beats のセットアップ
Elastic observabilitycansmartlymanagetheappsonkubernetes
Kubernetes ログの監視
Kubernetes のログを収集
Deployment options
Node 1 Node 2 Node n
Filebeat
DaemonSet
Filebeat Filebeat Filebeat
Kubernetes ログの集約
- クラスターレベルのログ
- サービスレベルのログ (例︓nginxのログ)
- Auto-discovery
- アプリのログ
- 全てコンテナのログを tail
- add_kubernetes_metadata でログをエンリッチ
- 各イベントは下記の情報が追加される
- Pod Name
- Pod UID
- Namespace
- Labels
./filebeat modules enable kubernetes
processors:
- add_kubernetes_metadata:
host: <host_name>
kube_config: ${HOME}/.kube/config
メタデータプロセッサー
イベントにメタデータを追加してログ、メトリックス、トレースを関連付け
• cloud.availability_zone
• cloud.region
• cloud.instance_id
• cloud.machine_type
• cloud.project_id
• cloud.provider
• docker.container.id
• docker.container.image
• docker.container.name
• docker.container.labels
• kubernetes.pod.name
• kubernetes.namespace
• kubernetes.labels
• kubernetes.annotations
• kubernetes.container.name
• kubernetes.container.image
add_cloud_metadata add_docker_metadata add_kubernetes_metadata
Demo
Filebeat と Metricbeat のデプロイと
ログ監視
Elastic observabilitycansmartlymanagetheappsonkubernetes
Elastic observabilitycansmartlymanagetheappsonkubernetes
Kubernetes メトリクスの監視
Kubernetes のメトリックスを収集
Deployment options
Node 1
Metricbeat
Node 2
Metricbeat
Node n
Metricbeat
Metricbeat
DaemonSet
Kubernetes メトリックスの集約
- Kubernetes モジュール
- pod と service の監視
- Cluster、 pod、 container のメトリックス
- Auto-discovery によるアプリメトリックス
- メトリックスのソース
- Kubelet (heapster, cAdvisor)
- kube-state-metrics
- apiserver
- controller-manager
- scheduler
- proxy
- Prometheus module (beta)
- ⼀元的な Kibana UI
./metricbeat modules enable kubernetes
Kubernetes インベントリのビュー
Kubernetes クラスターの俯瞰図
Kubernetes ダッシュボード
Metricset 毎のダッシュボード
Node 1
Metricbeat Autodiscover
動的なターゲットも残さずデータ収集する
Logs
Metrics
Nginx
- コンテナ上でアプリを実⾏していると、
監視対象が動的になる
- Autodiscover により、設定の変化
にも柔軟に対応可能になる
- Template を指定する事で
Autodiscover はコンテナの起動時
から監視ができる Elasticsearch
ヒントベース auto-discovery
- Metricbeat はヒントを元にコンテナから取得す
べき情報を判断する
- 設定も⾃動で反映
- Logs, Metrics, Modules
- 次の⽂字列で始まる Pod の annotation か
Docker ラベルを元に hint を探す
co.elastic.metrics
- 9 種類のヒント
- co.elastic.metrics/module
- co.elastic.metrics/hosts
- co.elastic.metrics/metricsets
- co.elastic.metrics/raw
- ...
metricbeat.autodiscover:
providers:
- type: kubernetes
hints.enabled: true
annotations:
co.elastic.metrics/module: prometheus
co.elastic.metrics/metricsets: collector
co.elastic.metrics/hosts: '${data.host}:9090'
co.elastic.metrics/period: 1m
Kubernetes
アプリケーションパフォーマンスの監視
APM
Logs + Metrics + APM の統合
オープンソース
⾔語&エージェント
Java, C#, Go, Node.js, Python, Ruby,
RUM (React, Vue.js, Angular)
専⽤の UI
合理化された APM ワークフロー
分散トレーシング
インデックス
他データと関連付ける
Elastic stack の機能をフル活⽤
アプリ(MySQL, nginx, petclinic)のデプロイと
Autodiscovery
# Deploy MySQL DB
kubectl create -f mysql/mysql.yml
# Deploy petclinic and nginx
kubectl create -f petclinic/petclinic.yml
kubectl create -f nginx/nginx.yml
# Observe the application components in Running state
kubectl get pods
kubectl get services
Demo
アプリ(MySQL, nginx, Petclinic)
のデプロイ
Elastic observabilitycansmartlymanagetheappsonkubernetes
Elastic observabilitycansmartlymanagetheappsonkubernetes
Prometheus メトリックを活⽤する
● MetricbeatのPrometheusモジュールでメトリックを捕捉、シッピング可能
● /metrics エンドポイントを使⽤するか、Prometheus Federation API を使って、Prometheus サーバーに接続
● 収集済みのメトリックをプルすることにより、Prometheus が収集するメトリックを補⾜できる
● Prometheus エクスポーターを直接 Metricbeat に接続し、ゲートウェイをプッシュする⽅法もある
● ※ 詳しくは、Elastic StackとPrometheusメトリックに関するドキュメントをご覧ください。
Elastic observabilitycansmartlymanagetheappsonkubernetes
Elastic observabilitycansmartlymanagetheappsonkubernetes
まとめ
• Filebeat & Metricbeat を使⽤してアプリケーションと Kubernetes のログとメトリックを収集
• すぐにシステムとインフラストラクチャの監視を開始できる
• Elastic Cloud で Elasticsearch Service の無料トライアルにサインアップ
• 稼働したら、稼働時間モニタリングを使⽤してホストの可⽤性を監視
• Elastic APM を使⽤してホストで実⾏されているアプリケーションを計測
• 新しいメトリックスクラスターと完全に統合された、完全に監視可能なシステム
リソース
• サンプルソリューション Github レポジトリ
‒ https://github.com/michaelhyatt/k8s-o11y-workshop
• 関連ブログ
‒ https://www.elastic.co/blog/kubernetes-observability-tutorial-k8s-log-
monitoring-and-analysis-elastic-stack
‒ https://www.elastic.co/blog/kubernetes-observability-tutorial-k8s-
metrics-collection-and-analysis
‒ https://www.elastic.co/blog/kubernetes-observability-tutorial-k8s-
monitoring-application-performance-with-elastic-apm
Thank you for your attention!

More Related Content

PDF
Elastic stack_&_cloud_7.11_updates-summary
PDF
Moving from on prem to managed services with elastic on azure-final
PDF
Big query and elasticsearch insight at scale
PDF
[CTC Forum 2019/10/25] 事例から学ぶ!AWS 移行でデータベースの管理・コストを削減する方法
PDF
whats-new-in-elastic-7-14
PDF
Apm enables python app observability
PDF
Building andobservingcloudnativeappliactionusingazure elastic-terraform
PDF
Gpu accelerates aimodeldevelopmentandanalyticsutilizingelasticsearchandazure ai
Elastic stack_&_cloud_7.11_updates-summary
Moving from on prem to managed services with elastic on azure-final
Big query and elasticsearch insight at scale
[CTC Forum 2019/10/25] 事例から学ぶ!AWS 移行でデータベースの管理・コストを削減する方法
whats-new-in-elastic-7-14
Apm enables python app observability
Building andobservingcloudnativeappliactionusingazure elastic-terraform
Gpu accelerates aimodeldevelopmentandanalyticsutilizingelasticsearchandazure ai

What's hot (20)

PDF
あらゆる検索を叶えるElastic Workplace Search
PDF
Elastic 7.13-new-features-20210624
PDF
Elastic7.10 newfeaturesintroduce 1216
PDF
Elastic circle ci-co-webinar-20210127
PDF
7.9 elasticstackandcloudtechnicalenablement excitingnewfeatures-jpn0827
PDF
Azure kobebase lt-20201120
PDF
DatadogでAWS監視やってみた
PPTX
15分でお届けする Elastic Stack on Azure 設計・構築ノウハウ
PDF
Utilizing elasticcloudforallusecases
PDF
Migrating tocloudnativeapplicationwithusingelasticapm
PDF
Elastic7.12 release-new-features-on-0428
PPTX
アプリケーション開発者のためのAzure Databricks入門
PDF
Monitoring the health and performance of your aws environment using the Elast...
PDF
Building modernapplicationwithelasiccloud
PDF
Realizling Dapr Observability Using Elastic Stack
PDF
Renewed using elasticsearchonaspnet-core5
PDF
20201009 hccjp ignite_update_hybrid
PDF
No-Ops で大量データ処理基盤を簡単に実現する
PDF
20210514 hccjp azure_stackedgesession
PPTX
PythonによるAzureサーバレスアプリケーション開発 / Serverless Application Development with Python
あらゆる検索を叶えるElastic Workplace Search
Elastic 7.13-new-features-20210624
Elastic7.10 newfeaturesintroduce 1216
Elastic circle ci-co-webinar-20210127
7.9 elasticstackandcloudtechnicalenablement excitingnewfeatures-jpn0827
Azure kobebase lt-20201120
DatadogでAWS監視やってみた
15分でお届けする Elastic Stack on Azure 設計・構築ノウハウ
Utilizing elasticcloudforallusecases
Migrating tocloudnativeapplicationwithusingelasticapm
Elastic7.12 release-new-features-on-0428
アプリケーション開発者のためのAzure Databricks入門
Monitoring the health and performance of your aws environment using the Elast...
Building modernapplicationwithelasiccloud
Realizling Dapr Observability Using Elastic Stack
Renewed using elasticsearchonaspnet-core5
20201009 hccjp ignite_update_hybrid
No-Ops で大量データ処理基盤を簡単に実現する
20210514 hccjp azure_stackedgesession
PythonによるAzureサーバレスアプリケーション開発 / Serverless Application Development with Python
Ad

Similar to Elastic observabilitycansmartlymanagetheappsonkubernetes (18)

PDF
ログ+メトリック+トレースの組み合わせで構築する一元的なオブザーバビリティ
PDF
Datadog JAWSDAYS 2018 Lunch Session
PDF
データ投入からインサイトまで、簡単になったインフラ監視
PDF
OpenTelemetryを用いたObservability基礎の実装 with AWS Distro for OpenTelemetry(Kuberne...
PDF
Elastic stack 世界にさらしたサーバを可視化してみた
PDF
Logs are better with elastic apm 20210623
PDF
CloudFrontのリアルタイムログをKibanaで可視化しよう
PDF
Building Software Reliability through Distributed Tracing.pdf
PDF
OCP Meetup Tokyo #05 ECK on OCP
PDF
Kubernetesの良さを活かして開発・運用!Cloud Native入門 / An introductory Cloud Native #osc19tk
PDF
CyberAgent: How We Deployed Production Kubernetes Clusters on OpenStack witho...
PDF
20170725 black belt_monitoring_on_aws
PPTX
OSSで作るOpenStack監視システム
PDF
Elastic Stackの紹介とOpenStackでの活用事例(Searchlightなど) - OpenStack最新情報セミナー 2016年5月
PDF
独断と偏見で選んだ Kubernetes 1.24 の注目機能と今後! / Kubernetes Meetup Tokyo 50
PDF
Jbs seminar rancher_200325
PDF
Kubernetes アプリケーションにオブザーバビリティを
PPTX
Kubernetesでの性能解析 ~なんとなく遅いからの脱却~(Kubernetes Meetup Tokyo #33 発表資料)
ログ+メトリック+トレースの組み合わせで構築する一元的なオブザーバビリティ
Datadog JAWSDAYS 2018 Lunch Session
データ投入からインサイトまで、簡単になったインフラ監視
OpenTelemetryを用いたObservability基礎の実装 with AWS Distro for OpenTelemetry(Kuberne...
Elastic stack 世界にさらしたサーバを可視化してみた
Logs are better with elastic apm 20210623
CloudFrontのリアルタイムログをKibanaで可視化しよう
Building Software Reliability through Distributed Tracing.pdf
OCP Meetup Tokyo #05 ECK on OCP
Kubernetesの良さを活かして開発・運用!Cloud Native入門 / An introductory Cloud Native #osc19tk
CyberAgent: How We Deployed Production Kubernetes Clusters on OpenStack witho...
20170725 black belt_monitoring_on_aws
OSSで作るOpenStack監視システム
Elastic Stackの紹介とOpenStackでの活用事例(Searchlightなど) - OpenStack最新情報セミナー 2016年5月
独断と偏見で選んだ Kubernetes 1.24 の注目機能と今後! / Kubernetes Meetup Tokyo 50
Jbs seminar rancher_200325
Kubernetes アプリケーションにオブザーバビリティを
Kubernetesでの性能解析 ~なんとなく遅いからの脱却~(Kubernetes Meetup Tokyo #33 発表資料)
Ad

More from Shotaro Suzuki (20)

PDF
This is how our first offline technical event in three years was able to succ...
PDF
Introducing the new features of the Elastic 8.6 release.pdf
PDF
NET MAUI for .NET 7 for iOS, Android app development
PDF
What's New in the Elastic 8.5 Release
PDF
Centralized Observability for the Azure Ecosystem
PDF
What's New in the Elastic 8.4 Release
PDF
Power Apps x .NET ~ Transforming Business Applications with Fusion Development
PDF
devreljapan2022evaadvoc-final.pdf
PDF
elastic-mabl-co-webinar-20220729
PDF
Application development with c#, .net 6, blazor web assembly, asp.net web api...
PDF
Discover what's new in the Elastic 8.3 release - Find, monitor, and protect e...
PDF
Building a search experience with Elastic – Introducing Elastic's latest samp...
PDF
Developing .NET 6 Blazor WebAssemby apps with Radzen Blazor component library...
PDF
Elastic x Microsoft Azure Integration Evolution - Integrated Monitoring for S...
PDF
Building 3D mobile apps using Power Apps Mixed Reality controls, Azure SQL Da...
PDF
What's New in the Elastic 8.2 Release - Seamless User Experience with Search -
PDF
Application development with c#, .net 6, blazor web assembly, asp.net web api...
PDF
Building a Flutter Development Environment with VSCode and Useful Extensions
PDF
Application development with c#, .net 6, blazor web assembly, asp.net web api...
PDF
Introducing Elastic 8.1 Release - More Integration, Faster Indexing Speed, Lo...
This is how our first offline technical event in three years was able to succ...
Introducing the new features of the Elastic 8.6 release.pdf
NET MAUI for .NET 7 for iOS, Android app development
What's New in the Elastic 8.5 Release
Centralized Observability for the Azure Ecosystem
What's New in the Elastic 8.4 Release
Power Apps x .NET ~ Transforming Business Applications with Fusion Development
devreljapan2022evaadvoc-final.pdf
elastic-mabl-co-webinar-20220729
Application development with c#, .net 6, blazor web assembly, asp.net web api...
Discover what's new in the Elastic 8.3 release - Find, monitor, and protect e...
Building a search experience with Elastic – Introducing Elastic's latest samp...
Developing .NET 6 Blazor WebAssemby apps with Radzen Blazor component library...
Elastic x Microsoft Azure Integration Evolution - Integrated Monitoring for S...
Building 3D mobile apps using Power Apps Mixed Reality controls, Azure SQL Da...
What's New in the Elastic 8.2 Release - Seamless User Experience with Search -
Application development with c#, .net 6, blazor web assembly, asp.net web api...
Building a Flutter Development Environment with VSCode and Useful Extensions
Application development with c#, .net 6, blazor web assembly, asp.net web api...
Introducing Elastic 8.1 Release - More Integration, Faster Indexing Speed, Lo...

Elastic observabilitycansmartlymanagetheappsonkubernetes