Open jmdacruz opened 3 years ago
This isn't officially supported as Octant is intended to run as a desktop application. It looks possible based on https://github.com/kubernetes/client-go/blob/master/tools/portforward/portforward.go#L75 and have Octant choose a port randomly instead.
It'd be helpful to have information on your use case and see if we can prioritize this issue accordingly
Thanks for the link to the code! I guess it would be enough to allow selecting the local port on the UI since the parsePorts
function allows for things such as :5000
or 4000:5000
(with 4000
being the local port).
With regards to the use case, imagine a development environment where people share a docker image with all the Kubernetes tools and context/configuration (e.g. kubectl
, kubectx
, authentication plugins, etc.), so that people don't have to setup everything from scratch on their environments. Based on this image you can create another one that simply adds the octant
CLI for people to launch.
Describe the problem/challenge you have When running octant inside a docker image (using docker compose), the port forwarding function won't work.
Describe the solution you'd like Provide a configuration parameter to octant with a local port range to use for port forwarding. Octant should attempt to use a port in the provided range.
Anything else you would like to add: By using a predefined port range, the user can now forward this entire port range in docker or docker compose.
Environment:
octant version
): 0.16.1 (Git commit: 8aebb34922f83894fb02ad393740e96ee1b3d8fe)kubectl version
):