skip to Main Content

I have a native Kubernetes version v1.28.5 installed on Debian. I use it as test env. Looks like i have quite a lot log files and images from previous helm charts.

How I can clean old log files and images which are no longer used?

2

Answers


  1. after going through many of the articles ,here is some language and ref which might be helpful for you.

    1st understand the following.

    Commonly, the logging agent is a container that has access to a
    directory with log files from all of the application containers on
    that node.

    also read the log-location-node

    as far as i know kubernetes does not directly manage log files.

    as you have not specified but if you are using docker as the container runtime
    then you can use the docker logs command docker container logs [OPTIONS] CONTAINER to view and manage container logs from here you can then delete the log files manually

    or use a log rotation mechanism to automatically clean up old log files.

    also you might want to go through clear-a-pods-log-in-kubernetes

    Login or Signup to reply.
  2. Images can removed using docker image prune -a
    Reference:- https://docs.docker.com/engine/reference/commandline/image_prune/

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search