spinkube / spin-plugin-kube

A Spin plugin for interacting with Kubernetes.
Other
27 stars 7 forks source link

spin k8s proxy command #12

Closed rajatjindal closed 8 months ago

rajatjindal commented 9 months ago

This PR adds support for spin k8s proxy command, which supersedes the spin k8s connect command.

This command actually starts a Kubernetes controller watcher to watch for new pods for a given spin app and updates the reverse-proxy config (currently backed by Caddy) to distribute the requests to ALL the pods instead of just one pod. It takes care of keeping the reverse proxy updated as new pods come online or old one's go away.

This command also do tail logs from the pods which are currently serving traffic.

One of the use case for this command is to do exactly that, that is to send traffic to all pods instead of just one pod.

Future work for this functionality may include stuff like:

bacongobbler commented 9 months ago

Thanks @rajatjindal!

This PR adds support for spin k8s proxy command, which supersedes the spin k8s connect command.

I noticed this PR does not remove the spin k8s connect command. Can you please remove that command from the plugin and rename spin k8s proxy to spin k8s connect?

rajatjindal commented 8 months ago

Hi @bacongobbler, this PR has been updated to take dependency on kubectl-reverse-proxy

we can discuss and decide to change the ownership of the kubectl-reverse-proxy (e.g. moving that to spinkube org if that makes sense).

Thanks