aster.cloud aster.cloud
  • /
  • Platforms
    • Public Cloud
    • On-Premise
    • Hybrid Cloud
    • Data
  • Architecture
    • Design
    • Solutions
    • Enterprise
  • Engineering
    • Automation
    • Software Engineering
    • Project Management
    • DevOps
  • Programming
    • Learning
  • Tools
  • About
  • /
  • Platforms
    • Public Cloud
    • On-Premise
    • Hybrid Cloud
    • Data
  • Architecture
    • Design
    • Solutions
    • Enterprise
  • Engineering
    • Automation
    • Software Engineering
    • Project Management
    • DevOps
  • Programming
    • Learning
  • Tools
  • About
aster.cloud aster.cloud
  • /
  • Platforms
    • Public Cloud
    • On-Premise
    • Hybrid Cloud
    • Data
  • Architecture
    • Design
    • Solutions
    • Enterprise
  • Engineering
    • Automation
    • Software Engineering
    • Project Management
    • DevOps
  • Programming
    • Learning
  • Tools
  • About
  • Data
  • Programming
  • Software
  • Tech

Kubernetes Logging And Monitoring: What Kubernetes Can And Can’t Do Natively

  • aster.cloud
  • September 2, 2020
  • 5 minute read

Graphic of people looking at stylized kubernetes data

Kubernetes is a container orchestration tool, but its functionality extends far beyond just orchestrating containers in a narrow sense. It offers a range of additional features that—to a limited extent—address needs such as load balancing, access control, security policy enforcement, and even logging and monitoring. Indeed, Kubernetes’s broad functionality has led some folks to call it an “operating system” in its own right.


Partner with aster.cloud
for your next big idea.
Let us know here.



From our partners:

CITI.IO :: Business. Institutions. Society. Global Political Economy.
CYBERPOGO.COM :: For the Arts, Sciences, and Technology.
DADAHACKS.COM :: Parenting For The Rest Of Us.
ZEDISTA.COM :: Entertainment. Sports. Culture. Escape.
TAKUMAKU.COM :: For The Hearth And Home.
ASTER.CLOUD :: From The Cloud And Beyond.
LIWAIWAI.COM :: Intelligence, Inside and Outside.
GLOBALCLOUDPLATFORMS.COM :: For The World's Computing Needs.
FIREGULAMAN.COM :: For The Fire In The Belly Of The Coder.
ASTERCASTER.COM :: Supra Astra. Beyond The Stars.
BARTDAY.COM :: Prosperity For Everyone.

That said, many of the extra features that Kubernetes provides are not full-fledged solutions. On the security front, for example, Kubernetes provides some tools to prevent abuse. Still, it’s hardly a sufficient solution on its own to address every security aspect of a given workload. For load-balancing, Kubernetes manages the way traffic is distributed to workloads within a cluster, but it’s not as if it will load-balance your entire network.

The same type of limitation applies to Kubernetes’s logging and monitoring features: While Kubernetes offers some basic logging and monitoring facilities, it’s a far cry from a complete logging and monitoring solution.

Because of these limitations, understanding what Kubernetes can do natively, and when it requires help from external tools to address a particular need, is critical for deploying Kubernetes successfully.

With that reality in mind, let’s take a look at Kubernetes’s built-in logging and monitoring functionality and what’s missing out-of-the-box on the logging and monitoring front in Kubernetes.

Native Kubernetes Logging and Monitoring Features

The built-in monitoring and logging tooling in Kubernetes is basic but effective for certain types of needs. Essentially, it boils down to two types of functionality: log access and log storage.

Using Kubectl to Access the “Logs” of Each Kubernetes Pod

Using a command like kubectl logs [container name], you can read the “logs” of every container running within a Kubernetes cluster.

Read More  Top 5 Supercomputers In The World

The caveat here (and the reason “logs” is in scare quotes) is that the “logs” you can access this way are not actually log files in the traditional sense, but rather the stdout and stderr messages generated by containers as they run. Kubernetes collects this data and stores it in a file that you can access with kubectl, assuming the container is running or, in the case of a failure, the container itself failed instead of the pod. If a pod is evicted, however, you’ll get logs from the evicted pod on why it failed as that’s stored at the system (platform) level, not at the app level. The container logs are gone, though, unless you’re piping them somewhere.

Log Data Stored on Kubernetes Nodes

Kubernetes also logs data from various components of Kubernetes itself to files that you can access by logging into Kubernetes nodes directly.

Specifically, the Kubernetes master node (or nodes, if you have multiple masters) offers log data at /var/log/kube-apiserver.log, /var/log/kube-scheduler.log, and /var/log/kube-controller-manager.log, and each worker node has /var/log/kubelet.log and /var/log/kube-proxy.log files.

When Kubernetes’s Native Logging and Monitoring Features Are Useful

The two types of logging facilities described above come in handy if you need to check information quickly or research a one-time event that occurred within your Kubernetes cluster. They’re kind of akin to the information you could get by running dmesg | tail in a Bash shell on a Linux server, in that they are a quick and easy way of accessing small amounts of information, especially if you already know what kind of information you are looking for.

Missing Logging and Monitoring Features in Kubernetes

When it comes to more complex logging and monitoring needs, however, Kubernetes alone doesn’t cut it. Kubernetes lacks native features for the following critical tasks:

Read More  PyCon 2019 | Extracting Tabular Data From PDFs With Camelot & Excalibur

Log Rotation

Although Kubernetes creates logs for each container and for Kubernetes itself, it doesn’t automatically rotate or archive this data. On the contrary, it expects you to handle log rotation, and if you don’t, you risk having your log files eat up all of the storage space on your nodes.

For the record, I should point out that most Kubernetes distributions do set up log rotation facilities for you when you install them. However, Kubernetes itself doesn’t handle log rotation, and if your distribution doesn’t provide a solution for this task automatically, you need to implement one manually.

Log Aggregation and Centralization

Likewise, Kubernetes doesn’t offer any tools for aggregating log data in a single location or merging similar types of logs together. It lets you view logs for containers and nodes on an individual, one-off basis, which is useful if you need to pull some quick information about a particular container or node.

But, what if you want to monitor all of your containers at once, or trace monitoring data related to a particular event across multiple containers or nodes? The only way to do that natively in Kubernetes would be to access each log manually, which is not practical to do at scale.

Log Analysis

Kubernetes will show you log data, but it does nothing to help you read or interpret it. It doesn’t offer visualization features, or even alerts or notifications about monitoring events that could signal a problem.

Scalable Logging

In most Kubernetes distributions, the container logs available from kubectl are limited to a mere 10 megabytes in size. Kubernetes automatically deletes older data if the logs exceed this limit.

Read More  Apple's $50 Billion Bycatch

This may not be much of an issue if you only have a few containers running and generating log data. But if you have dozens, your log file won’t be of much use because it won’t be large enough to accommodate all of your containers.

Access Historical Monitoring Data

For similar reasons, accessing log data through kubectl is not very helpful if you need to access information about a historical event. Kubernetes may have deleted that data in order to keep the log file under 10 megabytes.

Filling In Kubernetes’s Logging and Monitoring Gaps

In short, Kubernetes offers enough built-in logging and monitoring functionality to allow you to monitor workloads on a small scale or research one-off events that occurred in the recent past.

However, Kubernetes on its own falls far short of offering a full-fledged logging and monitoring solution. To fill the gaps, you need to pair Kubernetes with external tools that can handle log rotation and aggregation, store historical log data over the long term, and provide you with the analytics features you need to achieve true monitoring visibility.

There are different ways to implement this, with the most common being to run a “sidecar” container in each pod that interfaces between the pod and an external log manager. Setting up this type of solution requires a little extra work. No matter how you ensure you gather data for all of your stack to fill the gaps that Kuberentes has, it’s critica to do so if you want to be able to monitor and provide logging for your Kubernetes workloads at scale.

 

By Chris Tozzi


For enquiries, product placements, sponsorships, and collaborations, connect with us at [email protected]. We'd love to hear from you!

Our humans need coffee too! Your support is highly appreciated, thank you!

aster.cloud

Related Topics
  • kubectl
  • Kubernetes
  • LogDNA
  • Native Logging
You May Also Like
Getting things done makes her feel amazing
View Post
  • Computing
  • Data
  • Featured
  • Learning
  • Tech
  • Technology

Nurturing Minds in the Digital Revolution

  • April 25, 2025
View Post
  • Software
  • Technology

Canonical Releases Ubuntu 25.04 Plucky Puffin

  • April 17, 2025
View Post
  • Software
  • Technology

IBM Accelerates Momentum in the as a Service Space with Growing Portfolio of Tools Simplifying Infrastructure Management

  • March 27, 2025
View Post
  • Tech

Deep dive into AI with Google Cloud’s global generative AI roadshow

  • February 18, 2025
View Post
  • Data
  • Engineering

Hiding in Plain Site: Attackers Sneaking Malware into Images on Websites

  • January 16, 2025
Volvo Group: Confidently ahead at CES
View Post
  • Tech

Volvo Group: Confidently ahead at CES

  • January 8, 2025
zedreviews-ces-2025-social-meta
View Post
  • Featured
  • Gears
  • Tech
  • Technology

What Not to Miss at CES 2025

  • January 6, 2025
Vehicle manufacturing
View Post
  • Software

IBM Study: Vehicles Believed to be Software Defined and AI Powered by 2035

  • December 12, 2024

Stay Connected!
LATEST
  • college-of-cardinals-2025 1
    The Definitive Who’s Who of the 2025 Papal Conclave
    • May 7, 2025
  • conclave-poster-black-smoke 2
    The World Is Revalidating Itself
    • May 6, 2025
  • 3
    Conclave: How A New Pope Is Chosen
    • April 25, 2025
  • Getting things done makes her feel amazing 4
    Nurturing Minds in the Digital Revolution
    • April 25, 2025
  • 5
    AI is automating our jobs – but values need to change if we are to be liberated by it
    • April 17, 2025
  • 6
    Canonical Releases Ubuntu 25.04 Plucky Puffin
    • April 17, 2025
  • 7
    United States Army Enterprise Cloud Management Agency Expands its Oracle Defense Cloud Services
    • April 15, 2025
  • 8
    Tokyo Electron and IBM Renew Collaboration for Advanced Semiconductor Technology
    • April 2, 2025
  • 9
    IBM Accelerates Momentum in the as a Service Space with Growing Portfolio of Tools Simplifying Infrastructure Management
    • March 27, 2025
  • 10
    Tariffs, Trump, and Other Things That Start With T – They’re Not The Problem, It’s How We Use Them
    • March 25, 2025
about
Hello World!

We are aster.cloud. We’re created by programmers for programmers.

Our site aims to provide guides, programming tips, reviews, and interesting materials for tech people and those who want to learn in general.

We would like to hear from you.

If you have any feedback, enquiries, or sponsorship request, kindly reach out to us at:

[email protected]
Most Popular
  • 1
    IBM contributes key open-source projects to Linux Foundation to advance AI community participation
    • March 22, 2025
  • 2
    Co-op mode: New partners driving the future of gaming with AI
    • March 22, 2025
  • 3
    Mitsubishi Motors Canada Launches AI-Powered “Intelligent Companion” to Transform the 2025 Outlander Buying Experience
    • March 10, 2025
  • PiPiPi 4
    The Unexpected Pi-Fect Deals This March 14
    • March 13, 2025
  • Nintendo Switch Deals on Amazon 5
    10 Physical Nintendo Switch Game Deals on MAR10 Day!
    • March 9, 2025
  • /
  • Technology
  • Tools
  • About
  • Contact Us

Input your search keywords and press Enter.