Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more verbose output #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ferrandinand
Copy link

@ferrandinand ferrandinand commented May 27, 2019

I found kubectl-capture really useful but sometimes I had some difficulties to get some information about why it doesn´t create the capture file.

This PR creates:

  • Add option -v to show what is happening in the process to scrap data.
  • When verbose option is set. Commands are executed without omitting output and getting logs from the capture pod.
  • Final output don´t say that a file is created if it does not exist.

@nestorsalceda Let me know how do you feel about this option.

Example:

kubectl capture net-exporter-4p7ls -ns kube-system --ebpf -v -M 10 --snaplen 256

pod/capture-net-exporter-4p7ls-1558943294 created
Sysdig is starting to capture system calls:

Node: master-qomd3-84d58bd6fb-vsfsm
Pod: net-exporter-4p7ls
Duration: 10 seconds
Parameters for Sysdig: -S -M 10 -pk -z -w /capture-net-exporter-4p7ls-1558943294.scap.gz  --snaplen 256

* Setting up /usr/src links from host
ls: cannot access '/host/usr/src': No such file or directory
* Mounting debugfs
Found kernel config at /proc/config.gz
* Trying to compile BPF probe sysdig-probe-bpf (sysdig-probe-bpf-0.26.0-x86_64-4.19.23-coreos-r1-03bf994bd8b87756106f34511fc1aadb.o)
* BPF probe located, it's now possible to start sysdig
* Capturing system calls
* Mounting debugfs
Found kernel config at /proc/config.gz
* BPF probe located, it's now possible to start sysdig
mmap (2): Cannot allocate memory
----------------------
Event           #Calls
----------------------
tar: Removing leading `/' from member names
tar: /capture-net-exporter-4p7ls-1558943294.scap.gz: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors
error: capture-net-exporter-4p7ls-1558943294.scap.gz no such file or directory
pod "capture-net-exporter-4p7ls-1558943294" deleted
Error capturing, file not created. Try with the verbose option(-v) to have get more info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant