This document discusses Kubernetes monitoring concepts and architectures. It describes how cAdvisor collects metrics from nodes and pods and sends them to Heapster for storage and visualization. It also covers the Kubernetes dashboard for visualizing cluster resources and creating/modifying resources, as well as logging with ELK or Stackdriver. Finally, it briefly mentions Datadog as a monitoring solution for Kubernetes.
Introduction to Kubernetes monitoring concepts, architecture, and an outline of topics including Dashboard and tools like Stackdriver and Datadog.
Detailed explanation of monitoring metrics at host, container, application, and Kubernetes levels with architecture involving cAdvisor, Kubelet, and Heapster.
Insight into monitoring components such as cAdvisor for resource usage, InfluxDB for time-series data, and Grafana for data visualization.
Logging in Kubernetes using ELK or Google Stackdriver, detailing how logs are gathered and visualized.
Overview of the Kubernetes dashboard providing a web-based interface for resource monitoring and management.
Information on integrating Datadog with Kubernetes for enhanced monitoring capabilities and references for further information.
Kubernetes resource monitoring
●cAdvisor collect metrics from nodes and pods and
send it into Kubelet
● Kublet sends all of pods in nodes information to
Heapster.
● Heapster runs as a Pod in cluster
● Heapster stores all of info into storage backend
(Google Stack driver, influx DB)
● It can be visualized by using Grafana
Source : https://www.datadoghq.com/blog/how-to-collect-and-graph-
kubernetes-metrics/
8.
Components
cAdvisor
● Open sourcecontainer resource usage and
performance analysis agent
● Auto discovers all containers in the machine
● Collect CPU,memory,file system and network
usage statics for containers
● Overall machine usage (node) by analyzing the
‘root’ container on the machine
InfluxDB
● Open source time series DB
Grafana
● Dashboard visualization tools
9.
Components
cAdvisor application metric(Alpha)
● https://github.com/google/cadvisor/blob/mast
er/docs/application_metrics.md
● cAdvisor can also be configured to collect application
metrics. A container can expose application metrics through
multiple ways
○ on a status page,
○ through structured info like prometheus,
○ or have a separate API for fetching stats.
● Endpoint (Location to collect metrics
from)
● Name of metric
● Type (Counter, Gauge, ...)
● Data Type (int, float)
● Units (kbps, seconds, count)
● Polling Frequency
● Regexps (Regular expressions to
specify which metrics to collect and
how to parse them)
Step 2. Passing configuration to cAdvisor
Step 1. Create configuration
10.
Kubernetes Logging
● Itsupports logging with ELK or Google
stack driver
● ELK
○ The fluentd-elasticsearch pods gather logs from
each node and send them to the elasticsearch-
logging pods
○ These Elasticsearch pods store the logs and
expose them via a REST API.
○ The kibana-logging pod provides a web UI for
reading the logs stored in Elasticsearch, and is
part of a service named kibana-logging
Image source : https://kubernetes.io/docs/tasks/debug-application-cluster/logging-elasticsearch-kibana/
Dashboard
Dashboard is Web-UIbased kubernetes interface
● Overview of application running on cluster
● Monitoring resources
● Create or modifying Kubernetes resources
(such as deployments, jobs, daemonset etc)
For example, you can scale a Deployment, initiate
a rolling update, restart a pod or deploy new
applications using a deploy wizard.
Dashboard is not deployed in default. To deploy dashboard run script
% kubectl create -f
https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml