For the complete documentation index, see llms.txt. This page is also available as Markdown.

Configure Percona Server for MongoDB

Step-by-step guide to configure Harness SMP to connect with an external Percona MongoDB instance. Includes instructions for retrieving credentials, sharing secrets, and updating Helm configuration.

This guide explains how to deploy Percona Server for MongoDB (PSMDB) on Kubernetes using Helm charts and validate its integration with an external MongoDB client or platform by securely sharing secrets and configuring Helm values.

1. Add & Update Percona Helm Repository

helm repo add percona https://percona.github.io/percona-helm-charts/
helm repo update

For chart details and configuration options, refer to the official Percona Helm Charts documentation, specifically the psmdb-operator and psmdb-db charts.

2. Install the PSMDB Operator

helm install <OPERATOR-RELEASE-NAME> percona/psmdb-operator \   
--version 1.20.1 \   
--namespace <MONGO-NAMESPACE>

This should give you output similar to:

NAME: <OPERATOR-RELEASE-NAME>
LAST DEPLOYED: Thu Jul 24 15:44:48 2025
NAMESPACE: <MONGO-NAMESPACE>
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
1. Percona Operator for MongoDB is deployed.
  See if the operator Pod is running:

    kubectl get pods -l app.kubernetes.io/name=psmdb-operator --namespace <MONGO-NAMESPACE>

  Check the operator logs if the Pod is not starting:

    export POD=$(kubectl get pods -l app.kubernetes.io/name=psmdb-operator --namespace <MONGO-NAMESPACE> --output name)
    kubectl logs $POD --namespace=<MONGO-NAMESPACE>

2. Deploy the database cluster from psmdb-db chart:

    helm install <RELEASE-NAME> percona/psmdb-db --namespace=<MONGO-NAMESPACE>

Read more in our documentation: https://docs.percona.com/percona-operator-for-mongodb/

3. Deploy MongoDB Cluster

Deploy a development-ready PSMDB cluster using the following command. This setup disables backups and sharding for simplicity:

Backups and sharding are disabled in this setup to simplify the deployment for development or testing environments, where data durability and scalability are not critical concerns.

For production environments, it is strongly recommended enabling both backup.enabled=true and sharding.enabled=true to ensure data protection and horizontal scaling.

4. Retrieve MongoDB Admin Credentials and Connect to the Cluster

Use the admin credentials to verify that the MongoDB cluster is running correctly and can be accessed by external services.

Fetch the admin username and password from the Kubernetes secret:

Connect to the MongoDB cluster using the Percona client:

5. Share MongoDB Credentials with SMP Namespace

If your Harness SMP platform is running in a different namespace (but within the same Kubernetes cluster), follow these steps to copy the MongoDB user credentials:

Now, copy the MongoDB user secret to the SMP namespace:

  • This method works when both SMP and MongoDB are deployed in the same Kubernetes cluster.

  • If SMP is deployed in a different cluster, you'll need to manually create the secret manifest and apply it in the SMP cluster.

6. Update Helm Values for External MongoDB

To connect Harness SMP with your deployed Percona MongoDB cluster, update your override.yaml file with the external MongoDB configuration as shown below.

7. Apply Configuration and Upgrade SMP

Use the following command to apply your configuration and upgrade your SMP instance:

Last updated

Was this helpful?