Seeking Recommendations for a Kubernetes Log Collection Solution

0
12
Asked By CloudyWhisper87 On

Hey everyone! I recently set up a Kubernetes cluster on three VMs in my vCenter environment, targeting a backend API to start with, and eventually plan to add a UI application too. Currently, I have three replicas of the API running with a NodePort for access, and I've implemented a secret for MongoDB credentials and a ConfigMap for some environment variables. I'm also using a Persistent Volume that all the nodes can access via NFS.

However, I've noticed that the logs from my Python Flask API are being written with some delay, which prompted me to look into a log collection solution for my Kubernetes cluster that could work for both my applications. I'm attempting to use Grafana with Loki and Promtail, along with MinIO hosted on an external VM in the same network. Unfortunately, I've faced multiple issues that caused Loki to crash when connecting to MinIO, even though it's configured correctly.

Given that I've seen reports about MinIO discontinuing feature development, I'm not sure if it's worth continuing with it. Can anyone suggest alternative tools for log collection that would be effective for my setup? Any insights would be greatly appreciated!

5 Answers

Answered By TechSavvyDev On

It sounds like the log delay could be related to your Python app. You might want to explore using the PYTHONUNBUFFERED environment variable to see if that helps. Keep in mind that the NFS sync could also contribute to this issue. I'm eager to build a comprehensive logging stack since I want to deploy more applications down the line.

LogGuru42 -

It can come from that, or NFS sync and others. I want to implement a stack for log collecting as I will deploy other apps in the future.

Answered By LokiWatcher On

Rather than using MinIO, consider sending logs to S3 directly with Loki. Promtail is working but is deprecated, with Alloy as its replacement. If Loki continues to crash, check if you need to allocate more resources for your Loki and scraper.

Answered By LogGuru42 On

Consider swapping out MinIO for Ceph or Garage for better stability. Also, look into replacing Promtail, which is deprecated, with Alloy. It should give you a more solid logging stack. Good luck!

CloudyWhisper87 -

I’ll look into that. Thanks!

Answered By KubeMaster On

You might find some helpful resources at kube-logging.dev for setting up your logging framework!

Answered By TelemetryNinja On

You might want to set up an OpenTelemetry collector and route logs to Loki, then visualize them in Grafana. You can have your application send logs directly to the OpenTelemetry collector using cluster DNS. This collector can also handle metrics and traces, forwarding everything to Grafana Tempo. It could simplify your logging setup!

CloudyWhisper87 -

I’ll check on it. Thanks!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.