bridgy
bridgy copied to clipboard
Support a Kubernetes backend
It would ideal to allow for tracking of assets in Kubernetes. This would further extend the exec
command to get a shell into one or more containers (or all containers in a pod with tmux).
This is a good starting point for how the mechanisms of streaming to/from the container (seems more kosher than wrapping kubectl): https://github.com/kubernetes-client/python/blob/master/examples/exec.py
I would like to work on this, let me know what to start with and what to be done with?
This is a larger issue that hasn't been fully worked out, so it could probably be broken into further smaller issues/PRs, but here's a start:
- add a new Inventory class that inherits from and further implements the
InventorySource
(inbridgy/inventory/source.py
) and put underbridgy/inventory/kubernetes.py
. - Add a new
InstanceType
(something likeKUBERNETES
orK8S
) - The definition of
Instance
may need to change or take a nested payload with inventory-specific items. - Update the
handle_exec
method in main.py to be able to exec into a K8s container, similar to https://github.com/kubernetes-client/python/blob/master/examples/exec.py - Document the configuration changes with examples of how to configure a K8s inventory source.
Shout out if you want some help/clarity, @sanghisha145