How To Rotate Container Logs on The Master and Worker Nodes
Problem
Container logs are utilizing all the disk space on the master and worker nodes.
Environment
Platform9 Managed Kubernetes - All Versions
Docker
Cause
The docker service is not configured to rotate the container logs.
Resolution
Back up the /etc/docker/daemon.json file on the affected node if present. Add the log rotation config on the node in the file /etc/docker/daemon.json file as shown below.
Change the values for max-size and max-file parameter as per your requirement.
Perform the below steps on one node at a time to avoid downtime.
Stop the Platform9 Managed Kubernetes stack by executing commands in the below sequence.
Restart the docker service.
Start the Platform9 Managed Kubernetes stack by executing the commands in the below sequence.
Verify the changes took effect on the container by running below command.
