Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exits immediately when watching an empty namespace #132

Open
yuvipanda opened this issue Jun 27, 2020 · 4 comments
Open

Exits immediately when watching an empty namespace #132

yuvipanda opened this issue Jun 27, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@yuvipanda
Copy link

Awesome project, <3 it :)

When I run kubefwd svc -n new-namespace and new-namespace is empty, kubefwd exits immediately. However, I'm programmatically creating services there (via dask-kubernetes. So I'd like it to just stay and watch.

I can reproduce this with:

$ kubectl create ns test-empty-namespace
$ sudo kubefwd svc -n test-empty-namespace
INFO[12:26:30]  _          _           __             _
INFO[12:26:30] | | ___   _| |__   ___ / _|_      ____| |
INFO[12:26:30] | |/ / | | | '_ \ / _ \ |_\ \ /\ / / _  |
INFO[12:26:30] |   <| |_| | |_) |  __/  _|\ V  V / (_| |
INFO[12:26:30] |_|\_\\__,_|_.__/ \___|_|   \_/\_/ \__,_|
INFO[12:26:30]
INFO[12:26:30] Version 1.14.2
INFO[12:26:30] https://github.com/txn2/kubefwd
INFO[12:26:30]
INFO[12:26:30] Press [Ctrl-C] to stop forwarding.
INFO[12:26:30] 'cat /etc/hosts' to see all host entries.
INFO[12:26:30] Loaded hosts file /etc/hosts
INFO[12:26:30] Hostfile management: Original hosts backup already exists at /Users/yuvipanda/hosts.original
INFO[12:26:32] Succesfully connected context: gke_ucb-datahub-2018_us-central1_fall-2019
INFO[12:26:36] Done...

It works if there's already at least one ready service in the namespace - empty or headless services won't work.

I'm on MacOS, with kubefwd version 1.14.2

@cjimti cjimti added the enhancement New feature or request label Oct 27, 2020
@ndj888
Copy link
Contributor

ndj888 commented Sep 12, 2021

@yuvipanda I think using kubefwd for empty namespaces is meaningless. Because, kubefwd should not introduce a waiting mechanism, try to have the correct service in your namespace in the future.

@yuvipanda
Copy link
Author

@ndj888 thank you for the reply. I agree it's meaningless for namespaces that will remain empty. However, in this case, the goal is to programmatically create them as the user performs actions with dask. If they create a big cluster for about 30 minutes, that will create services for that time duration only. So it isn't an 'empty namespace' as much as an 'intermittently empty' namespace. A --wait or similar flag would be very helpful here.

@ndj888
Copy link
Contributor

ndj888 commented Sep 13, 2021

@yuvipanda @cjimti Using --wait may not be the best solution. In subsequent versions, I think kubefwd can provide a set of programmable APIs to register those namespaces controlled by code. What do you think, we can do it with gin .

@ndj888
Copy link
Contributor

ndj888 commented Sep 15, 2021

@cjimti In the next version, can we provide restful api using gin? This uses kubefwd in more usage scenarios, looking forward to yours. Yes, I have time to join the team and expand kubefwd for more opportunities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants