Skip to content

Conversation

kvaps
Copy link
Member

@kvaps kvaps commented Jul 16, 2025

What this PR does

This PR updates FerretDB from v1 to v2

Breaking change: before upgrading your ferretdb, please backup and restore your data, using this guide:

Release note

[ferretdb] Introduce FerretDB v2.4.0

Summary by CodeRabbit

  • New Features

    • Upgraded FerretDB application to version 2.4.0 with Helm chart version 1.0.0.
    • Added support for scheduled backups via a new ScheduledBackup resource.
  • Improvements

    • Default resource sizing for FerretDB replicas increased from "nano" to "micro" for better performance.
    • PostgreSQL configuration enhanced with additional extensions, improved security settings, and automated extension setup.
    • Streamlined environment variable configuration for PostgreSQL connection.
    • Backup configuration updated for more flexible retention, scheduling (including seconds), destination paths, and bootstrap recovery options.
  • Removals

    • Removed Kubernetes initialization job and related scripts for PostgreSQL user and role management, simplifying deployment.
    • Deleted legacy backup CronJob, backup scripts, and backup secrets templates.
  • Chores

    • Updated version mappings and added a new Makefile target to streamline image and version updates.

@kvaps kvaps requested review from lllamnyp and klinch0 as code owners July 16, 2025 12:07
Copy link
Contributor

coderabbitai bot commented Jul 16, 2025

Warning

Rate limit exceeded

@kvaps has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 17 minutes and 14 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 21f323e and e5cde60.

📒 Files selected for processing (9)
  • packages/apps/ferretdb/README.md (1 hunks)
  • packages/apps/ferretdb/images/postgres-backup.tag (0 hunks)
  • packages/apps/ferretdb/templates/backup-cronjob.yaml (0 hunks)
  • packages/apps/ferretdb/templates/backup-script.yaml (0 hunks)
  • packages/apps/ferretdb/templates/backup-secret.yaml (0 hunks)
  • packages/apps/ferretdb/templates/backup.yaml (1 hunks)
  • packages/apps/ferretdb/templates/postgres.yaml (2 hunks)
  • packages/apps/ferretdb/values.schema.json (2 hunks)
  • packages/apps/ferretdb/values.yaml (1 hunks)

"""

Walkthrough

The FerretDB Helm chart and deployment were updated to version 1.0.0, with the application version bumped to 2.4.0. The Makefile gained an update target for automated version/image updates. The PostgreSQL and FerretDB deployment templates were refactored, initialization jobs and scripts for database user/role management were removed, and backup was restructured with new ScheduledBackup resources replacing previous backup CronJobs and scripts. Resource presets and version mappings were also updated.

Changes

Files/Groups Change Summary
packages/apps/ferretdb/Chart.yaml, values.yaml, values.schema.json, versions_map Updated Helm chart version, app version, resource preset, backup and bootstrap restore configurations, and version mapping.
packages/apps/ferretdb/Makefile Added update target for automated version and image tag updates.
packages/apps/ferretdb/templates/ferretdb.yaml Updated FerretDB image and refactored PostgreSQL connection environment variables.
packages/apps/ferretdb/templates/postgres.yaml Enhanced PostgreSQL cluster spec, added extensions, config, backup and bootstrap support, removed explicit inRoles: [app].
packages/apps/ferretdb/templates/backup.yaml Added new ScheduledBackup resource template for PostgreSQL backups.
packages/apps/ferretdb/templates/init-job.yaml, init-script.yaml, backup-cronjob.yaml, backup-script.yaml, backup-secret.yaml, images/postgres-backup.tag Removed initialization job and script templates, old backup CronJob, backup script, backup secret, and backup image tag file.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Makefile
    participant GitHub
    participant ContainerRegistry
    participant HelmChart

    User->>Makefile: run update
    Makefile->>GitHub: fetch latest FerretDB tag
    Makefile->>ContainerRegistry: fetch latest postgres-documentdb image tag
    Makefile->>HelmChart: update image tags and appVersion in YAML/templates
Loading

Suggested labels

enhancement, size:XL

Suggested reviewers

  • klinch0

Poem

Hopping along with version one,
FerretDB’s journey has just begun!
Out with old scripts, in with new flow,
Images and versions in one smooth go.
The chart is fresh, the configs bright,
This bunny codes through day and night! 🐇✨
"""


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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@kvaps kvaps changed the title upd ferretdb Update FerretDB v2.4.0 Jul 16, 2025
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @kvaps, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request delivers comprehensive updates to both the FerretDB and SeaweedFS Helm charts. For FerretDB, it focuses on version upgrades and streamlining its PostgreSQL integration. The changes to SeaweedFS are more extensive, introducing new deployment models like MultiZone topology and an all-in-one option, adding an SFTP server, and significantly expanding configuration flexibility. These updates aim to improve deployment versatility, operational stability, and feature richness for both applications.

Highlights

  • FerretDB Update & PostgreSQL Integration: The FerretDB application has been updated to version 2.4.0 (chart version 1.0.0). This update includes a revised PostgreSQL connection method that dynamically fetches the password from a secret, and enables pg_documentdb extensions for enhanced functionality. An automated make update command has also been added to streamline future version bumps.
  • SeaweedFS Major Version Upgrade & MultiZone Support: SeaweedFS has been upgraded to application version 3.94 (chart version 4.0.394). A significant new feature is the introduction of MultiZone topology support, allowing for more resilient deployments across different Kubernetes zones with per-zone volume configurations and robust preflight validation checks.
  • New SeaweedFS Deployment Options (All-in-One & SFTP): Two new deployment options have been added for SeaweedFS: an 'all-in-one' mode that consolidates master, volume, and filer roles for simplified deployments, and a dedicated SFTP server component, expanding SeaweedFS's data access capabilities.
  • Enhanced Helm Chart Configurability & Upgrade Mechanism: The Helm charts have been extensively refactored to expose numerous new configuration options for all SeaweedFS components (master, volume, filer, S3, SFTP), including topology spread constraints, metrics IPs, and Raft settings. A new pre-upgrade hook has been implemented to ensure smoother transitions between major versions by gracefully deleting old components.
  • Improved Monitoring and Secret Management: The Grafana dashboard for SeaweedFS has been enhanced with new S3 bucket traffic metrics. Secret generation for S3 and SFTP has been improved to ensure persistence across upgrades using new Helm helpers, and the security configmap now preserves JWT signing keys.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request is a substantial update, upgrading FerretDB and SeaweedFS, and introducing significant new features like MultiZone topology for SeaweedFS. The changes are extensive and demonstrate a good understanding of Helm and Kubernetes patterns. The introduction of a pre-upgrade hook for migrating SeaweedFS is a thoughtful addition for managing breaking changes.

I have identified a few issues that need attention:

  • A critical bug in a new Go template helper function that will cause the volume resize functionality to fail.
  • A high severity security concern where FerretDB connects to its PostgreSQL backend with superuser privileges.
  • A medium severity issue regarding Helm chart best practices for versioning.

Copy link
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.

Actionable comments posted: 3

🔭 Outside diff range comments (1)
packages/apps/ferretdb/templates/ferretdb.yaml (1)

23-30: YAML-lint catches invalid indentation – deployment will not render

yamllint reports “wrong indentation: expected 8 but found 10”.
The list items under env: must be indented exactly two spaces less (align with the key). Helm tolerates additional spaces in many cases, but some CI pipelines (and editors) refuse to parse this. Fixing it removes the lint error without altering semantics.

-          - name: POSTGRESQL_PASSWORD
-            valueFrom:
-              secretKeyRef:
-                name: {{ .Release.Name }}-postgres-superuser
-                key: password
-          - name: FERRETDB_POSTGRESQL_URL
-            value: "postgresql://postgres:$(POSTGRESQL_PASSWORD)@{{ .Release.Name }}-postgres-rw:5432/postgres"
+        - name: POSTGRESQL_PASSWORD
+          valueFrom:
+            secretKeyRef:
+              name: {{ .Release.Name }}-postgres-superuser
+              key: password
+        - name: FERRETDB_POSTGRESQL_URL
+          value: "postgresql://postgres:$(POSTGRESQL_PASSWORD)@{{ .Release.Name }}-postgres-rw:5432/postgres"

Side note: variable substitution with $(POSTGRESQL_PASSWORD) works only because POSTGRESQL_PASSWORD is declared first; keep this order if more env-vars are added.

🧹 Nitpick comments (1)
packages/apps/ferretdb/templates/ferretdb.yaml (1)

19-19: Pin the image tag to a digest for reproducible & secure releases

The move to ghcr.io/ferretdb/ferretdb:2.4.0 is fine, but relying solely on a mutable tag means the exact image can change without notice. Pinning the SHA-256 digest guarantees that every deployment uses the identical bits and protects against supply-chain surprises.

-        image: ghcr.io/ferretdb/ferretdb:2.4.0
+        # pin to digest to ensure immutability / reproducibility  
+        image: ghcr.io/ferretdb/ferretdb@sha256:<insert-real-digest-here>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7a74936 and bdc0ae9.

📒 Files selected for processing (8)
  • packages/apps/ferretdb/Chart.yaml (1 hunks)
  • packages/apps/ferretdb/Makefile (1 hunks)
  • packages/apps/ferretdb/templates/ferretdb.yaml (1 hunks)
  • packages/apps/ferretdb/templates/init-job.yaml (0 hunks)
  • packages/apps/ferretdb/templates/init-script.yaml (0 hunks)
  • packages/apps/ferretdb/templates/postgres.yaml (2 hunks)
  • packages/apps/ferretdb/values.yaml (1 hunks)
  • packages/apps/versions_map (1 hunks)
💤 Files with no reviewable changes (2)
  • packages/apps/ferretdb/templates/init-job.yaml
  • packages/apps/ferretdb/templates/init-script.yaml
🧰 Additional context used
🧠 Learnings (1)
packages/apps/ferretdb/Makefile (1)
Learnt from: NickVolynkin
PR: cozystack/cozystack#1196
File: packages/apps/http-cache/Makefile:24-27
Timestamp: 2025-07-14T16:23:12.758Z
Learning: In the cozystack repository, the `readme-generator` tool removes enum contents from values.schema.json files during its operation. Therefore, when using readme-generator in Makefiles, any enum values need to be injected back into the schema using yq commands after readme-generator has run, not before.
🪛 YAMLlint (1.37.1)
packages/apps/ferretdb/templates/ferretdb.yaml

[warning] 23-23: wrong indentation: expected 8 but found 10

(indentation)


[error] 26-26: syntax error: expected , but found ''

(syntax)

🔇 Additional comments (3)
packages/apps/ferretdb/values.yaml (1)

58-60: Default preset bumped to “micro” – double-check cluster sizing & docs

Moving the default from nano to micro roughly quadruples the CPU/memory requests (per the preset map).
Please make sure:

  1. CI/test clusters still have head-room.
  2. README / values.schema.json examples mention the new default, otherwise users will be surprised.

No code change required if that is intentional.

packages/apps/ferretdb/Chart.yaml (1)

19-25: Version bump looks good

Chart version and appVersion are aligned with the upstream release.

packages/apps/ferretdb/templates/postgres.yaml (1)

8-10: UID/GID hard-coded to 999 – verify host filesystem compatibility

Some distros already use UID 999 (e.g. systemd-network). If the underlying
nodes run with that user, volume ownership may collide. Consider leaving the
defaults or making these values configurable.

Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
Copy link
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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/apps/ferretdb/templates/ferretdb.yaml (1)

23-29: Consider keeping the entire connection string in a secret

Placing the raw password into an env var and then re-embedding it in another env var duplicates sensitive data and exposes it via kubectl describe pod & ps output inside the container. A more secure pattern is:

  1. Store the full postgresql://… URI in the secret (as before).
  2. Mount it via valueFrom.secretKeyRef directly to FERRETDB_POSTGRESQL_URL.

This removes the extra POSTGRESQL_PASSWORD variable entirely.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bdc0ae9 and 4d62961.

📒 Files selected for processing (8)
  • packages/apps/ferretdb/Chart.yaml (1 hunks)
  • packages/apps/ferretdb/Makefile (1 hunks)
  • packages/apps/ferretdb/templates/ferretdb.yaml (1 hunks)
  • packages/apps/ferretdb/templates/init-job.yaml (0 hunks)
  • packages/apps/ferretdb/templates/init-script.yaml (0 hunks)
  • packages/apps/ferretdb/templates/postgres.yaml (2 hunks)
  • packages/apps/ferretdb/values.yaml (1 hunks)
  • packages/apps/versions_map (1 hunks)
💤 Files with no reviewable changes (2)
  • packages/apps/ferretdb/templates/init-job.yaml
  • packages/apps/ferretdb/templates/init-script.yaml
🚧 Files skipped from review as they are similar to previous changes (5)
  • packages/apps/ferretdb/templates/postgres.yaml
  • packages/apps/ferretdb/values.yaml
  • packages/apps/ferretdb/Chart.yaml
  • packages/apps/ferretdb/Makefile
  • packages/apps/versions_map
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: kvaps
PR: cozystack/cozystack#1206
File: packages/apps/versions_map:30-31
Timestamp: 2025-07-16T13:17:07.532Z
Learning: In packages/apps/versions_map, using HEAD for certain versions (like ferretdb 1.0.0) is intentional and part of the core logic, not an oversight that needs to be fixed for reproducibility.
🪛 YAMLlint (1.37.1)
packages/apps/ferretdb/templates/ferretdb.yaml

[warning] 23-23: wrong indentation: expected 8 but found 10

(indentation)


[error] 26-26: syntax error: expected , but found ''

(syntax)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build
🔇 Additional comments (1)
packages/apps/ferretdb/templates/ferretdb.yaml (1)

19-19: Image tag bump looks good

The container image is correctly updated to 2.4.0, matching the chart’s appVersion.

Copy link
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.

Actionable comments posted: 3

♻️ Duplicate comments (1)
packages/apps/ferretdb/templates/postgres.yaml (1)

64-78: Extension name mismatch still present
(see prior review)

shared_preload_libraries lists pg_documentdb, but the CREATE EXTENSION
command uses plain documentdb. Unless the image exposes that alias the
statement will fail.

Same recommendation as before: CREATE EXTENSION IF NOT EXISTS pg_documentdb …

🧹 Nitpick comments (1)
packages/apps/ferretdb/templates/backup.yaml (1)

1-2: Template passes YAML-lint but not Helm – leading hyphen after {{- if … }}

Helm will render:

<empty>
---
apiVersion: …

The leading blank line (<empty>) is produced because the if directive
doesn’t trim the trailing newline. This confuses some YAML linters / GitOps
systems.

Quick tidy-up:

-{{- if .Values.backup.enabled }}
---
+{{- if .Values.backup.enabled -}}
+---
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4d62961 and a7abb31.

📒 Files selected for processing (7)
  • packages/apps/ferretdb/images/postgres-backup.tag (0 hunks)
  • packages/apps/ferretdb/templates/backup-cronjob.yaml (0 hunks)
  • packages/apps/ferretdb/templates/backup-script.yaml (0 hunks)
  • packages/apps/ferretdb/templates/backup-secret.yaml (0 hunks)
  • packages/apps/ferretdb/templates/backup.yaml (1 hunks)
  • packages/apps/ferretdb/templates/postgres.yaml (2 hunks)
  • packages/apps/ferretdb/values.yaml (1 hunks)
💤 Files with no reviewable changes (4)
  • packages/apps/ferretdb/images/postgres-backup.tag
  • packages/apps/ferretdb/templates/backup-cronjob.yaml
  • packages/apps/ferretdb/templates/backup-script.yaml
  • packages/apps/ferretdb/templates/backup-secret.yaml
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: kvaps
PR: cozystack/cozystack#1206
File: packages/apps/versions_map:30-31
Timestamp: 2025-07-16T13:17:07.532Z
Learning: In packages/apps/versions_map, using HEAD for certain versions (like ferretdb 1.0.0) is intentional and part of the core logic, not an oversight that needs to be fixed for reproducibility.
🪛 YAMLlint (1.37.1)
packages/apps/ferretdb/templates/backup.yaml

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)

🪛 Gitleaks (8.27.2)
packages/apps/ferretdb/values.yaml

47-47: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


48-48: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

🔇 Additional comments (2)
packages/apps/ferretdb/values.yaml (1)

69-70: Preset switch looks sane

Changing the default preset from nano to micro is non-breaking (larger
requests/limits only). No objections.

packages/apps/ferretdb/templates/backup.yaml (1)

8-9: Propagate the fixed 5-field cron expression

Once values.yaml is corrected, ensure the template still quotes the value to
keep the leading zero, e.g. "0 2 * * *".

Copy link
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.

Actionable comments posted: 0

🔭 Outside diff range comments (1)
packages/apps/ferretdb/values.schema.json (1)

105-118: Description mentions preset none, but it’s missing from enum – validation will fail

If a user sets resourcesPreset: none, Helm-schema validation errors out.

             "enum": [
+                "none",
                 "nano",
                 "micro",
                 "small",
                 "medium",
                 "large",
                 "xlarge",
                 "2xlarge"
             ]
🧹 Nitpick comments (2)
packages/apps/ferretdb/README.md (1)

40-47: resources/resourcesPreset rows duplicated under Bootstrap — likely a doc slip

These parameters are global but appear inside the “Bootstrap parameters” table, which might confuse users into thinking they are bootstrap-only.
Move them back to the “Common/Configuration” sections or drop the duplicate rows.

packages/apps/ferretdb/values.schema.json (1)

68-77: Mark secret fields with format: password to prevent accidental logging

For s3AccessKey and s3SecretKey, adding the JSON-Schema hint keeps some UIs (e.g., ArgoCD, Lens) from echoing secrets:

-                "type": "string",
+                "type": "string",
+                "format": "password",
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a7abb31 and 21f323e.

📒 Files selected for processing (9)
  • packages/apps/ferretdb/README.md (1 hunks)
  • packages/apps/ferretdb/images/postgres-backup.tag (0 hunks)
  • packages/apps/ferretdb/templates/backup-cronjob.yaml (0 hunks)
  • packages/apps/ferretdb/templates/backup-script.yaml (0 hunks)
  • packages/apps/ferretdb/templates/backup-secret.yaml (0 hunks)
  • packages/apps/ferretdb/templates/backup.yaml (1 hunks)
  • packages/apps/ferretdb/templates/postgres.yaml (2 hunks)
  • packages/apps/ferretdb/values.schema.json (2 hunks)
  • packages/apps/ferretdb/values.yaml (1 hunks)
💤 Files with no reviewable changes (4)
  • packages/apps/ferretdb/images/postgres-backup.tag
  • packages/apps/ferretdb/templates/backup-secret.yaml
  • packages/apps/ferretdb/templates/backup-cronjob.yaml
  • packages/apps/ferretdb/templates/backup-script.yaml
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/apps/ferretdb/values.yaml
  • packages/apps/ferretdb/templates/postgres.yaml
🧰 Additional context used
🪛 YAMLlint (1.37.1)
packages/apps/ferretdb/templates/backup.yaml

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)

🔇 Additional comments (2)
packages/apps/ferretdb/templates/backup.yaml (1)

8-11: Verify 6-field cron expression is actually supported by CloudNativePG

spec.schedule uses the expression 0 2 * * * * (seconds + classic 5-field cron).
CloudNativePG examples/documentation show the standard 5-field format.
If the controller treats a 6-field pattern as invalid, the ScheduledBackup will never be reconciled.

-  schedule: {{ .Values.backup.schedule | quote }}
+  # CloudNativePG currently expects a 5-field cron expression.
+  schedule: {{ .Values.backup.schedule | quote }}

Double-check controller docs / run kubectl describe scheduledbackup … after installation.

packages/apps/ferretdb/README.md (1)

28-37: Avoid exposing cloud credentials via plain-text values

s3AccessKey / s3SecretKey are documented here as regular chart values.
Publishing or committing these fields in values.yaml leaks long-lived IAM keys.

Recommend:

  1. Remove default dummy credentials from the table.
  2. Accept them only through a referenced Secret, e.g.:
backup:
  s3CredentialsSecret:
    name: ferretdb-backup-creds
    keyAccess: access-key
    keySecret: secret-key

This keeps credentials out of Git and aligns with Kubernetes best-practice.

⛔ Skipped due to learnings
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/ferretdb/README.md:35-37
Timestamp: 2025-07-02T09:58:11.406Z
Learning: In the cozystack repository, the maintainer NickVolynkin prefers to keep realistic-looking example credentials in README documentation rather than using generic placeholders like <ACCESS_KEY>, even though they are just examples and not real secrets.

Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
@kvaps kvaps merged commit 5199021 into main Jul 16, 2025
18 checks passed
@kvaps kvaps deleted the upd-ferretdb branch July 16, 2025 20:20
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