{{- define "containerd-config" -}} # Configure log rotation for all logs in /var/log/pods/*/*/*.log, which is where containerd containers # are configured to write their log files. Whenever logrotate is ran, this # config will: # * rotate the log file if its size is > 100Mb OR if one day has elapsed # * save rotated logs into a gzipped timestamped backup # * log file timestamp (controlled by 'dateformat') includes seconds too. This # ensures that logrotate can generate unique logfiles during each rotation # (otherwise it skips rotation if 'maxsize' is reached multiple times in a # day). # * keep only 14 old (rotated) logs, and will discard older logs. /var/log/pods/*/*/*.log { rotate 14 copytruncate missingok notifempty compress maxsize 100M daily dateext dateformat -%Y%m%d-%s create 0644 root root } {{- end -}}