snapshot_process
The snapshot_process
shows running processes.
Getting started
Running the gadget:
- kubectl gadget
- ig
$ kubectl gadget run ghcr.io/inspektor-gadget/gadget/snapshot_process:latest [flags]
$ sudo ig run ghcr.io/inspektor-gadget/gadget/snapshot_process:latest [flags]
Flags
--threads
Show all threads (by default, only processes are shown)
Default value: "false"
Guide
Run a pod / container:
- kubectl gadget
- ig
$ kubectl run --restart=Never --image=busybox test-snapshot-process -- sh -c 'sleep inf'
pod/test-snapshot-process created
$ docker run --name test-snapshot-process -d busybox /bin/sh -c 'sleep inf'
...
Then, run the gadget and see how it shows the sleep process:
- kubectl gadget
- ig
$ kubectl gadget run snapshot_process:latest
K8S.NODE K8S.NAMESPACE K8S.PODNAME K8S.CONTAINERNAME COMM PID TID PPID
minikube-docker default test-snap…t-process test-snapshot-proce sh 530932 530932 530911
^C
$ sudo ig run snapshot_process:latest -c test-snapshot-process
RUNTIME.CONTAINERNAME COMM PID TID PPID
test-snapshot-process sh 524665 524665 524645
^C
Finally, clean the system:
- kubectl gadget
- ig
$ kubectl delete pod test-snapshot-process
$ docker rm -f test-snapshot-process