Skip to content

Add PostgreSQL extensions guide and modernize streaming replication docs#1032

Merged
souravbiswassanto merged 4 commits into
masterfrom
extension-streaming
Jul 15, 2026
Merged

Add PostgreSQL extensions guide and modernize streaming replication docs#1032
souravbiswassanto merged 4 commits into
masterfrom
extension-streaming

Conversation

@souravbiswassanto

@souravbiswassanto souravbiswassanto commented Jul 14, 2026

Copy link
Copy Markdown
Member

Summary

Two PostgreSQL documentation additions/updates. Every command and output in both guides was captured
live from a running KubeDB cluster (v2026.7.10).

1. New guide: PostgreSQL Extensions

docs/guides/postgres/custom-versions/extensions.md

Documents the extension-enabled (-ext) PostgresVersions:

  • Which extensions ship in every -ext image: pgvector, PostGIS, pg_repack, pg_cron, pgaudit, pg_stat_statements.
  • A table showing which extensions require shared_preload_libraries (pg_cron, pgaudit, pg_stat_statements) vs. which just need CREATE EXTENSION (pgvector, PostGIS, pg_repack) — so users can enable only what they need and skip the config Secret entirely when it isn't required.
  • Per-extension usage walkthroughs with real output (vector KNN, PostGIS distance, pg_cron job, pgaudit audit-log lines, pg_stat_statements, pg_repack).
  • Availability: notes the -ext versions ship from KubeDB v2026.7.10, and shows how to create the PostgresVersions by hand on earlier releases (copy an existing same-version PostgresVersion and change spec.db.image).
  • Ships ready-made sample manifests for all six -ext versions under docs/examples/postgres/extensions/.

2. Rewrite: Streaming Replication

docs/guides/postgres/clustering/streaming_replication.md

  • Fixes stale content (PG 10.2, recovery.conf, pg_last_xlog_receive_location(), the role=replica label, *-replicas service) with the current reality (role=standby, *-standby/*-pods services, pg_last_wal_receive_lsn()).
  • Documents the new spec.synchronousReplicationConfig API (mode, numSyncReplicas, commitLevel, standbyNames, useWildcard) with live quorum / priority / wildcard examples, a commitLevelsynchronous_commit mapping, and a note that commitLevel: On/Off must be quoted in YAML.
  • Availability note: KubeDB v2026.7.10+ and postgres-init >= 0.20.0.
  • Adds docs/examples/postgres/clustering/sync-postgres.yaml.

Verification

  • Extensions guide: deployed pg-extensions (18.3-ext), created all six extensions, ran every query shown, validated all six sample PostgresVersion manifests against the API server.
  • Streaming guide: deployed a 3-node async cluster (failover → new primary in ~14s) and a 3-node synchronous cluster; captured ANY 2 (...), FIRST 1 (...) with sync/potential, and ANY 1 (*); confirmed hot-standby read-only behaviour.

Summary by CodeRabbit

  • New Features
    • Added Kubernetes example manifests for synchronous PostgreSQL replication with hot standby, including warm/hot standby behavior and durable storage.
    • Added extension-enabled PostgreSQL examples plus PostgresVersion catalog entries for versions 16.13, 17.9, and 18.3, along with an extension preload configuration.
  • Documentation
    • Reworked the streaming replication guide into mode-based asynchronous/synchronous instructions, updated failover/service behavior, and expanded synchronous configuration examples and gotchas.
    • Added a comprehensive guide for using bundled PostgreSQL extensions (installation, verification, and common workflows).

- Add guides/postgres/custom-versions/extensions.md documenting the
  extension-enabled (-ext) PostgresVersions: which extensions are bundled
  (pgvector, PostGIS, pg_repack, pg_cron, pgaudit, pg_stat_statements), how to
  enable only the ones you need via shared_preload_libraries, and how to create
  the PostgresVersions by hand on KubeDB releases older than v2026.7.10. Ships
  sample PostgresVersion manifests for all six -ext versions.

- Rewrite guides/postgres/clustering/streaming_replication.md with current
  behaviour (role label 'standby', *-standby / *-pods services, modern WAL
  functions) and document the new spec.synchronousReplicationConfig API
  (mode, numSyncReplicas, commitLevel, standbyNames, useWildcard) with quorum,
  priority and wildcard examples. Add clustering/sync-postgres.yaml example.

All commands and outputs were captured live from a running cluster.

Signed-off-by: souravbiswassanto <saurov@appscode.com>
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e95a5fe0-4ffc-4daf-b740-51615ea927c9

📥 Commits

Reviewing files that changed from the base of the PR and between cc659c0 and 4861ae1.

📒 Files selected for processing (1)
  • docs/guides/postgres/clustering/streaming_replication.md
💤 Files with no reviewable changes (1)
  • docs/guides/postgres/clustering/streaming_replication.md

📝 Walkthrough

Walkthrough

Adds streaming and synchronous replication documentation with a matching example, and introduces extension-enabled PostgreSQL catalog manifests, deployment examples, and an end-to-end extensions guide.

Changes

Streaming replication

Layer / File(s) Summary
Replication modes and asynchronous walkthrough
docs/guides/postgres/clustering/streaming_replication.md
Documents asynchronous and synchronous modes, role-based services, replication status, and automatic failover.
Synchronous replication configuration
docs/examples/postgres/clustering/sync-postgres.yaml, docs/guides/postgres/clustering/streaming_replication.md
Adds a synchronous replication manifest and documents quorum, priority, wildcard, commit-level, and failover configurations.
Standby behavior and cleanup
docs/guides/postgres/clustering/streaming_replication.md
Updates warm/hot standby behavior, cleanup commands, and next steps.

PostgreSQL extensions

Layer / File(s) Summary
Extension-enabled version catalogs
docs/examples/postgres/extensions/postgresversion-*.yaml
Adds PostgreSQL 16, 17, and 18 extension-enabled catalog resources with images, task mappings, security settings, UI components, and update constraints.
Extension deployment examples
docs/examples/postgres/extensions/pg-extensions-config.yaml, docs/examples/postgres/extensions/pg-extensions.yaml
Adds the preload configuration Secret and a Postgres resource using an extension-enabled version.
Extension guide setup and validation
docs/guides/postgres/custom-versions/extensions.md
Adds prerequisites, bundled extension details, Secret configuration, deployment instructions, readiness checks, and preload validation.
Extension usage and compatibility
docs/guides/postgres/custom-versions/extensions.md
Documents extension creation and usage, older-release compatibility, cleanup, and next steps.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • kubedb/docs#951: Updates the same streaming replication guide’s commands and service examples.

Suggested reviewers: kodiak-appscode

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the two main documentation changes: a PostgreSQL extensions guide and updated streaming replication docs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch extension-streaming
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch extension-streaming

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Nitpick comments (1)
docs/guides/postgres/clustering/streaming_replication.md (1)

35-36: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use descriptive link text.

The link text "here" is not descriptive, which violates accessibility best practices and triggers the MD059 markdownlint rule. Consider using a more descriptive phrase.

♻️ Proposed fix
-Now, install KubeDB cli on your workstation and KubeDB operator in your cluster following the steps
-[here](/docs/setup/README.md).
+Now, install KubeDB cli on your workstation and KubeDB operator in your cluster following the
+[installation steps](/docs/setup/README.md).
🤖 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/clustering/streaming_replication.md` around lines 35 -
36, Replace the non-descriptive “here” link text in the KubeDB installation
instructions with a phrase that clearly identifies the linked setup
documentation, while preserving the existing destination and sentence meaning.

Source: Linters/SAST tools

🤖 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/examples/postgres/extensions/postgresversion-18.3-bookworm-ext.yaml`:
- Around line 39-42: Add the missing stash configuration before the ui field in
docs/examples/postgres/extensions/postgresversion-18.3-bookworm-ext.yaml lines
39-42 and docs/examples/postgres/extensions/postgresversion-18.3-ext.yaml lines
39-42, matching the existing 16.13 and 17.9 manifests and referencing the 18.2
backup and restore tasks.

In `@docs/guides/postgres/clustering/streaming_replication.md`:
- Around line 420-421: Remove the dangling triple-backtick marker at the end of
the streaming replication guide so the document does not open an unclosed
Markdown code block and passes MD040.

In `@docs/guides/postgres/custom-versions/extensions.md`:
- Line 13: Replace the ambiguous “here” link text at
docs/guides/postgres/custom-versions/extensions.md:13 with descriptive text
identifying the KubeDB documentation homepage, and update the link at
docs/guides/postgres/custom-versions/extensions.md:43 to identify the KubeDB
installation guide; preserve both existing link destinations.
- Line 412: Remove the unmatched code fence after the “Next Steps” list in the
documentation file, unless omitted content was intended; in that case, add the
corresponding closing fence and restore the content. Ensure the page’s remaining
text renders as normal Markdown.
- Around line 385-389: Specify the text language on the fenced block containing
the PostgreSQL version filenames by adding the text fence marker, or remove the
fence while preserving the displayed content.

---

Nitpick comments:
In `@docs/guides/postgres/clustering/streaming_replication.md`:
- Around line 35-36: Replace the non-descriptive “here” link text in the KubeDB
installation instructions with a phrase that clearly identifies the linked setup
documentation, while preserving the existing destination and sentence meaning.
🪄 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: c2e18311-f6ef-442e-b2f6-42230af85745

📥 Commits

Reviewing files that changed from the base of the PR and between 72e2130 and cc659c0.

📒 Files selected for processing (11)
  • docs/examples/postgres/clustering/sync-postgres.yaml
  • docs/examples/postgres/extensions/pg-extensions-config.yaml
  • docs/examples/postgres/extensions/pg-extensions.yaml
  • docs/examples/postgres/extensions/postgresversion-16.13-bookworm-ext.yaml
  • docs/examples/postgres/extensions/postgresversion-16.13-ext.yaml
  • docs/examples/postgres/extensions/postgresversion-17.9-bookworm-ext.yaml
  • docs/examples/postgres/extensions/postgresversion-17.9-ext.yaml
  • docs/examples/postgres/extensions/postgresversion-18.3-bookworm-ext.yaml
  • docs/examples/postgres/extensions/postgresversion-18.3-ext.yaml
  • docs/guides/postgres/clustering/streaming_replication.md
  • docs/guides/postgres/custom-versions/extensions.md

Comment on lines +39 to +42
securityContext:
runAsAnyNonRoot: true
runAsUser: 999
ui:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Missing stash configuration block.

Unlike the 16.13 and 17.9 extension-enabled PostgresVersion manifests, both 18.3 manifests omit the stash block entirely. This omission will break Stash backup and restore integrations for this PostgreSQL version.

  • docs/examples/postgres/extensions/postgresversion-18.3-bookworm-ext.yaml#L39-L42: Insert the stash configuration block before the ui field, referencing the 18.2 backup and restore tasks to match the archiver version.
  • docs/examples/postgres/extensions/postgresversion-18.3-ext.yaml#L39-L42: Insert the same stash configuration block before the ui field.
🐛 Proposed addition (for both files)
   securityContext:
     runAsAnyNonRoot: true # or false depending on the baseOS
     runAsUser: 999        # or 70 depending on the baseOS
+  stash:
+    addon:
+      backupTask:
+        name: postgres-backup-18.2
+      restoreTask:
+        name: postgres-restore-18.2
   ui:
   - name: pgadmin
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
securityContext:
runAsAnyNonRoot: true
runAsUser: 999
ui:
securityContext:
runAsAnyNonRoot: true
runAsUser: 999
stash:
addon:
backupTask:
name: postgres-backup-18.2
restoreTask:
name: postgres-restore-18.2
ui:
📍 Affects 2 files
  • docs/examples/postgres/extensions/postgresversion-18.3-bookworm-ext.yaml#L39-L42 (this comment)
  • docs/examples/postgres/extensions/postgresversion-18.3-ext.yaml#L39-L42
🤖 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/examples/postgres/extensions/postgresversion-18.3-bookworm-ext.yaml`
around lines 39 - 42, Add the missing stash configuration before the ui field in
docs/examples/postgres/extensions/postgresversion-18.3-bookworm-ext.yaml lines
39-42 and docs/examples/postgres/extensions/postgresversion-18.3-ext.yaml lines
39-42, matching the existing 16.13 and 17.9 manifests and referencing the 18.2
backup and restore tasks.

Comment thread docs/guides/postgres/clustering/streaming_replication.md Outdated
section_menu_id: guides
---

> New to KubeDB? Please start [here](/docs/README.md).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Make setup links descriptive. Both links currently use “here”, which is ambiguous for screen-reader and skim navigation.

  • docs/guides/postgres/custom-versions/extensions.md#L13-L13: use descriptive text such as “the KubeDB documentation homepage”.
  • docs/guides/postgres/custom-versions/extensions.md#L43-L43: use descriptive text such as “the KubeDB installation guide”.
🧰 Tools
🪛 markdownlint-cli2 (0.23.0)

[warning] 13-13: Link text should be descriptive

(MD059, descriptive-link-text)

📍 Affects 1 file
  • docs/guides/postgres/custom-versions/extensions.md#L13-L13 (this comment)
  • docs/guides/postgres/custom-versions/extensions.md#L43-L43
🤖 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/custom-versions/extensions.md` at line 13, Replace the
ambiguous “here” link text at
docs/guides/postgres/custom-versions/extensions.md:13 with descriptive text
identifying the KubeDB documentation homepage, and update the link at
docs/guides/postgres/custom-versions/extensions.md:43 to identify the KubeDB
installation guide; preserve both existing link destinations.

Source: Linters/SAST tools

Comment on lines +385 to +389
```
postgresversion-16.13-ext.yaml postgresversion-16.13-bookworm-ext.yaml
postgresversion-17.9-ext.yaml postgresversion-17.9-bookworm-ext.yaml
postgresversion-18.3-ext.yaml postgresversion-18.3-bookworm-ext.yaml
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Specify the language for this fenced block.

Use text (or remove the fence) so Markdown linting and rendering remain deterministic.

Suggested fix
-```
+```text
 postgresversion-16.13-ext.yaml            postgresversion-16.13-bookworm-ext.yaml
 ...
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
```
postgresversion-16.13-ext.yaml postgresversion-16.13-bookworm-ext.yaml
postgresversion-17.9-ext.yaml postgresversion-17.9-bookworm-ext.yaml
postgresversion-18.3-ext.yaml postgresversion-18.3-bookworm-ext.yaml
```
🧰 Tools
🪛 markdownlint-cli2 (0.23.0)

[warning] 385-385: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 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/custom-versions/extensions.md` around lines 385 - 389,
Specify the text language on the fenced block containing the PostgreSQL version
filenames by adding the text fence marker, or remove the fence while preserving
the displayed content.

Source: Linters/SAST tools

- Monitor your PostgreSQL database with KubeDB using [built-in Prometheus](/docs/guides/postgres/monitoring/using-builtin-prometheus.md).
- Detail concepts of [PostgresVersion object](/docs/guides/postgres/concepts/catalog.md).
- Want to hack on KubeDB? Check our [contribution guidelines](/docs/CONTRIBUTING.md).
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Remove the unmatched code fence at end of file.

This fence opens a code block after the “Next Steps” list and has no closing fence, which can cause the remainder of the page to render as code. Delete it, or add the intended closing fence if content was accidentally omitted.

🧰 Tools
🪛 markdownlint-cli2 (0.23.0)

[warning] 412-412: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 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/custom-versions/extensions.md` at line 412, Remove the
unmatched code fence after the “Next Steps” list in the documentation file,
unless omitted content was intended; in that case, add the corresponding closing
fence and restore the content. Ensure the page’s remaining text renders as
normal Markdown.

Source: Linters/SAST tools

@github-actions

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit 57ee117):

https://kubedb-v2-hugo--pr1032-extension-streaming-nzghyvqw.web.app

(expires Wed, 22 Jul 2026 05:48:49 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 0f29ae8ae0bd54a99bf2b223b6833be47acd5943

@souravbiswassanto souravbiswassanto merged commit 2e207d5 into master Jul 15, 2026
7 of 8 checks passed
@souravbiswassanto souravbiswassanto deleted the extension-streaming branch July 15, 2026 06:00
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