HealthCheck on helmRelease for customResource #5436
-
|
Hi All , We have a scenario in which helmchart deploys CustomResource (CR), lets say mddf and that mddf CR deploys pods. In case there is an issue with CR then it doesn't deploy respective pods. To handle this , we thought of adding healthCheck on helmrelease itself for this CR but it seems flux doesn't support helmrelease based healthchecks and only support in kustomization. Request you all to please suggest , how to handle this with flux so that healthcheck on CR could be added for the helmrelease and flux only considers it as passed if healthcheck is passed that means CR is in Passed state. Regards, |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
|
Is your Flux HelmRelease being deployed by a Flux Kustomization? If yes, you can use the Flux Kustomization field https://fluxcd.io/flux/components/kustomize/kustomizations/#health-checks https://fluxcd.io/flux/components/kustomize/kustomizations/#health-check-expressions https://fluxcd.io/flux/cheatsheets/cel-healthchecks/ Remember: And because it's the Helm chart that will deploy the CRs, you will have to list not only the CRs in |
Beta Was this translation helpful? Give feedback.
-
|
Hi @matheuscscp , I am not directly deploying HelmRelease with flux kustomization that is why unable to add healthcheck on kustomization. I have structure in which multiple helmReleases are grouped under single kustomization and if I put helmthcheck under that then will become applicable for all helmreleases. Hence would appreciate if there can be any possible solution/way to handle this or should I wait until flux provides healthchecks directly for HelmRelease flux manifest |
Beta Was this translation helpful? Give feedback.
-
|
Somebody has already raised thsi as feature request - #5178 Hence I have not duplicated it. |
Beta Was this translation helpful? Give feedback.
-
|
Duplicate of #5178 |
Beta Was this translation helpful? Give feedback.
Is your Flux HelmRelease being deployed by a Flux Kustomization? If yes, you can use the Flux Kustomization field
spec.healthCheckExprsto write custom logic in CEL for assessing the health of each CR type, then usespec.healthChecksto list each object whose health must be assessed:https://fluxcd.io/flux/components/kustomize/kustomizations/#health-checks
https://fluxcd.io/flux/components/kustomize/kustomizations/#health-check-expressions
https://fluxcd.io/flux/cheatsheets/cel-healthchecks/
https://playcel.undistro.io/
Remember:
spec.healthChecksis for objects,spec.healthCheckExprsis for types.And because it's the Helm chart that will deploy the CRs, you will have to list not only th…