# Percona Operator with bitnami/mongodb-sharded

**URL:** <https://forums.percona.com/t/percona-operator-with-bitnami-mongodb-sharded/24339>\
**Category:** Percona Operator for MongoDB\
**Tags:** mongodb\
**Created:** [August 9, 2023, 4:07pm UTC](https://forums.percona.com/t/percona-operator-with-bitnami-mongodb-sharded/24339 "2023-08-09T16:07:45Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![taglas\_tamas](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/taglas_tamas/32/12172_2.png) [@taglas\_tamas](https://forums.percona.com/u/taglas_tamas)\
**Post date:** [August 9, 2023, 4:07pm UTC](https://forums.percona.com/t/percona-operator-with-bitnami-mongodb-sharded/24339/1 "2023-08-09T16:07:45Z")

</div>

Hi Everyone!

We have a bitnami/mongodb-sharded database running in our cluster as we use almost always open source versions, and we needed sharding.

My question is the following:

Can I use the Percona Operator in our Kubernetes cluster to back up the database automatically?

Sorry if the question is irrelevant, but I have not found enough information in the docs, as how to do what I aspire.

Do I have to use the percona server only?

Am I missing something?

( As I saw, when I deploy the stuff using helm, it deploys the percona server, and the rest of the guide is based on using that. )

---

<div class="post-metadata">

**Author:** ![dung-tien-nguyen](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/dung-tien-nguyen/32/11999_2.png) [@dung-tien-nguyen](https://forums.percona.com/u/dung-tien-nguyen)\
**Post date:** [August 10, 2023, 1:53am UTC](https://forums.percona.com/t/percona-operator-with-bitnami-mongodb-sharded/24339/2 "2023-08-10T01:53:28Z")

</div>

Percona Backup for MongoDB (PBM) only work with Percona MongoDB Server.  
If you simply rename the Mongodb image in Helm Bitnami to Percona Mongodb, the helm script will not work. Since the initialization and management scripts are included in their docker image by Bitnami.

---

<div class="post-metadata">

**Author:** ![taglas\_tamas](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/taglas_tamas/32/12172_2.png) [@taglas\_tamas](https://forums.percona.com/u/taglas_tamas)\
**Post date:** [August 10, 2023, 7:32am UTC](https://forums.percona.com/t/percona-operator-with-bitnami-mongodb-sharded/24339/3 "2023-08-10T07:32:21Z")

</div>

Thank you for your answer, we have an active bitnami/mongodb-sharded so we can’t just migrate the data. As far as I can tell the filesystem copies, and mongodump are discouraged as they do not work with sharded clusters ( version 4.2+ ). Is our option only the MongoDB Atlas? Do you think is it at all possible to back up this data?

You input is very much apppriciated!

---

<div class="post-metadata">

**Author:** ![Takis\_Stathopoulos](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/takis_stathopoulos/32/6081_2.png) [@Takis\_Stathopoulos](https://forums.percona.com/u/Takis_Stathopoulos)\
**Post date:** [August 10, 2023, 8:08am UTC](https://forums.percona.com/t/percona-operator-with-bitnami-mongodb-sharded/24339/4 "2023-08-10T08:08:22Z")

</div>

Why are you not using directly Percona Operator for MongoDB? What you need to have (sharding, backup, etc) is easily achievable with Percona Operator and it is fully open source.

---

<div class="post-metadata">

**Author:** ![taglas\_tamas](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/taglas_tamas/32/12172_2.png) [@taglas\_tamas](https://forums.percona.com/u/taglas_tamas)\
**Post date:** [August 10, 2023, 9:09am UTC](https://forums.percona.com/t/percona-operator-with-bitnami-mongodb-sharded/24339/5 "2023-08-10T09:09:26Z")

</div>

Apologies, will do, my confusion was because when I wanted to install the operator on the kubernetes cluster, the docs pointed me to the mongodb backup doc, and the Percona server was part of the installation.

---

<div class="post-metadata">

**Author:** ![Takis\_Stathopoulos](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/takis_stathopoulos/32/6081_2.png) [@Takis\_Stathopoulos](https://forums.percona.com/u/Takis_Stathopoulos)\
**Post date:** [August 10, 2023, 9:18am UTC](https://forums.percona.com/t/percona-operator-with-bitnami-mongodb-sharded/24339/6 "2023-08-10T09:18:26Z")

</div>

OK thanks for the info! Would you like sharing this broken link? The correct operator documentation should be available here [Percona Operator for MongoDB](https://docs.percona.com/percona-operator-for-mongodb/index.html)

---

<div class="post-metadata">

**Author:** ![taglas\_tamas](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/taglas_tamas/32/12172_2.png) [@taglas\_tamas](https://forums.percona.com/u/taglas_tamas)\
**Post date:** [August 10, 2023, 10:09am UTC](https://forums.percona.com/t/percona-operator-with-bitnami-mongodb-sharded/24339/7 "2023-08-10T10:09:27Z")

</div>

My apologies again, but I was looking at the wrong docs, the documentation links are fine.  
I’m still not sure I can use the Percona operator to my existing bitnami deployment, the documentation of the operator suggests that backup of that is not really possible as stated here:

> **[Percona Operator for MongoDB - Comparison with other solutions](https://docs.percona.com/percona-operator-for-mongodb/compare.html#backups)**
>
> There are multiple ways to deploy and manage MongoDB in Kubernetes. Here we will focus on comparing the following open source solutions:

Please correct me if I’m wrong

---

<div class="post-metadata">

**Author:** ![Takis\_Stathopoulos](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/takis_stathopoulos/32/6081_2.png) [@Takis\_Stathopoulos](https://forums.percona.com/u/Takis_Stathopoulos)\
**Post date:** [August 10, 2023, 10:15am UTC](https://forums.percona.com/t/percona-operator-with-bitnami-mongodb-sharded/24339/8 "2023-08-10T10:15:55Z")

</div>

Hi again. You are right you probably can not use the backup directly within your current Bitnami deployment. My recommendation would be to migrate from the Bitnami deployment to the Percona Operator one. There is a detailed comparison here [Comparison with other solutions - Percona Operator for MongoDB](https://docs.percona.com/percona-operator-for-mongodb/compare.html) that explains why it makes sense to do so once you need shards or really efficient backup. The migration could be based on a dump and restore to the new cluster.

---

<div class="post-metadata">

**Author:** ![taglas\_tamas](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/taglas_tamas/32/12172_2.png) [@taglas\_tamas](https://forums.percona.com/u/taglas_tamas)\
**Post date:** [August 10, 2023, 10:44am UTC](https://forums.percona.com/t/percona-operator-with-bitnami-mongodb-sharded/24339/9 "2023-08-10T10:44:24Z")

</div>

Thank you for clearing up, this confirmed my suspicion.  
Unfortunately mongodump and restore, and a even filesystem snapshots are discouraged after mongodb 4.2+ as they lose the atomicity.  
Thank you again for clearing up.

---

<div class="post-metadata">

**Author:** ![Takis\_Stathopoulos](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/takis_stathopoulos/32/6081_2.png) [@Takis\_Stathopoulos](https://forums.percona.com/u/Takis_Stathopoulos)\
**Post date:** [August 10, 2023, 11:10am UTC](https://forums.percona.com/t/percona-operator-with-bitnami-mongodb-sharded/24339/10 "2023-08-10T11:10:47Z")

</div>

This is correct if you are approaching them as backup methods, but they can still be used for a cold migration. Plus additional methods exist for doing a hot migration. So if I may ask is there a specific issue that obstructs you from replacing Bitnami with the Percona Operators in your environment?

---

<div class="post-metadata">

**Author:** ![taglas\_tamas](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/taglas_tamas/32/12172_2.png) [@taglas\_tamas](https://forums.percona.com/u/taglas_tamas)\
**Post date:** [August 11, 2023, 6:20pm UTC](https://forums.percona.com/t/percona-operator-with-bitnami-mongodb-sharded/24339/11 "2023-08-11T18:20:49Z")

</div>

We are doing exactly that and installed percona server and we are using minio for local hosting.  
However I have ran into trouble with the backup deployment as a lot of the old tickets the starting deadline exceeded when starting. For some reason it can’t find the cluster ( even though the name of the cluster is correct ), or there is something wrong with the secret, but I think that is an issue with either minio keys or the way backup objects should look like.  
Does the backup config really must have aws\_acces\_control\_id, and aws\_acces\_control\_key?

---

<div class="post-metadata">

**Author:** ![Takis\_Stathopoulos](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/takis_stathopoulos/32/6081_2.png) [@Takis\_Stathopoulos](https://forums.percona.com/u/Takis_Stathopoulos)\
**Post date:** [August 14, 2023, 7:28am UTC](https://forums.percona.com/t/percona-operator-with-bitnami-mongodb-sharded/24339/12 "2023-08-14T07:28:06Z")

</div>

> [@taglas\_tamas](#):
>
> minio

Hi I don’t have experience with minio, but the issues you are describing might be related with the backup storage.

- The instructions here point out that you need to add the endpoint url if you are not using AWS S3 [Configure storage for backups - Percona Operator for MongoDB](https://docs.percona.com/percona-operator-for-mongodb/backups-storage.html)
- Also there is a complete example for setting up a third party S3 backup here [Percona Operator for MongoDB Backup and Restore on S3-Compatible Storage - Backblaze](https://www.percona.com/blog/percona-operator-for-mongodb-backup-and-restore-on-s3-compatible-storage-backblaze/)

Would you like sharing your configuration for backups (without key and id)? The backup config needs to have the key and id encoded in base64

---

<div class="post-metadata">

**Author:** ![taglas\_tamas](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/taglas_tamas/32/12172_2.png) [@taglas\_tamas](https://forums.percona.com/u/taglas_tamas)\
**Post date:** [August 14, 2023, 10:56am UTC](https://forums.percona.com/t/percona-operator-with-bitnami-mongodb-sharded/24339/13 "2023-08-14T10:56:21Z")

</div>

Yes of course, I tried a lot of different solution to my current problem, but I’m stuck.

This is my on-demand backup which I use for testing:

```auto
apiVersion: psmdb.percona.com/v1
kind: PerconaServerMongoDBBackup
metadata:
  finalizers:
  - delete-backup
  name: backup-test
  namespace: experimental
spec:
  clusterName: percona-mongo-psmdb-d
  storageName: minio

```

I use this secret:

```auto
apiVersion: v1
kind: Secret
metadata:
  name: s3-secret
  namespace: experimental
type: Opaque
data:
  AWS_ACCES_KEY_ID: <minio-given-accesKey>
  AWS_ACCES_KEY_SECRET: <minio-given-secretKey>

```

And here is my server config:

```auto
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
  name: percona-mongo
  namespace: experimental
spec:
  chart:
    spec:
      chart: psmdb-db
      sourceRef:
        kind: HelmRepository
        name: percona
        namespace: experimental
  interval: 1m0s
  values:
    sharding:
      enabled: true
    backup:
      enabled: true
      storages:
        minio:
          type: s3
          s3:
            bucket: test-bucket
            region: <configured-region>
            credentialsSecret: s3-secret
            endpointUrl: <MinIO Endpoints>

```

The percona server’s backup-agent pods are giving me this error constantly, even though I followed every instruction, including JIRA tickets that said to upgrade version, I use version 1.14.0.

```auto
2023-08-14T10:55:13.000+0000 E [agentCheckup] check storage connection: storage check failed with: get S3 object header: NoCredentialProviders: no valid providers in chain. Deprecated.
	For verbose messaging see aws.Config.CredentialsChainVerboseErrors

```

I tried creating different acces keys in minio and using that, even tried changing the keys to lowercase as someone suggested, but nothing worked so far.
