We have running Java applications inside Kubernetes pods. In case of Java OOM heap dump generated on the local pod's storage, I want to automatically copy heapdump to s3, before pod restart or k8s tigger liveness. Now there are multiple possibilities to copy heapdump to s3 automatically.
- Install AWS cli and 3rdparty tools(inotifywait, incron) and copy automatically on s3.
- Mount S3 drive on Kubernetes pod, i personally discourage it as it requires infrastructure change.
- Is there any way inside Kubernetes that can copy heapdump directly on s3, without installing any 3rth party tool or mounting drive on pod
OR what are your recommendations?