Skip to content

Instantly share code, notes, and snippets.

@rollulus
Created February 10, 2017 08:49
Show Gist options
  • Save rollulus/19f283161607419c18a0a9d1df1b6b6e to your computer and use it in GitHub Desktop.
Save rollulus/19f283161607419c18a0a9d1df1b6b6e to your computer and use it in GitHub Desktop.
pipe into kubectl run

I had the need to pipe data into a container being run in kubernetes. I found out that whatever combination of -i, -t or --attach I specified, the containerised process never received an EOF. And if it did, all it received was the EOF; not the data I piped into it. Unless I carefully went through all flags, and realised that --restart=Never solves it:

cat example.yaml | kubectl run -i --image img name --restart=Never
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment