-
Notifications
You must be signed in to change notification settings - Fork 181
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
Kustomization marked as ready when health check resource is not ready #387
Comments
A little more context: Since HelmRelease is not one of the explicitly supported types of kstatus, kstatus applies generic rules (see here for details). Since the HelmRelease in question does not have a status field set, yet (because the helm-controller hasn't touched it, yet), kstatus cannot know the status and infers a |
The problem essentially boils down to the Wondering if one way to "work around" this would be to use a mutating (admission) webhook that always sets this condition ( |
We could set a default value in the CRD for observed generation to something like -1. |
This resolves an issue with kustomize-controller marking a Kustomization as healthy even when the helm-controller hasn't even looked at the HelmRelease targeted by the Kustomization's healthChecks, yet. Setting `observedGeneration` to -1 by default will cause kstatus to report a status of `InProgress` instead of `Ready`. see fluxcd/kustomize-controller#387 for details on the issues this is solving. Signed-off-by: Max Jonas Werner <[email protected]>
That's a great solution. I issued a PR on the helm-controller repo. |
This resolves an issue with kustomize-controller marking a Kustomization as healthy even when the helm-controller hasn't even looked at the HelmRelease targeted by the Kustomization's healthChecks, yet. Setting `observedGeneration` to -1 by default will cause kstatus to report a status of `InProgress` instead of `Ready`. see fluxcd/kustomize-controller#387 for details on the issues this is solving. Signed-off-by: Max Jonas Werner <[email protected]>
This resolves an issue with kustomize-controller marking a Kustomization as healthy even when the helm-controller hasn't even looked at the HelmRelease targeted by the Kustomization's healthChecks, yet. Setting `observedGeneration` to -1 by default will cause kstatus to report a status of `InProgress` instead of `Ready`. see fluxcd/kustomize-controller#387 for details on the issues this is solving. Signed-off-by: Max Jonas Werner <[email protected]>
This resolves an issue with kustomize-controller marking a Kustomization as healthy even when the helm-controller hasn't even looked at the HelmRelease targeted by the Kustomization's healthChecks, yet. Setting `observedGeneration` to -1 by default will cause kstatus to report a status of `InProgress` instead of `Ready`. see fluxcd/kustomize-controller#387 for details on the issues this is solving. Signed-off-by: Max Jonas Werner <[email protected]>
Is this considered complete now that helm-controller fix for observed generation is released or is there more to do? |
It would be wise to make the same patch to all our controllers that have an |
I'll do that on Monday if that's ok for you!? |
Would be splendid @makkes, thanks 😊 |
|
@makkes is there anything left or can we close this? |
If we want to apply the setting of -1 in the observedGeneration to every Flux CRD, then we still need to patch
The immediate issue is resolved, though so I created a follow-up issue and will close this one. |
It seems like this is going to be a problem for every CRD, and possible some other built-in types that don't get special treatment by kstatus. Could it be better addressed upstream? E.g., by kstatus treating |
I understand this better now, having gone to look at the kstatus code. My suggestion above won't help, because |
Thanks for looking into this more closely, @squaremo. I also spent a considerable amount wading through kstatus code last year and still believe this should eventually be fixed upstream. I'll see if there's anything we can do about it as IMHO the solution we came up with here of setting observedGeneration to -1 by default feels hacky. |
I'm observing kustomize-controller marking a Kustomization resources as
Ready
under the following circumstances:any
HelmRelease so that it has no status field. This is easy to reproduce by scaling the helm-controller deployment down to 0 replicas.I've seen this happen on cluster with heavy load so that the helm-controller hasn't started reconciling the
any
HelmRelease, yet.The reason for this is that kstatus reports the HelmRelease as Current, even though it is actually not.
This is problematic in the case where other Kustomizations depend on a Kustomization that has health checks for resources that expose a proper kstatus-compatible API (like status field, observedGeneration etc.) because the dependencies would be applied even though the health checks for the original Kustomization they depend on would get un-ready at a later stage (e.g. due to the HelmRelease not being ready, yet).
The text was updated successfully, but these errors were encountered: