Skip to content

Conversation

@mayankshah1607
Copy link
Member

@mayankshah1607 mayankshah1607 commented Nov 18, 2025

K8SPSMDB-1520 Powered by Pull Request Badge

CHANGE DESCRIPTION

This PR adds a new backup storage type minio. This storage type has been added to PBM 2.12.0. Since not all S3-compatible storage services support AWS SDK v2's Signature Version 4 (SigV4), the minio storage type uses the Minio client instead of the AWS SDK.

Example:

backup:
  image: perconalab/percona-server-mongodb-operator:main-backup
  storages:
     minio:
       type: minio
       minio:
         bucket: MINIO-BACKUP-BUCKET-NAME-HERE
         region: us-east-1
         credentialsSecret: my-cluster-name-backup-minio
         endpointUrl: minio.psmdb.svc.cluster.local:9000/minio/
         insecureSkipTLSVerify: false
         prefix: ""
         secure: false

Since

CHECKLIST

Jira

  • Is the Jira ticket created and referenced properly?
  • Does the Jira ticket have the proper statuses for documentation (Needs Doc) and QA (Needs QA)?
  • Does the Jira ticket link to the proper milestone (Fix Version field)?

Tests

  • Is an E2E test/test case added for the new feature/change?
  • Are unit tests added where appropriate?
  • Are OpenShift compare files changed for E2E tests (compare/*-oc.yml)?

Config/Logging/Testability

  • Are all needed new/changed options added to default YAML files?
  • Are all needed new/changed options added to the Helm Chart?
  • Did we add proper logging messages for operator actions?
  • Did we ensure compatibility with the previous version or cluster upgrade process?
  • Does the change support oldest and newest supported MongoDB version?
  • Does the change support oldest and newest supported Kubernetes version?

Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Copilot AI review requested due to automatic review settings November 18, 2025 09:24
@pull-request-size pull-request-size bot added the size/L 100-499 lines label Nov 18, 2025
@github-actions github-actions bot added the dependencies Pull requests that update a dependency file label Nov 18, 2025
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
@pull-request-size pull-request-size bot added size/XL 500-999 lines and removed size/L 100-499 lines labels Nov 18, 2025
@github-actions github-actions bot added the tests label Nov 18, 2025
Copy link
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

This PR implements native Minio support for MongoDB backups as an alternative to S3-compatible storage. The implementation adds Minio as a separate BackupStorageType because not all S3-compatible storage services support AWS SDK v2's Signature Version 4 (SigV4). The change uses the MinIO Go client from PBM (v2.12.0+) instead of the AWS SDK.

Key Changes:

  • Added BackupStorageMinio type with dedicated configuration struct (BackupStorageMinioSpec and MinioRetryer)
  • Refactored GCS endpoint URL constant to a shared pkg/naming package for better code organization
  • Updated PBM library dependency to version with Minio storage support
  • Extended backup and restore controllers to handle Minio storage type

Reviewed Changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pkg/apis/psmdb/v1/psmdb_types.go Added BackupStorageMinioSpec type and BackupStorageMinio constant
pkg/apis/psmdb/v1/perconaservermongodbbackup_types.go Added Minio field to backup status
pkg/apis/psmdb/v1/zz_generated.deepcopy.go Generated DeepCopy methods for MinioRetryer and BackupStorageMinioSpec
pkg/psmdb/backup/pbm.go Added GetPBMStorageMinioConfig function and integrated Minio case in GetPBMStorageConfig; refactored GCS endpoint checks to use naming package
pkg/naming/gcs.go Created new file to store GCS endpoint constant
pkg/controller/perconaservermongodbrestore/validate.go Updated import to use naming.GCSEndpointURL
pkg/controller/perconaservermongodbrestore/psmdb_restore_controller.go Added Minio support in getStorage function
pkg/controller/perconaservermongodbbackup/psmdb_backup_controller.go Updated GCS endpoint check and added Minio case in deleteBackupFinalizer
pkg/controller/perconaservermongodbbackup/backup.go Added Minio case in backup destination handling
config/crd/bases/*.yaml Added Minio configuration schema to CRDs
go.mod, go.sum Updated percona-backup-mongodb dependency and added new transitive dependencies

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Copy link
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

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@it-percona-cla
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
@pull-request-size pull-request-size bot added size/XXL 1000+ lines and removed size/XL 500-999 lines labels Nov 24, 2025
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Copilot AI review requested due to automatic review settings November 24, 2025 08:36
package naming

const (
GCSEndpointURL = "storage.googleapis.com"
Copy link
Member Author

Choose a reason for hiding this comment

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

This const was removed in pbm 2.12.0 module

Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Copy link
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

Copilot reviewed 45 out of 46 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

e2e-tests/functions:1

  • The default backup image has changed from a stable version (percona/percona-backup-mongodb:2.11.0) to a development image (perconalab/...main-backup). This could cause instability in tests and production environments. Consider using a stable version tag instead of 'main' which points to potentially unstable code.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

# backoffMax: 30
# backoffMultiplier: 2
# minio:
# minio-s3:
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

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

[nitpick] The storage name 'minio-s3' is misleading since this configuration still uses S3 type. Consider renaming to 'minio-via-s3' or 'minio-s3-compatible' to clarify that this is the S3-compatible approach, distinct from the new native 'minio' type.

Suggested change
# minio-s3:
# minio-s3-compatible:

Copilot uses AI. Check for mistakes.
gkech
gkech previously approved these changes Dec 5, 2025
nmarukovich
nmarukovich previously approved these changes Dec 8, 2025
Copy link
Contributor

@egegunes egegunes left a comment

Choose a reason for hiding this comment

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

@mayankshah1607 please check init-deploy and replset-overrides failures

Signed-off-by: Mayank Shah <mayank.shah@percona.com>
@mayankshah1607 mayankshah1607 dismissed stale reviews from nmarukovich and gkech via 6dc0f95 December 9, 2025 07:58
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Copilot AI review requested due to automatic review settings December 9, 2025 08:00
Copy link
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

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@JNKPercona
Copy link
Collaborator

Test Name Result Time
arbiter passed 00:00:00
balancer passed 00:00:00
cross-site-sharded passed 00:00:00
custom-replset-name passed 00:00:00
custom-tls passed 00:00:00
custom-users-roles passed 00:00:00
custom-users-roles-sharded passed 00:00:00
data-at-rest-encryption passed 00:00:00
data-sharded passed 00:00:00
demand-backup passed 00:00:00
demand-backup-eks-credentials-irsa passed 00:00:00
demand-backup-fs passed 00:00:00
demand-backup-if-unhealthy passed 00:00:00
demand-backup-incremental passed 00:00:00
demand-backup-incremental-sharded passed 00:00:00
demand-backup-physical-parallel passed 00:00:00
demand-backup-physical-aws passed 00:00:00
demand-backup-physical-azure passed 00:00:00
demand-backup-physical-gcp-s3 passed 00:00:00
demand-backup-physical-gcp-native passed 00:00:00
demand-backup-physical-minio passed 00:00:00
demand-backup-physical-minio-native passed 00:00:00
demand-backup-physical-sharded-parallel passed 00:00:00
demand-backup-physical-sharded-aws passed 00:00:00
demand-backup-physical-sharded-azure passed 00:00:00
demand-backup-physical-sharded-gcp-native passed 00:00:00
demand-backup-physical-sharded-minio passed 00:00:00
demand-backup-physical-sharded-minio-native passed 00:00:00
demand-backup-sharded passed 00:00:00
expose-sharded passed 00:00:00
finalizer passed 00:00:00
ignore-labels-annotations passed 00:00:00
init-deploy passed 00:00:00
ldap passed 00:00:00
ldap-tls passed 00:00:00
limits passed 00:00:00
liveness passed 00:00:00
mongod-major-upgrade passed 00:00:00
mongod-major-upgrade-sharded passed 00:00:00
monitoring-2-0 passed 00:00:00
monitoring-pmm3 passed 00:00:00
multi-cluster-service passed 00:00:00
multi-storage passed 00:00:00
non-voting-and-hidden passed 00:00:00
one-pod passed 00:00:00
operator-self-healing-chaos passed 00:00:00
pitr passed 00:00:00
pitr-physical passed 00:00:00
pitr-sharded passed 00:00:00
pitr-to-new-cluster passed 00:00:00
pitr-physical-backup-source passed 00:00:00
preinit-updates passed 00:00:00
pvc-resize passed 00:00:00
recover-no-primary passed 00:00:00
replset-overrides passed 00:00:00
rs-shard-migration passed 00:00:00
scaling passed 00:00:00
scheduled-backup passed 00:00:00
security-context passed 00:00:00
self-healing-chaos passed 00:00:00
service-per-pod passed 00:00:00
serviceless-external-nodes passed 00:00:00
smart-update passed 00:00:00
split-horizon passed 00:00:00
stable-resource-version passed 00:00:00
storage passed 00:00:00
tls-issue-cert-manager passed 00:00:00
upgrade passed 00:00:00
upgrade-consistency passed 00:00:00
upgrade-consistency-sharded-tls passed 00:00:00
upgrade-sharded passed 00:00:00
upgrade-partial-backup passed 00:15:24
users passed 00:00:00
version-service passed 00:00:00
Summary Value
Tests Run 74/74
Job Duration 00:43:25
Total Test Time 00:15:24

commit: 3092c1d
image: perconalab/percona-server-mongodb-operator:PR-2114-3092c1dd

@mayankshah1607 mayankshah1607 merged commit 1368cc6 into main Dec 10, 2025
19 checks passed
@mayankshah1607 mayankshah1607 deleted the K8SPSMDB-1520 branch December 10, 2025 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file size/XXL 1000+ lines tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants