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

Get top large files #348

Open
devopsmash opened this issue Apr 21, 2024 · 1 comment
Open

Get top large files #348

devopsmash opened this issue Apr 21, 2024 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@devopsmash
Copy link

devopsmash commented Apr 21, 2024

I have a scenario where one of my Kubernetes nodes is experiencing disk pressure. Due to my use of the Bottlerocket OS, it's somewhat challenging to run utilities that are not containerized.

I tried to use the gdu docker image and get the files that cause the disk pressure, unfortunately without any success.

It would be amazing if I could run a k8s job like this and get the top X large files

apiVersion: batch/v1
kind: Job
metadata:
  name: disk-space-checker
  labels:
    app: disk-space-checker
    release: disk-space-checker
spec:
  backoffLimit: 0
  parallelism: 1
  ttlSecondsAfterFinished: 3600 # keep job for 1 hour 
  activeDeadlineSeconds: 900 # timeout after 15 min   
  template:
    metadata:
      labels:
        app: disk-space-checker
    spec:
      restartPolicy: Never
      containers:
      - name: disk-space-checker
        image: ghcr.io/dundee/gdu:v5.28.0
        imagePullPolicy: IfNotPresent
        securityContext:
          runAsUser: 0
        resources:
          requests:
            cpu: 250m
        args: ["--non-interactive","--show-apparent-size","--show-item-count","--max-cores","4","--no-delete","--ignore-dirs","/host/proc,/host/dev,/host/sys,/host/run,/host/local,/host/mnt,/host/etc,/host/boot","--no-cross","/host"]
        volumeMounts:
        - name: host
          mountPath: "/host"
          readOnly: true
      volumes:
        - name: host
          hostPath:
            path: "/"

With this k8s job I gets only root directories without getting sub directories and files.

Any chance to have additional parameter that can sort top X files by size?

@dundee dundee added the enhancement New feature or request label Apr 22, 2024
@dundee
Copy link
Owner

dundee commented Apr 22, 2024

This sounds like a valid use case. I will try to add it to the next release.

@dundee dundee added this to the 5.29 milestone Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants