WORKAROUND (just use changes from the related PR):
For the workaround, you can build ksnif from PR sources and replace it.\
Example for the MacOS on ARM:
» ~ cd /tmp
» /tmp git clone -b feature/request-timeout-flag git@github.com:mgerasimchuk/ksniff.git
Cloning into 'ksniff'...
Resolving deltas: 100% (293/293), done.
» /tmp cd ksniff
» /tmp/ksniff (feature/request-timeout-flag) make darwin
Flag --short has been deprecated, and will be removed in the future. The --short output will become the default.
GO111MODULE=on GOOS=darwin GOARCH=amd64 go build -o kubectl-sniff-darwin cmd/kubectl-sniff.go
GO111MODULE=on GOOS=darwin GOARCH=arm64 go build -o kubectl-sniff-darwin-arm64 cmd/kubectl-sniff.go
» /tmp/ksniff (feature/request-timeout-flag) cp kubectl-sniff-darwin-arm64 ~/.krew/bin/kubectl-sniff
» /tmp/ksniff (feature/request-timeout-flag) kubectl sniff --help | grep timeout
--pod-creation-timeout duration the length of time to wait for privileged pod to be created (e.g. 20s, 2m, 1h). A value of zero means the creation never times out. (default 1m0s)
--request-timeout duration the length of time to wait before giving up on a single request to the kubernetes api (e.g. 20s, 2m, 1h). A value of zero means the creation never times out. (default 30s)
» ~ kubectl sniff --request-timeout 520s --pod-creation-timeout 520s -p -n default nginx-69f9fb6f84
I try to sniff the traffic by using a privileged pod, but face k8s API timeout:
For now, it's not possible to change timeout, cos it is hardcoded by 30s here: https://github.com/eldadru/ksniff/blob/b0b737c/pkg/cmd/sniff.go#L231
WORKAROUND (just use changes from the related PR):
For the workaround, you can build ksnif from PR sources and replace it.\ Example for the MacOS on ARM: