ksniff icon indicating copy to clipboard operation
ksniff copied to clipboard

Enable simultaneous packet capture of pods given a deployment, daemonset or a service

Open sthaha opened this issue 3 years ago • 5 comments

Allow packet capturing of an entire deployment or a daemonset.

# Packet capture an entire daemonset
kubectl sniff [--capture-node-traffic] daemonset/dns -n kube-dns 

The command above would find all pods created (owned) by daemonset dns and start tcpdump of all pods, write the output to a local directory. --capture-node-traffic is an optional flag that also captures the entire node traffic

You can find a POC here that makes use of oc debug and oc exec to achieve the same.

sthaha avatar Mar 29 '21 01:03 sthaha

@bostrt @eldadru , please feel free to assign this to me if you feel this feature is worth adding.

sthaha avatar Mar 29 '21 01:03 sthaha

I think this is a fantastic idea @sthaha. Please let me know if you have any questions during development!

bostrt avatar Mar 29 '21 22:03 bostrt

/assign

MichaelWasher avatar Sep 17 '21 07:09 MichaelWasher

@MichaelWasher unfortunately no bot here to assign with :) I re-assigned to you manually

bostrt avatar Sep 17 '21 16:09 bostrt

@bostrt I wrote some code to work towards this but there needs to be quite a change to the CLI arch so want to have a call to discuss what we should do about this.

I think hooking into the Kubectl libraries to do the resource parsing/extracting and argument parsing will make it feel more like an oc / kubectl command when ksniff is called.

MichaelWasher avatar Sep 26 '21 07:09 MichaelWasher