Skip to main content
Version: latest

snapshot_socket

The snapshot_socket shows existing sockets.

Getting started

Running the gadget:

$ kubectl gadget run ghcr.io/inspektor-gadget/gadget/snapshot_socket:latest [flags]

Guide

Run a pod / container:

$ kubectl run --restart=Never --image=nginx test-snapshot-socket
pod/test-snapshot-socket created

Then, run the gadget and see how it shows the sockets used by nginx:

$ kubectl gadget run snapshot_socket:latest
K8S.NODE K8S.NAMESPACE K8S.PODNAME K8S.CONTAINERNAME SRC DST STATE
minikube-docker default test-snapshot-socket test-snapshot-socket :::80 :::0 10
minikube-docker default test-snapshot-socket test-snapshot-socket 0.0.0.0:80 0.0.0.0:0 10
^C

Finally, clean the system:

$ kubectl delete pod test-snapshot-socket