Skip to content

Instantly share code, notes, and snippets.

@omerlh
Last active April 20, 2023 08:50
Show Gist options
  • Save omerlh/cc5724ffeea17917eb06843dbff987b7 to your computer and use it in GitHub Desktop.
Save omerlh/cc5724ffeea17917eb06843dbff987b7 to your computer and use it in GitHub Desktop.
A daemonset that print the most heavy files on each node
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: disk-checker
labels:
app: disk-checker
spec:
selector:
matchLabels:
app: disk-checker
template:
metadata:
labels:
app: disk-checker
spec:
hostPID: true
hostIPC: true
hostNetwork: true
containers:
- resources:
requests:
cpu: 0.15
securityContext:
privileged: true
image: busybox
imagePullPolicy: IfNotPresent
name: disk-checked
command: ["/bin/sh"]
args: ["-c", "du -a /host | sort -n -r | head -n 20"]
volumeMounts:
- name: host
mountPath: "/host"
volumes:
- name: host
hostPath:
path: "/"
@omerlh
Copy link
Author

omerlh commented Aug 4, 2020

Happy to hear this was solved!

@voyager123bg
Copy link

Just passing by, wanted to thanks for the clever solution.

@omerlh
Copy link
Author

omerlh commented May 16, 2021

Thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment