Skip to content

Instantly share code, notes, and snippets.

@voyager123bg
Forked from omerlh/daemonset.yaml
Created May 14, 2021 09:41
Show Gist options
  • Save voyager123bg/57bbc3509278564c850087bb43ba3693 to your computer and use it in GitHub Desktop.
Save voyager123bg/57bbc3509278564c850087bb43ba3693 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: "/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment