The Kubernetes Series - Logging & Monitoring

The Kubernetes Series - Logging & Monitoring

(Photo by Angie Muldowney on Unsplash)

The previous post dealt with Static Pods and Multiple Schedulers, in this post we briefly cover monitoring and logging Pods.


Kubernetes does not come with a built-in monitoring service that keeps track of deployments, resource usage, scaling events or Pod crashes. However, the Kubelet service on Pods has a subcomponent called cAdvisor that monitors node counts, performance and events.

Metrics Server

There's an open-source, in-memory only solution for Kubernetes called Metrics Server, that stores metrics from Pods in memory, based on information passed to it by cAdvisor. Follow the instructions on the Metrics Server repo page to install.

With Metric Server installed you can view resource usage on a node or Pod basis with the commands;

kubectl top node


kubectl top pod


You can view the logs in a particular pod with the kubectl command. If you have only one container running in your pod;

kubectl logs -f pod-name

If you have multiple containers also specify the container name like so;

kubectl logs -f pod-name container-name


That should be enough to get you started with. There are open-source solutions that expand on both logging and monitoring services covered in this post, feel free to Google around for one that fits your use-case best.

Next up we'll start covering general the maintenance of applications in your cluster.

Show Comments
👇 Get $100 in credit DigitalOcean Referral Badge