Skip to content

MM-68316: recommend builtin DB readiness check for K8s deployments#8935

Open
nickmisasi wants to merge 2 commits intomasterfrom
MM-68316
Open

MM-68316: recommend builtin DB readiness check for K8s deployments#8935
nickmisasi wants to merge 2 commits intomasterfrom
MM-68316

Conversation

@nickmisasi
Copy link
Copy Markdown
Contributor

Summary

Updates the Kubernetes deployment guides — particularly the air-gapped deployment guide — to recommend spec.database.readinessCheck.mode: builtin as the primary approach for the operator's database-readiness init container. The new mode reuses the Mattermost image and runs mattermost db ping, removing the requirement to mirror postgres:13 into air-gapped registries. The legacy external mode remains the default for backward compatibility and is noted as slated for deprecation.

Files touched:

  • source/deployment-guide/reference-architecture/deployment-scenarios/air-gapped-deployment.rst — adds a recommendation note in the Kubernetes prerequisites tab.
  • source/deployment-guide/server/kubernetes/deploy-k8s.rst — adds a recommended readinessCheck configuration step and a deprecation note next to the legacy DB_CONNECTION_CHECK_URL flow.

Ticket Link

https://mattermost.atlassian.net/browse/MM-68316

Related PRs

Notes

  • No specific Mattermost server / operator version was hard-coded; deprecation references say "slated for deprecation in a future operator release" and the version availability for mattermost db ping links to the server PR. Update once concrete versions are decided.

Updates the Kubernetes deployment guides — particularly the
air-gapped deployment guide — to recommend
spec.database.readinessCheck.mode=builtin as the primary
approach, removing the requirement to mirror postgres:13 into
air-gapped registries. Notes that the legacy external/postgres:13
mode remains the default for backward compatibility but is
slated for deprecation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f5006f35-51b6-466b-a363-e4baaa9f2cb2

📥 Commits

Reviewing files that changed from the base of the PR and between e61dd48 and e2610b8.

📒 Files selected for processing (2)
  • source/deployment-guide/reference-architecture/deployment-scenarios/air-gapped-deployment.rst
  • source/deployment-guide/server/kubernetes/deploy-k8s.rst
✅ Files skipped from review due to trivial changes (2)
  • source/deployment-guide/server/kubernetes/deploy-k8s.rst
  • source/deployment-guide/reference-architecture/deployment-scenarios/air-gapped-deployment.rst

📝 Walkthrough

Walkthrough

This PR updates Kubernetes deployment docs to document and recommend spec.database.readinessCheck.mode: builtin which runs mattermost db ping from the mirrored Mattermost image for readiness checks. It also clarifies DB_CONNECTION_CHECK_URL usage and notes the legacy external mode remains default and is slated for deprecation.

Changes

Database Readiness Check Configuration

Layer / File(s) Summary
Air-Gapped Guidance
source/deployment-guide/reference-architecture/deployment-scenarios/air-gapped-deployment.rst
Adds a Kubernetes-specific note "Database readiness check (air-gapped recommendation)" describing spec.database.readinessCheck.mode: builtin, behavior (runs in-image mattermost db ping), prerequisites (CRD support and Mattermost release shipping mattermost db ping), and a YAML example.
Database Secret Explanation
source/deployment-guide/server/kubernetes/deploy-k8s.rst
Documents that DB_CONNECTION_CHECK_URL is consumed only by the legacy postgres:13 + pg_isready init container (legacy external mode).
Connect-to-Database Step
source/deployment-guide/server/kubernetes/deploy-k8s.rst
Adds a recommended Step 5 subsection showing spec.database.readinessCheck.mode: builtin with optional timeout: 5m, explains builtin vs legacy external behavior, and notes legacy mode remains default for backward compatibility and is slated for deprecation.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: recommending the builtin database readiness check mode for Kubernetes deployments, which is the core objective of this documentation update.
Description check ✅ Passed The description is well-related to the changeset, providing clear context about the recommendation, affected files, related PRs, and important notes about version dependencies.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch MM-68316

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (3)
source/deployment-guide/server/kubernetes/deploy-k8s.rst (2)

141-143: ⚡ Quick win

Consider upgrading this admonition to important.

The content describes a material difference between legacy and new deployment modes that affects image mirroring requirements in air-gapped environments and notes upcoming deprecation. This has a high impact on deployment planning and supportability. As per coding guidelines, use important admonition for "prerequisites, constraints, or high-impact information that materially affects correctness, supportability, compliance, or success."

📋 Suggested admonition upgrade
-  .. note::
+  .. important::
🤖 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 `@source/deployment-guide/server/kubernetes/deploy-k8s.rst` around lines 141 -
143, Replace the current note admonition that explains DB_CONNECTION_CHECK_URL
and legacy vs builtin readiness behavior with an important admonition to
highlight this high-impact information: update the admonition type around the
paragraph referencing DB_CONNECTION_CHECK_URL, the operator's legacy
"postgres:13" + "pg_isready" readiness init container, the default "external"
mode of spec.database.readinessCheck, and the recommended
spec.database.readinessCheck.mode: builtin (and its use of the in-image
"mattermost db ping") so the text is presented as an important
prerequisite/constraint and stands out for deployment planning and air-gapped
image mirroring.

201-215: ⚡ Quick win

Consider adding version-checking guidance for Novice Nate.

Line 213 states that builtin mode "requires a Mattermost release that ships the mattermost db ping command" and links to a GitHub PR for availability. A novice administrator may not know how to verify whether their chosen Mattermost version includes this command. Consider adding a brief inline note such as "You can verify support by checking the release notes for your Mattermost version" or similar guidance to help readers confirm compatibility before proceeding.

As per coding guidelines, define technical requirements clearly and explain prerequisites at the top of documentation sections to help novice users.

🤖 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 `@source/deployment-guide/server/kubernetes/deploy-k8s.rst` around lines 201 -
215, The docs mention readinessCheck mode: builtin requires the mattermost db
ping command but don't tell users how to verify support; add a short inline
sentence after the parenthetical about availability that tells readers how to
check their Mattermost version (e.g., “You can verify support by checking the
release notes or changelog for your specific Mattermost version for the presence
of the mattermost db ping command”) and reference the readinessCheck/mode:
builtin and mattermost db ping symbols so novices know what to look for before
switching modes.
source/deployment-guide/reference-architecture/deployment-scenarios/air-gapped-deployment.rst (1)

79-99: ⚡ Quick win

Consider changing this admonition to tip.

This note provides an optional best practice that helps air-gapped cluster operators succeed by avoiding the need to mirror postgres:13. As per coding guidelines, use tip admonition for "shortcuts, optional best practices, or advice that helps the reader succeed faster." The content clearly fits this definition with its explicit "We recommend this mode" language and practical benefit explanation.

💡 Suggested admonition change
-    .. note::
+    .. tip::
🤖 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
`@source/deployment-guide/reference-architecture/deployment-scenarios/air-gapped-deployment.rst`
around lines 79 - 99, The documentation uses a ".. note::" admonition titled
"**Database readiness check (air-gapped recommendation)**" but it should be a
tip; replace the ".. note::" directive with ".. tip::" for that block (the
paragraph explaining builtin readinessCheck mode and the YAML example) so the
content is styled as an optional best-practice shortcut; keep the existing
title, body text, and code-block intact and ensure linking and formatting remain
unchanged.
🤖 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.

Nitpick comments:
In
`@source/deployment-guide/reference-architecture/deployment-scenarios/air-gapped-deployment.rst`:
- Around line 79-99: The documentation uses a ".. note::" admonition titled
"**Database readiness check (air-gapped recommendation)**" but it should be a
tip; replace the ".. note::" directive with ".. tip::" for that block (the
paragraph explaining builtin readinessCheck mode and the YAML example) so the
content is styled as an optional best-practice shortcut; keep the existing
title, body text, and code-block intact and ensure linking and formatting remain
unchanged.

In `@source/deployment-guide/server/kubernetes/deploy-k8s.rst`:
- Around line 141-143: Replace the current note admonition that explains
DB_CONNECTION_CHECK_URL and legacy vs builtin readiness behavior with an
important admonition to highlight this high-impact information: update the
admonition type around the paragraph referencing DB_CONNECTION_CHECK_URL, the
operator's legacy "postgres:13" + "pg_isready" readiness init container, the
default "external" mode of spec.database.readinessCheck, and the recommended
spec.database.readinessCheck.mode: builtin (and its use of the in-image
"mattermost db ping") so the text is presented as an important
prerequisite/constraint and stands out for deployment planning and air-gapped
image mirroring.
- Around line 201-215: The docs mention readinessCheck mode: builtin requires
the mattermost db ping command but don't tell users how to verify support; add a
short inline sentence after the parenthetical about availability that tells
readers how to check their Mattermost version (e.g., “You can verify support by
checking the release notes or changelog for your specific Mattermost version for
the presence of the mattermost db ping command”) and reference the
readinessCheck/mode: builtin and mattermost db ping symbols so novices know what
to look for before switching modes.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: dac83a35-bba9-464d-a85f-a862d2f73412

📥 Commits

Reviewing files that changed from the base of the PR and between 560c09f and e61dd48.

📒 Files selected for processing (2)
  • source/deployment-guide/reference-architecture/deployment-scenarios/air-gapped-deployment.rst
  • source/deployment-guide/server/kubernetes/deploy-k8s.rst

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

Newest code from mattermost has been published to preview environment for Git SHA e61dd48

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates Mattermost Kubernetes deployment documentation to recommend the operator’s new spec.database.readinessCheck.mode: builtin database-readiness init container behavior (using mattermost db ping from the Mattermost image) to reduce dependency on mirroring postgres:13, especially for air-gapped environments.

Changes:

  • Adds guidance and examples for configuring spec.database.readinessCheck.mode: builtin in the Kubernetes deployment flow.
  • Adds an air-gapped-specific note recommending builtin readiness checks to avoid mirroring the postgres:13 image.
  • Documents legacy external readiness-check mode as the default for backward compatibility and notes planned deprecation.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
source/deployment-guide/server/kubernetes/deploy-k8s.rst Adds a deprecation note for the legacy DB_CONNECTION_CHECK_URL/external readiness flow and a recommended Step 5 configuration for readinessCheck.mode: builtin.
source/deployment-guide/reference-architecture/deployment-scenarios/air-gapped-deployment.rst Adds an air-gapped recommendation note and example manifest snippet for readinessCheck.mode: builtin.

Comment on lines +141 to +143
.. note::

The ``DB_CONNECTION_CHECK_URL`` value is consumed by the operator's legacy ``postgres:13`` + ``pg_isready`` readiness init container (the default ``external`` mode of ``spec.database.readinessCheck``). New deployments are encouraged to set ``spec.database.readinessCheck.mode: builtin`` (see Step 5 below), in which case the readiness init container runs the in-image ``mattermost db ping`` command and the ``DB_CONNECTION_CHECK_URL`` field is no longer required. The legacy ``external`` mode remains the default for backward compatibility but is slated for deprecation in a future operator release.
Comment thread source/deployment-guide/server/kubernetes/deploy-k8s.rst Outdated

Recent versions of the Mattermost Operator can run the database-readiness init container from the same Mattermost image as the main container by setting ``spec.database.readinessCheck.mode: builtin`` on the ``Mattermost`` custom resource. The init container then invokes the in-image ``mattermost db ping`` command instead of pulling ``postgres:13`` and running ``pg_isready``.

We recommend this mode for air-gapped clusters: it removes the requirement to mirror ``postgres:13`` into your private registry, since the only image needed for the readiness check is the Mattermost image you're already mirroring. Using ``builtin`` mode requires a Mattermost release that ships the ``mattermost db ping`` command (see the `Mattermost server release notes <https://github.com/mattermost/mattermost/pull/36406>`__ for availability).
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

Newest code from mattermost has been published to preview environment for Git SHA e2610b8

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.

2 participants