Add in-place vertical scaling guide for Postgres#911
Conversation
Document the InPlace mode of the Postgres VerticalScaling OpsRequest: scaling CPU/memory of running Pods via the Kubernetes pods/resize subresource without recreating Pods or failing over the primary. Covers in-place vs restart, CPU scaling, memory increase with ResizeOnly (shared_buffers untouched, reloadable GUCs re-applied), eligibility and automatic fallback, and the autoscaler. Adds a short In-Place section to the vertical-scaling overview. Signed-off-by: Tamal Saha <tamal@appscode.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
✅ Files skipped from review due to trivial changes (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds a new in-place vertical scaling guide for PostgreSQL, with supporting Postgres and PostgresOpsRequest manifests. Updates the vertical scaling overview to describe ChangesIn-Place Vertical Scaling Postgres Documentation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/guides/postgres/scaling/vertical-scaling/in-place/index.md`:
- Line 13: The markdown in the guide uses non-descriptive link text (“here”),
which should be replaced to satisfy MD059 and improve navigation. Update the
links in the affected content so the anchor text clearly names the destination,
using descriptive labels such as “KubeDB getting started” and “KubeDB setup
guide” rather than generic text; apply the same change to both referenced links
in the document.
In `@docs/guides/postgres/scaling/vertical-scaling/in-place/yamls/postgres.yaml`:
- Around line 6-18: The sample cluster manifest in postgres.yaml is missing the
initial CPU and memory requests that the guide assumes later. Update the
manifest in the Postgres YAML sample, and the corresponding inline YAML snippet
if present, to explicitly set the starting resources used by the walkthrough
(including the values referenced by the vertical scaling steps), or otherwise
remove the hard-coded initial resource assumptions from the guide text. Use the
existing cluster spec structure around the storage and replica settings to place
the resources consistently.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 9c6267da-68bf-4ad4-8074-5b93a5004f29
📒 Files selected for processing (5)
docs/guides/postgres/scaling/vertical-scaling/in-place/index.mddocs/guides/postgres/scaling/vertical-scaling/in-place/yamls/pg-vertical-scaling-inplace-memory.yamldocs/guides/postgres/scaling/vertical-scaling/in-place/yamls/pg-vertical-scaling-inplace.yamldocs/guides/postgres/scaling/vertical-scaling/in-place/yamls/postgres.yamldocs/guides/postgres/scaling/vertical-scaling/overview/index.md
| section_menu_id: guides | ||
| --- | ||
|
|
||
| > New to KubeDB? Please start [here](/docs/README.md). |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Use descriptive link text instead of here.
Both links trip MD059 and are harder to navigate with screen readers or link lists. Rename them to the destination itself, e.g. KubeDB getting started and KubeDB setup guide.
Also applies to: 33-34
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)
[warning] 13-13: Link text should be descriptive
(MD059, descriptive-link-text)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/guides/postgres/scaling/vertical-scaling/in-place/index.md` at line 13,
The markdown in the guide uses non-descriptive link text (“here”), which should
be replaced to satisfy MD059 and improve navigation. Update the links in the
affected content so the anchor text clearly names the destination, using
descriptive labels such as “KubeDB getting started” and “KubeDB setup guide”
rather than generic text; apply the same change to both referenced links in the
document.
Source: Linters/SAST tools
| spec: | ||
| version: "13.13" | ||
| replicas: 3 | ||
| standbyMode: Hot | ||
| storageType: Durable | ||
| storage: | ||
| storageClassName: "standard" | ||
| accessModes: | ||
| - ReadWriteOnce | ||
| resources: | ||
| requests: | ||
| storage: 1Gi | ||
| deletionPolicy: WipeOut |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Pin the initial resources in the sample cluster manifest.
The guide later assumes this cluster starts with cpu: 500m and memory: 1Gi, but this YAML never sets them. That makes the walkthrough depend on operator defaults and can invalidate the later “keeps memory at 1Gi” claim. Please either declare those resources here (and in the inline YAML snippet) or stop hard-coding the initial values in the guide.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/guides/postgres/scaling/vertical-scaling/in-place/yamls/postgres.yaml`
around lines 6 - 18, The sample cluster manifest in postgres.yaml is missing the
initial CPU and memory requests that the guide assumes later. Update the
manifest in the Postgres YAML sample, and the corresponding inline YAML snippet
if present, to explicitly set the starting resources used by the walkthrough
(including the values referenced by the vertical scaling steps), or otherwise
remove the hard-coded initial resource assumptions from the guide text. Use the
existing cluster spec structure around the storage and replica settings to place
the resources consistently.
- Move mode/memoryPolicy under spec.verticalScaling (they are fields on PostgresVerticalScalingSpec, not the top-level OpsRequest spec) in all example YAMLs, inline blocks, and prose. - Enable spec.configuration.tuning on the example Postgres so the in-place memory increase actually re-applies the reloadable GUCs; show shared_buffers unchanged vs effective_cache_size updated, and link the pgtune guide. - Simplify the psql exec to the canonical `psql -U postgres -c` form. Signed-off-by: Tamal Saha <tamal@appscode.com>
What
Adds documentation for the InPlace mode of the Postgres
VerticalScalingOpsRequest.docs/guides/postgres/scaling/vertical-scaling/in-place/— in-place vs restart, deploying a 3-replica cluster, in-place CPU scaling (verified by unchanged Pod UID /restartCount/ primary role), in-place memory increase withmemoryPolicy: ResizeOnly(shared_buffersleft unchanged, reloadable GUCs re-applied live), eligibility and the automatic fallback table, and the autoscaler. Includes example YAMLs underyamls/.spec.modedefaults toRestart, so the docs make clear existing behavior is unchanged and that unsupported clusters fall back automatically.Related
Documents the feature implemented in kubedb/postgres#911, kubeops/petset#50, kubedb/apimachinery#1790, and kubedb/autoscaler#310.
Summary by CodeRabbit
New Features
Documentation