Hacker News new | ask | show | jobs
by forestgagnon 1809 days ago
I wrote a convoluted tool for this problem which isolates kubectl environments in docker containers: https://github.com/forestgagnon/kparanoid.

This approach allows the convenience of short, context-free commands without compromising safety, because the context info in the shell prompt can be relied on, due to the isolation.

There are some things which don't work well inside a docker container (port-forwarding for example), but it does make it simple to have isolated shell history, specific kubectl versions, etc.

2 comments

I like how you explain the problem of `PS1` (stateful vs stateless). I actually saw the problem before but only once.
This is really nice. I like that it doesn't munge the `kubectl` command itself.