kubectl-node-shell
kubectl-node-shell copied to clipboard
How to copy binary data to stdout?
I try to get a files or directories like this:
k node-shell mynode -- tar -czf- /var/log/... > o.tgz
But this fails, because tar does not write to a tty:
tar: Refusing to write archive contents to terminal (missing -f option?) tar: Error is not recoverable: exiting now
Is there a way to make node-shell not create a tty?
I tried this workaround:
k node-shell mynode -- sh -c "tar -czf- /var/log/... |cat" > o.tgz
But this seems to alter the binary data slightly. Extracting it does not work:
gzip: stdin: invalid compressed data--format violated
It would be really great if output of binary data would be supported.