Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'minikube image load -' leaves behind a poorly-named /tmp/build.NNNN.tar #18758

Open
ebblake opened this issue Apr 25, 2024 · 2 comments
Open
Labels
area/image Issues/PRs related to the minikube image subcommand kind/improvement Categorizes issue or PR as related to improving upon a current feature.

Comments

@ebblake
Copy link

ebblake commented Apr 25, 2024

What Happened?

minikube image load - ends up storing a file in /tmp rather than in memory, and does not clean up that temporary file when the minikube cluster is later destroyed. When repeatedly creating and destroying minikube profiles in order to iteratively test tweaks to a particular image, this can result in /tmp filling up and causing the machine itself to run out of memory or disk space (depending on what backs /tmp). See https://gitlab.com/subprovisioner/subprovisioner/-/merge_requests/24 for a workaround added to bypass minikube's behavior.

What's more, while some of minikube's files in /tmp are obvious (such as /tmp/minikube_XXXX_0.log), the filename chosen for image load is not (/tmp/build.NNN.tar). It is always good practice to make temporary file names include details about where to look when trying to debug when /tmp gets full, and fixing the temporary file to be something like /tmp/minikube_load_build.NNN.tar would fit this bill better.

Attach the log file

log.txt

Operating System

Redhat/Fedora

Driver

Podman

@nirs
Copy link
Contributor

nirs commented Apr 28, 2024

Same issue with log files in /tmp:

$ ls /tmp/minikube_*.log | wc -l
87

$ ls /tmp/minikube_*.log | awk -F_ '{print $2}' | sort | uniq -c | sort -rn
     59 cp
     20 ssh
      2 kubectl
      1 version
      1 ssh-key
      1 profile
      1 ip
      1 delete
      1 completion

It think the first step is to store all files in /tmp/minikube/{user} directory. Then maybe keep only logs for the last N commands.

@afbjorklund
Copy link
Collaborator

afbjorklund commented May 10, 2024

minikube typically had one user.

Changing the names of the tmp files sounds good to me, should probably include if it is "image" or "build" too
Moving the logfiles is a different issue, and if using tmp-on-tmpfs you can use something like TMPDIR=/var/tmp

https://fedoraproject.org/wiki/Features/tmp-on-tmpfs

@afbjorklund afbjorklund added area/image Issues/PRs related to the minikube image subcommand kind/improvement Categorizes issue or PR as related to improving upon a current feature. labels May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/image Issues/PRs related to the minikube image subcommand kind/improvement Categorizes issue or PR as related to improving upon a current feature.
Projects
None yet
Development

No branches or pull requests

3 participants