7. 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 source container 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
● It supports 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/
12. Dashboard
Dashboard is Web-UI based 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