Introduction to Monitoring Kubernetes

in DevOps , Kubernetes , Visualization , Monitoring and Observability

Introduction to monitoring Kubernetes

Understand the pain points involved in monitoring Kubernetes and the pain points available to help you.


Before we jump in, this article was written in partnership with MetricFire. If you're monitoring Kubernetes, check out our Hosted Prometheus service!Book a demo with us here.

Distributed monitoring pain point

The growing adoption of microservices architecture is also driving the adoption of containers to package, distribute and run the microservices. This requires orchestrators to handle availability, performance, and deployments of those containers on the server.

However, the entire setup around microservices, containerization, and orchestrators complicates logging and monitoring since various distributed and diversified applications are interacting with each other. A single point of failure can sometimes discontinue the uninterrupted process, making us aware of the issue, but detecting other issues is another story.

Although a container orchestration tool such as Kubernetes orchestrates containers in various distributed systems and subdues the intricacies introduced by distributed processing, Kubernetes is itself complicated and has too many components to monitor. Unlike a monolithic application where there are just two components to monitor — applications and the hosts, Kubernetes has four: Nodes(hosts), the Kubernetes platform itself, Docker containers, and the containerized microservices.

Evidently, traditional monitoring tools that log parameters like CPU use, memory use, input-output (I/O) per second, latency, and network bandwidth are rendered inadequate in a cloud-native era of Microservices, Docker containers, and Kubernetes. The monitoring strategies in the cloud-native era need granular detail at the container or services level.

Moreover, traditional monitoring methods were devised along with a long-running host model. A traditional data center is formed of a number of servers hosting monolithic applications, with static IPs and hostnames. The monitoring was associated with these constant parameters, rarely changing in opposition to microservices architecture.

Microservices-based applications are characteristically deployed on containers that are dynamic and transient. Kubernetes requires a number of application models to be running. Kubernetes has this tendency to place the pods on whichever nodes it deems fit unless otherwise indicated. Actually, Kubernetes' ability to schedule pods is the epitome of its self-adjusting system.

Therefore, monitoring tools in containerized environments need to offer instant service-discovery and auto-detection of lifecycle events of containers. They should also require adjusting metrics as containers are created or restarted every second.

In a nutshell, identifying problems in a microservices environment is a little more challenging than in a monolithic environment, as requests navigate between various stack layers under the multitudes of services. Modern monitoring tools are required to monitor these interconnected layers while also resourcefully classifying application and infrastructure behavior to simplify troubleshooting.

Limitations of standard Kubernetes dashboard and in-house tools

The standard Kubernetes dashboard offers a basic UI that displays resource utilization information. In addition, it can organize applications running in the cluster and the cluster itself. However, the Kubernetes dashboard lacks the sophistication of more advanced Kubernetes monitoring tools such as Prometheus and Grafana. On top of that, the Kubernetes dashboard relies on Heapster, a deprecated performance monitoring and metrics collection system for Kubernetes.

Organizations invested in Kubernetes should look across the plethora of monitoring tools instead of developing their own tools internally. The following tools are not only efficient at monitoring Kubernetes, they are also undergoing constant improvement owing to an open-source community.

cAdvisor

cAdvisor is an open-source container resource usage and performance analysis agent built for containers and has Docker DNA flowing all over it. In Kubernetes, cAdvisor is included in the Kubelet binary. As a result, cAdvisor runs at node level rather than pod level.

In its typical configuration, cAdvisor auto-discovers every live container and reports its usage CPU, memory, filesystem, and network in real-time.

cAdvisor as a tool is apt for measuring some basic machine-level performance characteristics. However, it lacks an analytics engine to report meaningful insights.

Kube-state-metrics

Usually used in concurrence with the very popular but now deprecated Heapster, Kube-state-metrics is a minimalistic service that gathers data reported to the Kubernetes API server.

It reaps insights about the state of objects such as Deployment, Node, PersistentVolume, Pod, Service, etc.

The biggest downside is that Kube-state-metrics delivers the metrics in plain text form. Of course, you can scrape the metrics to a capable analytics software suite. However, that means you must bring your own tools to make the data from Kube-state-metrics comprehensible.

Prometheus

Prometheus is, indeed, one of the most promising ways to bring end-to-end visibility into your Kubernetes environments. Prometheus is more than a monitoring system. However, to unlock its true potential beyond just a time-series database, you must explore how it integrates with different remote endpoints and storage systems (like VictoriaMetrics, Elasticsearch, Graphite, InfluxDB, and Postgres), alert webhook receivers (like SNS, SMS, SNMP, Slack, IRC, and Telegram Bot) and other integrations like file service discovery tools.

MetricFire offers a hosted Prometheus service, you can use it today and try out Prometheus without the set up.

‍ 

Grafana

Grafana is a metrics analytics platform. It enables querying, visualizing, alerting, and understanding Kubernetes metrics.

To monitor Kubernetes you can use the Grafana Kubernetes App, which includes four dashboards: Cluster, Node, Pod/Container, and Deployment.

The biggest strength of Grafana is its flexibility. It allows you to bring together numerous metrics into a convenient dashboard at your ease. For example, you can catch the metrics from cAdvisor or Prometheus. In addition to the standard metrics that every node and pod will have, Grafana allows you to add specific metrics for applications.

MetricFire offers a Hosted Grafana service, where you can try out Grafana and see what it's all about.

‍ 

Kubewatch

Kubewatch is an event-triggered notification system that can integrate easily with your Slack channel. You just need to stipulate what needs to be monitored, and it will enable a Kubernetes client library for that event to interact with a Kubernetes API server and return notifications.

You can choose the resources to watch: daemon sets, deployments, pods, replica sets, replication controllers, services, secrets, configuration maps, etc.

Jaeger

Jaeger troubleshoots and monitors transactions in complex distributed systems such as Kubernetes.

Microservices architecture is distributed in nature and may result in problems when achieving distributed context propagation, transaction monitoring, and latency optimizations. Jaeger is a monitoring system of, by, and for distributed systems.

A native support for OpenTracing, Jaeger addressed networking and observability in Kubernetes. Jaeger instrumentation libraries, backend, and Web UI have been designed to support the OpenTracing standard, which is a set of vendor-neutral APIs and instrumentation for distributed tracing. Jaeger clients are language-specific implementations of the OpenTracing API. Jaeger daemon receives tracing information submitted by applications via Jaeger client libraries. It can run as a sidecar container or an independent DaemonSet.

‍ 

MetricFire

MetricFire offers a comprehensive infrastructure and application monitoring platform from a set of open-source monitoring tools. In its current set of offered platforms, it offers hosted Prometheus and hosted Grafana. Users can view metrics on an elegant Grafana dashboard in real-time, without having to do anything but send the metrics over to MetricFire.

Moreover, MetricFire provides Prometheus and Grafana as-a-service and includes missing features in vanilla Prometheus – Grafana dashboards with long-term storage and technical support. You can sign up for a free trial with MetricFire today and check it out.

Conclusion

For organizations who are invested into K8s and Docker containers to empower their microservices, they should consider one of the existing Kubernetes monitoring tools, instead of putting their efforts into creating a new one.

It's better to use the existing monitoring tools that offer unparalleled customizations and are getting better with every version thanks to a large community.

For organizations, managed Kubernetes monitoring tools are a worthwhile option to consider as they allow them to focus on delivering values to their customers without the need to spend time on unnecessary but avoidable tasks.

Sign up for a free trial with MetricFire and start monitoring your Kubernetes today. Book a demo and talk to us directly about monitoring you Kubernetes set up.



Share this story with your friends
metricfire
MetricFire

MetricFire provides a complete infrastructure and application monitoring platform from a suite of open source monitoring tools. Depending on your setup, choose Hosted Prometheus or Graphite and view your metrics on beautiful Grafana dashboards in real-time.

Sponsored


Content Marketing Platform for Cloud Native Companies
Get in touch

Content marketing platform for Cloud Native Companies

DevOps Narrated (Podcast)
Subscribe to The DevOps FaunCast

Listen to the stories behind the stories and learn new things each week