argo-cd/resource_customizations/acid.zalan.do/postgresql/health.lua
rezellme 19d85aa9fb
feat(health): Adding more health checks for Keycloak, Postgres, Grafana, SolrCloud (#20294)
* feat(health): Add healtchcheck for acid.zalan.do/postgresql

Signed-off-by: Remo Zellmer <rze@vizrt.com>

* feat(health): Add healthcheck for grafana.integreatly.org/Grafana and GrafanaDatasource

Signed-off-by: Remo Zellmer <rze@vizrt.com>

* feat(health): Add healthcheck for k8s.keycloak.org/Keycloak

Signed-off-by: Remo Zellmer <rze@vizrt.com>

* feat(health): Add healthcheck for solr.apache.org/SolrCloud

Signed-off-by: Remo Zellmer <rze@vizrt.com>

---------

Signed-off-by: Remo Zellmer <rze@vizrt.com>
2024-10-09 11:12:09 -04:00

30 lines
No EOL
871 B
Lua

-- Waiting for status info => Progressing
if obj.status == nil or obj.status.PostgresClusterStatus == nil then
return {
status = "Progressing",
message = "Waiting for postgres cluster status...",
}
end
-- Running => Healthy
if obj.status.PostgresClusterStatus == "Running" then
return {
status = "Healthy",
message = obj.status.PostgresClusterStatus,
}
end
-- Creating/Updating => Progressing
if obj.status.PostgresClusterStatus == "Creating" or obj.status.PostgresClusterStatus == "Updating" then
return {
status = "Progressing",
message = obj.status.PostgresClusterStatus,
}
end
-- CreateFailed/UpdateFailed/SyncFailed/Invalid/etc => Degraded
-- See https://github.com/zalando/postgres-operator/blob/0745ce7c/pkg/apis/acid.zalan.do/v1/const.go#L4-L13
return {
status = "Degraded",
message = obj.status.PostgresClusterStatus,
}