gefyrahq / gefyra

Blazingly-fast :rocket:, rock-solid, local application development :arrow_right: with Kubernetes.
https://gefyra.dev
Apache License 2.0
689 stars 28 forks source link

Gefyra connect not working when running from container-based IDE. #698

Open Schille opened 1 month ago

Schille commented 1 month ago

What happened?

When running container-based dev IDEs (such as DevPod), Gefyra cannot successfully connect. Due to the fact, that the Wireguard credentials (pulled from the cluster via SA-token/K8s API) are located within the container of the IDE and the container-host (i.e. Docker-host) is outside, the following mount cannot execute successfully:

https://github.com/gefyrahq/gefyra/blob/b9e8b8011cfed47588ceb033d525fdac02a41dad/client/gefyra/api/connect.py#L188

Idea: Instead of a bind-mound, we can create a dedicated volume filled with the Wireguard credentials from within the IDE container and mount it onto Gefyra Cargo this way. This should be a portable solution that works for usual host-based Gefyra and container-based dev environments.

What did you expect to happen?

Gefyra to connect successfully.

Please provide the output of gefyra check.

n/a

How can we reproduce it (as minimally and precisely as possible)?

1.) Create a container (for example Ubuntu), mount the Docker socket into it 2.) Install Gefyra in the container 3.) Try connecting to a Gefyra cluster (running Gefyra from within the container from 1.)

What Kubernetes setup are you working with?

```console $ kubectl version # paste output here ```

OS version

```console # On Linux: $ cat /etc/os-release # paste output here $ uname -a # paste output here # On Windows: C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture # paste output here ```

Anything else we need to know?

No response