8000 Feature request: wait for resources to exist. · Issue #8 · iNecas/kube-health · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Feature request: wait for resources to exist. #8

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

Open
alanconway opened this issue Apr 10, 2025 · 3 comments
Open

Feature request: wait for resources to exist. #8

alanconway opened this issue Apr 10, 2025 · 3 comments

Comments

@alanconway
Copy link

Use case: I delete a resource to force it to be re-created by an operator.
I want to use kube-health to wait until the resource is re-created and progresses to a healthy state.

Current behavior: kube-health -O with a non-existent resource name returns immediately.
When called immediately after kubectl delete it usually does not wait because the resource does not yet exist, as there is an unpredicatble delay until the operator re-creates it.

Desired behavior: with waiting flags (-W or -O) kube-health first waits for the resource to exist, then waits for it to progress.

Backwards compatibility: add --ignore-not-found flag to return immediately with no error if resource not found (current behavior).
This is consistent with the meaning of --ignore-not-found as used by kubectl.

@iNecas
Copy link
Owner
iNecas commented Apr 14, 2025

Could you provide the specific script that would reproduce this issue? I think it makes sense, but not sure I exactly understand the mechanism that causes kube-health to not wait properly.

@alanconway
Copy link
Author
alanconway commented May 7, 2025
oc delete deployment/foo; kube-health -W deployment/foo

I'm expecting deployment/foo to be re-created by an operator and I want to wait till it exists and is healthy. However kube-health will exit immediately if the deployment does not exist. So I want to add "wait-for-exists" before the health check.

Perhaps a better API:

  • leave -W and -O as they are.
  • Add "-E" to wait until at least one selected resource exists before starting the health check wait.

That would give the extra feature of being able to wait just for existence by using -E on its own.
Also I think separating "wait for exists" from "wait for healthy" would simplify the implementation.

@iNecas
Copy link
Owner
iNecas commented May 13, 2025

The less flags the better, having there some grace period, especially when waiting for the state, is a good idea IMO

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

No branches or pull requests

2 participants
0