Add support to run kubectl commands from the leverage CLI.
It works by taking the kubectl config file from your home folder and passing the commands directly to the binary.
The authentication for AWS (required for EKS) is handled by leverage transparently (although is slow, so a topic open for discussion).
Open questions (Update: issues were created for all of them already!)
What version of kubectl do we want to support? The binaries are kind of lightweight (~40MB) so we can have multiples on the image and provide a command to do the switch.
Do we want automatic refreshing of the tokens like we do with the terraform commands? That is the approach I took, but is proved to be slow (takes ~2 seconds every time you execute a command). For terraform is feasible but for kubectl looks like is not. I would like to take another approach.
Should we add a layer of commands on top of it? Like a wrapper for get/use-context. We should analyze the complexity of it before adventuring into this direction, doesn't seems trivial.
ToDo
[x] unit tests
[x] flow documentation (login, set/switch contexts, run commands)
What?
Add support to run
kubectl
commands from the leverage CLI. It works by taking thekubectl
config file from your home folder and passing the commands directly to the binary. The authentication for AWS (required for EKS) is handled byleverage
transparently (although is slow, so a topic open for discussion).Why?
To keep unifying flows into a single tool. More details here.
References
New toolbox image required: https://github.com/binbashar/le-docker-leverage-toolbox/pull/43
Open questions (Update: issues were created for all of them already!)
kubectl
do we want to support? The binaries are kind of lightweight (~40MB) so we can have multiples on the image and provide a command to do the switch.terraform
commands? That is the approach I took, but is proved to be slow (takes ~2 seconds every time you execute a command). Forterraform
is feasible but forkubectl
looks like is not. I would like to take another approach.ToDo