Skip to content

Allow an external controller to manage PgDog replicas - #166

Draft
kush-wisdom wants to merge 1 commit into
pgdogdev:mainfrom
kush-wisdom:codex/external-replica-management
Draft

kush-wisdom wants to merge 1 commit into
pgdogdev:mainfrom
kush-wisdom:codex/external-replica-management

Conversation

@kush-wisdom

@kush-wisdom kush-wisdom commented Nov 23, 2026 •

Copy link
Copy Markdown

An HPA writes to the workload's scale subresource. Helm currently renders a replica count on every release, so an upgrade can overwrite the count selected by the autoscaler.

This adds an opt-in externallyManagedReplicas value for both StatefulSets and Deployments. When enabled, Helm omits spec.replicas. Existing installations keep the configured count, including an explicit zero.

Validated with helm lint and renders for both workload kinds, covering fixed and externally managed replicas. The existing chart test suite now covers both cases.

In a disposable Kubernetes v1.36.1 cluster, an HPA raised the StatefulSet from two to three replicas. Two Helm v4.2 server-side upgrades followed, first enabling this option and then updating an annotation. A watch recorded no drop below three after the HPA rescaled. Kubernetes recorded the HPA controller as the sole owner of the replica field through the scale subresource.

@kush-wisdom
kush-wisdom marked this pull request as ready for review November 23, 2026 12:42
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T12:44:01.297359Z 7710df8 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@kush-wisdom
kush-wisdom marked this pull request as draft November 23, 2026 12:49

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant