ksniff icon indicating copy to clipboard operation
ksniff copied to clipboard

for windows pods it's failing

Open gudipudipradeep opened this issue 2 years ago • 4 comments

`Events: Type Reason Age From Message


Warning FailedMount 59s kubelet Unable to attach or mount volumes: unmounted volumes=[container-socket], unattached volumes=[container-socket host default-token-zrwjq]: timed out waiting for the condition Warning FailedMount 54s (x9 over 3m1s) kubelet MountVolume.SetUp failed for volume "container-socket" : hostPath type check failed: /var/run/docker.sock is not a socket file ` Please help for windows pod to achieve this @eldadru.

gudipudipradeep avatar Dec 08 '21 12:12 gudipudipradeep

What version of ksniff are you using?

bostrt avatar Jul 18 '22 19:07 bostrt

Will this not work for windows pods?

time="2022-08-04T12:06:49-07:00" level=info msg="pod: 'ksniff-8rscb' created successfully in namespace: 'test'" time="2022-08-04T12:06:49-07:00" level=info msg="waiting for pod successful startup" time="2022-08-04T12:07:49-07:00" level=error msg="failed to create privileged pod on node: 'xxxxxx" error="failed to create pod within timeout (1m0s)" Error: failed to create pod within timeout (1m0s) Error: exit status 1

aaronchoi5 avatar Aug 04 '22 19:08 aaronchoi5

Ksniff hasn't been tested with Windows Pods yet. We've had to make special customizations for each container runtime so that ksniff could run with them and I think Windows Pods will require something similar.

I'm not in a position to work with Windows Pods so I would be open to a PR from anyone in the ksniff community.

At first glance, we might need to know why exactly the Pod can't be created:

 time="2022-08-04T12:07:49-07:00" level=error msg="failed to create privileged pod on node: 'xxxxxx" error="failed to create pod within timeout (1m0s)"

Perhaps checking kubectl events would be a good place to start.

bostrt avatar Aug 05 '22 13:08 bostrt

I have another error

time="2022-09-13T14:26:09+02:00" level=info msg="using tcpdump path at: '/home/qqq/.krew/store/sniff/v1.6.2/static-tcpdump'"
time="2022-09-13T14:26:10+02:00" level=info msg="no container specified, taking first container we found in pod."
time="2022-09-13T14:26:10+02:00" level=info msg="selected container: 'qqq'"
time="2022-09-13T14:26:10+02:00" level=info msg="sniffing method: upload static tcpdump"
time="2022-09-13T14:26:10+02:00" level=info msg="sniffing on pod: 'qqq' [namespace: 'qqq', container: 'qqq', filter: '', interface: 'any']"
time="2022-09-13T14:26:10+02:00" level=info msg="uploading static tcpdump binary from: '/home/qqq/.krew/store/sniff/v1.6.2/static-tcpdump' to: '/tmp/static-tcpdump'"
time="2022-09-13T14:26:10+02:00" level=info msg="uploading file: '/home/qqq/.krew/store/sniff/v1.6.2/static-tcpdump' to '/tmp/static-tcpdump' on container: 'qqq'"
time="2022-09-13T14:26:10+02:00" level=info msg="executing command: '[/bin/sh -c test -f /tmp/static-tcpdump]' on container: 'qqq', pod: 'qqq', namespace: 'qqq'"
time="2022-09-13T14:26:12+02:00" level=error msg="failed executing command: '[/bin/sh -c test -f /tmp/static-tcpdump]', exitCode: '0', stdErr: ''" error="Internal error occurred: error executing command in container: failed to exec in container: failed to start exec \"880676f4304ce7b89f4defce445b6acf43b2e16e246fecdb1f2a9a3d0bac49c2\": hcs::System::CreateProcess 46a09bf24f470bcea6bbd5d0d8b23c93d8e215bcfcb0da0b2792b82e9bb63693: The system cannot find the file specified.: unknown"
time="2022-09-13T14:26:12+02:00" level=error msg="failed uploading static tcpdump binary to container, please verify the remote container has tar installed" error="Internal error occurred: error executing command in container: failed to exec in container: failed to start exec \"880676f4304ce7b89f4defce445b6acf43b2e16e246fecdb1f2a9a3d0bac49c2\": hcs::System::CreateProcess 46a09bf24f470bcea6bbd5d0d8b23c93d8e215bcfcb0da0b2792b82e9bb63693: The system cannot find the file specified.: unknown"
Error: Internal error occurred: error executing command in container: failed to exec in container: failed to start exec "880676f4304ce7b89f4defce445b6acf43b2e16e246fecdb1f2a9a3d0bac49c2": hcs::System::CreateProcess 46a09bf24f470bcea6bbd5d0d8b23c93d8e215bcfcb0da0b2792b82e9bb63693: The system cannot find the file specified.: unknown

I think it's because of plugin trying to use linux binary in windows container. There should be another approach

a-mazed avatar Sep 13 '22 12:09 a-mazed