How could I clear existing log of a specific pod?
So that I can get all logs since that time with kubectl logs
next time.
Thanks!
You can't, the log rotation is generally implemented in Docker (or sometimes via logrotate on the node host). However you can use kubectl logs --since-time
and fill in the time of your last get. If you're trying to build something to iteratively process logs automatically, probably use Fluentd to load them into some kind of database (Kafka is common for this).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With