bridgy icon indicating copy to clipboard operation
bridgy copied to clipboard

Support a Kubernetes backend

Open wagoodman opened this issue 6 years ago • 2 comments

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

wagoodman avatar Oct 03 '18 22:10 wagoodman

I would like to work on this, let me know what to start with and what to be done with?

sanghisha145 avatar Oct 04 '18 09:10 sanghisha145

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 (in bridgy/inventory/source.py) and put under bridgy/inventory/kubernetes.py.
  • Add a new InstanceType (something like KUBERNETES or K8S)
  • 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

wagoodman avatar Oct 04 '18 13:10 wagoodman