The "/var/log/messages" inside the Guest Cluster nodes fills up the root partition causing the nodes to go unhealthy. In the worst-case scenario, this might lead to pods getting evicted out of the nodes because of the disk pressure caused by the lack of space.
This is expected in any Tanzu Kubernetes Cluster with TKR version less than v1.32.
Logrotate isn't added to the TKRs' as a part of the OVA generation process.
Issue has been fixed in TKr v1.32.0 for vSphere 8.x
Workaround:
For Photon: sudo tdnf install logrotate -y
For Ubuntu: sudo apt install logrotate -y
By default, the entry should be available in /etc/cron.daily/logrotate. If not, then update the `/etc/logrotate.d/messages` to include the below configuration.
/var/log/messages { compress nodateext rotate 5 daily maxsize 100M missingok notifempty copytruncate}
This will cause the /var/log/messages to get rotated either when the size crosses 100M or daily. For this to complete, the logrotate command should run successfully.
By default, the entry inside /etc/cron.daily/logrotate should run the daily logrotate command which in-turn should rotate the logs. Please update the value in `maxsize` depending upon the disk space availability.
If for some reason, we need to manually rotate /var/log/messages, run the below command.
sudo /usr/sbin/logrotate /etc/logrotate.d/messages
daily log rotation by default.However, in certain scenarios where daily log rotation may not be sufficient, the rotation frequency can be increased to hourly by implementing the following additional configuration.
Create or update the file /etc/systemd/system/logrotate.timer.d/override.conf with the following content:[Unit]Description=Hourly rotation of log filesDocumentation=man:logrotate(8) man:logrotate.conf(5)[Timer]OnCalendar=hourlyRandomizedDelaySec=1hPersistent=true[Install]WantedBy=timers.target
After updating the configuration file, restart the logrotate timer service and reload the systemd daemon using the following commands:systemctl restart logrotate.timersystemctl daemon-reload
A permanent fix that increases the log rotation frequency is available starting from minor version 1.32.10, 1.33.6, 1.34.2,1.35.