Coder Social home page Coder Social logo

Comments (5)

gustaff-weldon avatar gustaff-weldon commented on May 25, 2024 7

Btw, I'm experiencing very similar problem. The moment pod gets reshuffled or new deployment happens, the port forwarding dies and does not recover (even after 5 minutes), see below:

❯ sudo kubefwd svc -v --namespace postgresql -f metadata.name=postgresql
Password:
INFO[15:32:08]  _          _           __             _
INFO[15:32:08] | | ___   _| |__   ___ / _|_      ____| |
INFO[15:32:08] | |/ / | | | '_ \ / _ \ |_\ \ /\ / / _  |
INFO[15:32:08] |   <| |_| | |_) |  __/  _|\ V  V / (_| |
INFO[15:32:08] |_|\_\\__,_|_.__/ \___|_|   \_/\_/ \__,_|
INFO[15:32:08]
INFO[15:32:08] Version 1.22.4
INFO[15:32:08] https://github.com/txn2/kubefwd
INFO[15:32:08]
INFO[15:32:08] Press [Ctrl-C] to stop forwarding.
INFO[15:32:08] 'cat /etc/hosts' to see all host entries.
INFO[15:32:08] Loaded hosts file /etc/hosts
INFO[15:32:08] HostFile management: Original hosts backup already exists at /Users/kolo/hosts.original
INFO[15:32:08] Successfully connected context: docker-desktop
DEBU[15:32:08] Registry: Start forwarding service postgresql.postgresql.docker-desktop
DEBU[15:32:08] Resolving: postgresql to 127.1.27.1 (postgresql)
INFO[15:32:08] Port-Forward:       127.1.27.1 postgresql:5432 to pod postgresql-0:5432
ERRO[15:34:39] Runtime: an error occurred forwarding 5432 -> 5432: error forwarding port 5432 to pod c9a9c7e84ba15c880fd6ce333089cf1022519ba2ca890a44e7afd9172f1195da, uid : container not running (c9a9c7e84ba15c880fd6ce333089cf1022519ba2ca890a44e7afd9172f1195da)
ERRO[15:34:39] Runtime: lost connection to pod
WARN[15:34:39] Stopped forwarding pod postgresql-0 for postgresql.postgresql.docker-desktop
INFO[15:40:10] update service postgresql/postgresql.

from kubefwd.

gustaff-weldon avatar gustaff-weldon commented on May 25, 2024 2

@ndj888 this is a tool for local development isn't it?

When service gets redeployed in the cluster you're connected to, you want your local app to pick this up. 5 min delay makes reconnect virtually non-functional. For me, 5 seconds would be more appropriate as I want to focus on app I work on, and let kubefwd do its job :)

Idea: why not just make timeout a CLI option and let users decide what is best resource/delay combo?

from kubefwd.

ndj888 avatar ndj888 commented on May 25, 2024

@imdbere kubefwd checks the pod list every 5 minutes and will fix this automatically. I don't think it's necessary for kubefwd to monitor pod changes and react in real time, it will consume more resources. It is recommended to use kubefwd for local development environment. If stable access to pods inside the cluster is required, I recommend using a private load balancer for service exposure.

from kubefwd.

kikonen avatar kikonen commented on May 25, 2024

5 min delay in reconnecting effectively means that user must stop kubefwd and restart it, i.e. waiting 5 mins is long time to wait when trying to do some development work locally.

from kubefwd.

dobesv avatar dobesv commented on May 25, 2024

I've been having the same problem since I first started using kubefwd years ago, I have to restart it a lot. I even tried putting in a fix that was merged, but the issue resurfaced again later.

e.g. #153

from kubefwd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.