0

We have an application running in a Docker container, within Kubernetes, but because of certain limitations we can't change the application to log to stdout & stderr. This means when the app fails and triggers a container restart we lose any logs that could help us diagnose the issue. The application writes to a directory path within the container.

Two possibilities that we are wanting explore:

  • Having the directory being written to be a mounted persistent volume, that we can look at even when the container gets restarted
  • Have the latest log file created (rolling logs) be tailed and redirected to stdout

Right now I am wanting to explore the first of the two options, since it should allow us to see the failure state even once the container gets restarted. I will explore the second option in parallel.

Any suggestions how to approach the first option? We are using Digital Ocean, and the latest version of Kubernetes, if that changes anything.

1 Answer 1

0

The application writes to a directory path within the container.

So, mount a volume there. Problem solved. This is no different than any other volume – if you were running docker directly, you'd use -v, and depending on how you administer your specific kubernetes setup, you configure the volumes in a config file, or via some other API.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .