My team has a special requirement to delete all pod logs every X hours. This is cause the logs contain some sensitive info - we read and process them with fluentbit, but it's an issue that the logs are still there after. I couldn't find any normal way to rotate them by time, only recommendations on the docker daemon logging driver that rotates by file size. Is it possible to create a k8s cronjob to do something like "echo ''> /path/to/logfile" per pod/container? If yes, how?
I'd appreciate any help here. Thanks!