I have an application which stores logs in a file at a configurable location.
Let's say /abc/pqr/application.log
Application is being migrated to Kubernetes where it will run in a single pod. If I run kubectl log <pod-name>
, I get anything that gets printed on stdout
which I can redirect to a file. I want to do the other way around, I have a file containing logs at above location and I want kubectl logs <pod-name>
to print logs from that file.
For example, if run kubectl logs kafka
for a kafka pod deployed using bitnami/kafka, I get logs from /opt/bitnami/kafka/logs/server.log
. I want to mimic this behavior.