r/devops • • 22d ago

Discussion Running additional checks after automated code review

Can somebody give me some guidance please. After you've run code review, what's the easiest/fastest/best way to check the changes against information outside the repo? Say, whether a connection-pool change will fit within the production database 's connection limit across all replicas.

Where does the check happen in your workflow? CI, a deployment gate, or someone checking it manually? Have you found a useful way to automate it?

3 Upvotes

19 comments sorted by

View all comments

1

u/ymgymg 22d ago

If the replica count, pool size and DB max_connections all live in IaC or Helm values, you can make it a plain CI check. Render the manifests and fail the build if max replicas times pool size, plus extra pods during a rolling update (maxSurge), goes over max_connections minus a few reserved for admin and migrations. Conftest with a small Rego policy works for this, or a short script over the rendered YAML. Use the HPA maxReplicas, not the current count, since autoscaling is what usually breaks it. For drift you can't catch in CI, alert on connections used vs max_connections from the DB itself. A pooler like PgBouncer in front also takes most of the math away.

0

u/Pure-Hat-8663 22d ago

Thanks, this is helpful! Hadn't thought about the extra pods during rolling updates. When several services share the same db do you give each one a connection budget?