Repository navigation
Closed
Labels
area/databaseIssues or PRs related to managed databases (postgres, mariadb, redis, etcd, kafka, clickhouse)Issues or PRs related to managed databases (postgres, mariadb, redis, etcd, kafka, clickhouse)kind/featureCategorizes issue or PR as related to a new featureCategorizes issue or PR as related to a new featuretriage/needs-triageIndicates an issue needs triage by a maintainerIndicates an issue needs triage by a maintainer
Description
Non-blocking review remarks carried over from the approved review of #3954 (postgres read-replica autoscaling via KEDA). #3954 is LGTM and merge-ready; these are craft-level follow-ups tracked here so they land in a separate PR rather than blocking the feature. File:line anchors are against the #3954 head.
To fix (small, safe, testable)
- [MINOR]
packages/apps/postgres/templates/_autoscaling.tpl— the read-load trigger query joins onkube_pod_labels{...}without pinningjob="kube-state-metrics", while the sibling alert rules inpackages/system/keda/templates/alerts.yamldo pin it. A second exporter emittingkube_pod_labels(or a duplicate series) would multiply the join. Pin the job on everykube_pod_labelsselector in the query for parity with the alerts. - [MINOR]
packages/apps/postgres/templates/scaledobject.yaml— the KEDA-missing fail-closed guard's rationale comment still describes the replaced "db.yaml drops the static.spec.instances" design; the shipped design SEEDSspec.instancesatmax(replicas, effectiveMin). Update the comment to the seed rationale so it matches the code. - [MINOR]
packages/library/cozy-lib/templates/_keda.tpl—cozy-lib.keda.scaledObjectaccepts negativeminReplicaCount/maxReplicaCount(only themin <= maxordering is checked). Unreachable from the postgres caller today, but the helper is engine-agnostic and will gain callers; add a lower-bound guard (< 0fails) plus a unit case. - [MINOR]
packages/library/cozy-lib/templates/_keda.tpl— theannotationshelper parameter has no caller and no test. Add acozy-lib-testscase exercising it (extra annotations merged under the pause pair) so the documented parameter is covered. - [docs] release note / field docs — the "every Postgres release now applies client-side" phrasing overstates the rollout. The HelmReconciler propagates only chartRef/valuesFrom/labels onto existing HelmReleases, so a release flips to client-side apply only when its Application is next written through the aggregated API, i.e. per-app over time, not fleet-wide at upgrade. Correct the wording where it appears.
Deferred (by design / needs upstream change — tracked, not scheduled here)
- [MINOR]
api/apps/v1alpha1/postgresql/types.go— the four autoscaling ints carry no+kubebuilder:validation:Minimum. Render-time guards inscaledobject.yamlreject the dangerous cases today; CRD-level bounds are not emittable becausetypes.go/values.schema.jsonare generated by cozyvalues-gen fromvalues.yaml, which has nominimum/CEL directive. Closing this needs a cozyvalues-gen enhancement, out of scope for the follow-up PR. - [by-design]
packages/system/keda/templates/alerts.yaml— the twoDatabaseAutoscaler*alerts match every KEDA-managed HPA/ScaledObject, not only database ones, because the underlying series carry no owning-app label. Correct today since database autoscaling is KEDA's sole consumer in cozystack (acknowledged in the alert file header). Scope the rules by a label the DB objects carry if a non-database ScaledObject is ever added.
Follow-up PR stacks on #3954 and will be opened against main once #3954 merges.
Reacted by dosubot
Metadata
Metadata
Assignees
Labels
area/databaseIssues or PRs related to managed databases (postgres, mariadb, redis, etcd, kafka, clickhouse)Issues or PRs related to managed databases (postgres, mariadb, redis, etcd, kafka, clickhouse)kind/featureCategorizes issue or PR as related to a new featureCategorizes issue or PR as related to a new featuretriage/needs-triageIndicates an issue needs triage by a maintainerIndicates an issue needs triage by a maintainer
Activity
fix(postgres): follow-up review remarks from #3954 (KEDA autoscaling) (…
fix(postgres): pin job=kube-state-metrics on the autoscaler read-load…
fix(cozy-lib): reject a negative minReplicaCount and cover the annota…
docs(postgres): correct the KEDA-guard rationale and note the gradual…