ArgoCD "custom health check"
Anyone else using ArgoCD to deploy this operator?
I'd like to suggest we create an ArgoCD "Custom Health Check" for this operator.
Read more about what that is here: https://argo-cd.readthedocs.io/en/stable/operator-manual/health/
And here's how to add one: https://argo-cd.readthedocs.io/en/stable/operator-manual/health/#way-2-contribute-a-custom-health-check
Essentially something like this:
$ cd github.com/argoproj/argo-cd
$ cat resource_customizations/acid.zalan.do/postgresql/health.lua
hs = {}
if obj.status == nil or obj.status.PostgresClusterStatus == nil then
hs.status = "Progressing"
hs.message = "Waiting for postgres cluster status..."
return hs
end
if obj.status.PostgresClusterStatus == "Running" then
hs.status = "Healthy"
hs.message = obj.status.PostgresClusterStatus
return hs
end
if obj.status.PostgresClusterStatus == "Creating" or obj.status.PostgresClusterStatus == "Updating" then
hs.status = "Progressing"
hs.message = obj.status.PostgresClusterStatus
return hs
end
-- CreateFailed/UpdateFailed/SyncFailed/Invalid/etc
-- See: https://github.com/zalando/postgres-operator/blob/0745ce7cce63ab6431103d27eb08e54ec47d2b15/pkg/apis/acid.zalan.do/v1/const.go#L4-L13
hs.status = "Degraded"
hs.message = obj.status.PostgresClusterStatus
return hs
How to show the resources created by the operator?
- @MPV, how can I show the StatefulSets and Services associated with the Database?
- ArgoCD is just showing the
postgrescrd...
- ArgoCD is just showing the

How to show the resources created by the operator?
how can I show the StatefulSets and Services associated with the Database?
- ArgoCD is just showing the
postgrescrd...
@marcellodesales https://github.com/zalando/postgres-operator/issues/498 is required for those resources to show up (as they’re not created by ArgoCD but by the operator — ArgoCD requires this owner reference link to understand that they are related).
@MPV
According to https://github.com/zalando/postgres-operator/issues/1766#issuecomment-1028168636, we just need to add labels... (See Argo's latest discussion on the thread)... thank you!
Anyone else using ArgoCD to deploy this operator?
I'd like to suggest we create an ArgoCD "Custom Health Check" for this operator.
Read more about what that is here: https://argo-cd.readthedocs.io/en/stable/operator-manual/health/
And here's how to add one: https://argo-cd.readthedocs.io/en/stable/operator-manual/health/#way-2-contribute-a-custom-health-check
Essentially something like this:
$ cd github.com/argoproj/argo-cd $ cat resource_customizations/acid.zalan.do/postgresql/health.lua hs = {} if obj.status == nil or obj.status.PostgresClusterStatus == nil then hs.status = "Progressing" hs.message = "Waiting for postgres cluster status..." return hs end if obj.status.PostgresClusterStatus == "Running" then hs.status = "Healthy" hs.message = obj.status.PostgresClusterStatus return hs end if obj.status.PostgresClusterStatus == "Creating" or obj.status.PostgresClusterStatus == "Updating" then hs.status = "Progressing" hs.message = obj.status.PostgresClusterStatus return hs end -- CreateFailed/UpdateFailed/SyncFailed/Invalid/etc -- See: https://github.com/zalando/postgres-operator/blob/0745ce7cce63ab6431103d27eb08e54ec47d2b15/pkg/apis/acid.zalan.do/v1/const.go#L4-L13 hs.status = "Degraded" hs.message = obj.status.PostgresClusterStatus return hs
Are there any plans to provide this health check to argo-cd?