gefyrahq / gefyra

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

Stopping stale cargo container kills ubuntu desktop UI #364

Closed schwobaseggl closed 6 months ago

schwobaseggl commented 1 year ago

What happened?

K3d cluster stopped and deleted without gefyra down. That leaves a dangling gefyra-cargo docker container. Stopping that container killed my system's (ubuntu 20.04 LTS amd) desktop interface and logged me out.

What did you expect to happen?

For the container to just stop so it can be removed without any side effects on the host system.

Please provide the output of gefyra check.

Gefyra check does not terminate (within the limits of my patience) if the cluster of the current context is not running (maybe an issue in itself). Once the context is set to some other cluster, the output is:

[INFO] Docker: Ok
[INFO] Kubernetes: Ok

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

  1. Start k3d cluster
  2. gefyra up
  3. Delete k3d cluster
  4. docker stop gefyra-cargo

What Kubernetes setup are you working with?

```console $ kubectl version # paste output here Client Version: v1.24.1 Kustomize Version: v4.5.4 ```

OS version

```console # On Linux: $ cat /etc/os-release # paste output here $ uname -a # paste output here Linux XXXX-ThinkPad-T480 5.15.0-67-generic #74~20.04.1-Ubuntu SMP Wed Feb 22 14:52:34 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux # On Windows: C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture # paste output here ```

Anything else we need to know?

-

SteinRobert commented 1 year ago

Do you have any idea how this could be related to Gefyra itself? From what I see docker stop is causing the issue.

SteinRobert commented 1 year ago

So what I notice on Mac is that the docker daemon seems to become unavailable when using docker stop on a stale cargo.

Cannot connect to the Docker daemon at unix:///Users/robertstein/.colima/default/docker.sock. Is the docker daemon running?
VanWolf29 commented 1 year ago

@SteinRobert I'm implementing Gefyra with some co-workers and we're also experiencing some issues. This doesn't seem to be with Gefyra directly but I think it has to do something with it regarding to the process involved during gefyra down.

I'm trying to allow multiple Developers into an EKS cluster to use Gefyra, but I do not want to "allow" them to uninstall Gefyra Operator from the cluster. So stopping the cargo container was the way to go but it's causing plenty issues:

I'd like to have a way to stop gefyra without uninstalling it from the cluster. This will also allow multiple users at the same time. Maybe adding support and a command gefyra stop to gracefully stop the local cargo container would fix this behavior.

Also is important to note that this never happens when cargo container is stopped using gefyra down.

P.S. I'm willing to contribute to this project/issue.

SteinRobert commented 1 year ago

@VanWolf29 this is amazing feedback - especially the symptoms of docker stop on all the different operating systems! Thank you so much for the detailed description! We're currently working on making Gefyra Multipeer (https://github.com/gefyrahq/gefyra/issues/353). https://github.com/gefyrahq/gefyra/pull/404

This is essentially a big refactoring of the whole project:

I believe this will solve exactly your use case. Multiple users will be able to connect to a cluster with limited permissions. Furthermore bridges for multiple concurrent users will be possible for the first time! As soon as we have a stable alpha release we will update this thread to let you know.

SteinRobert commented 6 months ago

This is a bit late - however gefyra v2 is out and the mentioned features have been implemented :) Users now connect via a Gefyra client file which limits their permissions.