Friday 16 December 2016

How to Enable Automated Docker Container and Image Cleanup in Amazon ECS? ~ AwsTechNix

                  








Issue

My EC2 instance in Amazon ECS has run out of space with an error message similar to the following in the /var/log/messages log file:
Mar 18 16:29:36 ip-10-10-10-10 lvm[2016]: Insufficient free space: 1120 extents needed, but only 19 available
By default, the Amazon ECS Agent on the container instance cleans up stopped containers in a task.
The default interval for this cleanup is 3 hours, but this can be controlled using the following agent parameter in the /etc/ecs/ecs.config file:
ECS_ENGINE_TASK_CLEANUP_WAIT_DURATION
Note: Any value shorter than 1 minute is ignored. For more information, see Available Parameters.
With the release of ECS container agent version 1.13.0, Docker images and stopped tasks are cleaned up automatically with the following variable:
ECS_DISABLE_IMAGE_CLEANUP
Note: If you set this variable to true, automated image cleanup is disabled on your container instance, and no images are automatically removed.
If you are not on ECS agent version 1.13.0 or greater, you must upgrade to use the automatic image removal feature; see Updating the Amazon ECS Container Agent. The ECS container agent configuration variables can be configured to tune your automated task and image cleanup experience; see Tunable Parameters.

Hope this will help you!

Please Remember me in your prayers!

Enjoy :-)

No comments :

Post a Comment