Feature: repeatedly trim log files to limit storage consumption
Summary
Context: gitlab-org/charts/gitlab#2328 (comment 1121111592)
Problem: log file(s) for long-running pods in Kubernetes can take up significant storage space, which can cause issues (gitlab-org/charts/gitlab#2328 (closed)).
Solution: gitlab-logger can add support for repeatedly trimming log files to enforce a desired maximum file size.
References
Below are some resources that may be helpful:
- https://pkg.go.dev/os#File.Truncate
- https://stackoverflow.com/questions/52872321/how-to-remove-first-n-bytes-of-a-large-file-in-golang
Acceptance criteria
-
Log file maximum size is unlimited by default (open to discussion) -
Log file maximum size can be specified -
Log files will not exceed the specified maximum size (by trimming data from the head of log files, i.e. the oldest data)
Edited by Mitchell Nielsen