Score:0

Forwarding apache logs from k8s Pod to Syslog server

jp flag

I am new to Kubernetes, I know there are multiple ways to log collection. but I am specifically asking about my scenario. we have a Syslog xyz.com port 8090. now we want our pods to send logs to our server xyz.com. what is the best way to achieve this? is there any centralize way of customizing logs from all deployment pods, or should we have to configure rsyslog service in a container and rebuild the container? or any best practice that you guys can suggest.

Thanks, Yousuf

pt flag
[The documentation](https://kubernetes.io/docs/concepts/cluster-administration/logging/) is a good place to start with questions about centralized logging.
Score:1
nl flag

Refer to Sudheer Chamarthi’s Medium Blog Published in ITNEXT Run Rsyslog server in Kubernetes and follow below steps to stream logs in Syslog server :

  1. Build and Push your image to Docker Registry
  2. Create Separate Namespace
  3. Create Persistent storage
  4. Create Rsyslog Deployment
  5. Expose deployment to service
  6. Expose service to NLB
  7. Do Testing & Scaling

You can have a look at the Github archive on Logging Architecturkubernetes-rsyslog-logging that provides kubernetes configuration to establish a centralized logging solution. You can have a glance at John Starich’s tutorial on Kubernetes Log Forwarding with Syslog.

As @ larsks mentioned in the comment, Using a sidecar container with the logging agent is widely used. It is application independent, making it a much more flexible solution and note it can be implemented in 2 different ways.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.