Access instance port like port-foward method in Kubernetes world

Hello !

I was wondering if there is a solution to access an application on a remote LXD instance behind a private network much like what kubectl port-forward command provides in a Kubernetes environment ?

https://kubernetes.io/docs/tasks/access-application-cluster/port-forward-access-application-cluster/

LXD proxy works great when the instance is local to the client, but when an instance is located remotely behind a private network, the access is a bit harder since it require a network exposition (through proxy or network forward).

My main use-case will be for testing and/or debugging purposes in my homelab, I want to able to launch an instance with an application on an LXD node with a private network (behind a managed LXD network for example), and access it temporarily through a kind of TCP tunnel without exposing it, something in this idea described in the above Kubernetes documentation. Moreover, I don’t use SSH in my instances since I work mostly with the lxc shell command and when using Ansible, playbooks uses the community connection plugin through LXD File API.

Thanks !

Hi,

This sounds like:

We’ve made some inroads with this since we added the lxc file mount command that tunnels sshfs over the websocket, but we’ve not yet added support for general proxying of TCP through the websocket.

1 Like

Hello, didn’t see this issue, thanks for your input :slight_smile:

1 Like