Analysis of current storage requirements with Linux, Docker and Kubernetes commands.
Problem:
Over time, data accumulates if your company uses the ReqIF Manager or updates the requisis Toolbox. If there is no or too little free storage space for new imports on the system used, your users will receive the following error when uploading:
In Docker CLI, the following error can occur during an update if there is no or too little free disk space:
INTERNAL ERROR: cannot create temporary directory!
Before you start the analysis, it can be helpful to switch on the maintenance mode of the requisis_toolbox. You can read how this works in this article.
Analysis with Docker:
First start with a general analysis to be sure that the increased memory usage is not due to other applications, temporary files, backups or the operating system. The command df -h can be used for this under Linux.
If this could be ruled out, get an overview of the current memory utilization of the Docker environment. To do this, use the command docker system df -v . It lists all existing images, containers and volumes and displays the amount of disk space used in the Size column. Further information on the df command can be found in the Docker.docs.
Analysis with Kubernetes:
If you are using Kubernetes, you can use the kubectl top pods or kubectl top nodes command to check the resource usage (CPU and memory) of the pods and nodes. Further information on the top command can be found here in the kubernetes documentation.
You can display the current memory usage within a container with kubectl exec -it <PodName> -n <NameSpace> -- df -h. Further information on the exec command can be found here in the kubernetes documentation.
Clean up with Docker:
The best way to clean up Docker is to use the commands docker container/image/volume/network rm <ID/Name>. This is the only way you can be relatively sure not to accidentally delete any data you may need. The rm commands do not allow you to delete resources that are currently in use. This gives you the best control over what is retained.
It is possible to remove all containers, images, volumes, etc. that are currently suspended and not used by Docker. Volumes, etc. can be removed. The docker system prune -a command can be used for this purpose.
The use of docker system prune -a is not recommended. This can lead to data being deleted that should not be deleted.
Only use prune in conjunction with a filter: docker image prune --filter “until=24h” . To only include images older than 24 hours when deleting. Further information on the prune command can be found in the Docker.docs.
Clean up with Kubernetes:
If you use Kubernetes, you must clean up the previously analyzed pods or nodes etc. with several kubectl delete commands. This is best done using a script. All information about the delete command can be found here in the kubernetes documentation.
Activate disk space warning:
The requisis_Toolbox offers the option of monitoring the memory space used. If a memory utilization defined by you occurs, you can receive warnings by e-mail or have them displayed in the GUI of the requisis_Toolbox.
You will find the necessary options in the parameters.yml file in the store/toolb/config subfolder.
A description of the parameters can be found in the Admin Manual in chapter 4.3.8 Configure Diskspace Warning.