Home > Storage > PowerFlex > White Papers > Dell APEX Block Storage for AWS: MongoDB using Kubernetes and PowerFlex CSI > MongoDB sharded cluster deployment
The MongoDB sharded deployment is done using helm installation method. For more information about the MongoDB sharded deployment, see Deploy sharded cluster.
To install MongoDB on a PowerFlex deployment running on AWS:
helm repo add bitnami https://charts.bitnami.com/bitnami
Run the following command to locally pull the chart, this chart uses MongoDB version 4.4.13:
helm pull bitnami/mongodb-sharded --version=4.0.18
For a production-like environment using the Helm installation method, it is recommended to create a dbuser other than root and perform the operation with a non-root db user instead of a root user. Create configmap and pass it to the Helm Chart initScripts so that each pod creates a non-root db user:
sleep(1000);
db.getSiblingDB('ycsb').createUser({ user: 'mongodb', pwd: 'mongodb123', roles: [{role: 'dbOwner', db: 'ycsb'}] });
Note: You can change the username, roles, and permissions for the dbuser as required.
kubectl -n mongodb create configmap mongo-configmap --from-file=configmap.js
initScriptsCM: mongo-configmap
helm install ebs /home/ec2-user/mongodb-sharded -f values.yaml --namespace=mongodb --set global.storageClass=vxflexos-xfs --set mongodbRootPassword=mongodb123 --set volumePermissions.enabled=true --set replicaSet.enabled=true --set shards=8 --set confgsvr.replicas=1 --set configsvr.persistence.size=150Gi --set mongos.replicas=1 --set shardsvr.dataNode.replicas=1 --set shardsvr.persistence.size=1.5Ti --set shardsvr.dataNode.resources.requests.memory=72Gi --set shardsvr.dataNode.resources.requests.cpu=24 --set configsvr.resources.requests.memory=16Gi --set mongos.resources.requests.memory=16Gi --version=4.0.18
The MongoDB sharded cluster pods are uniformly distributed across all worker nodes, as shown in the following figure:
As seen in the preceding figure, the MongoDB sharded cluster deployment contains:
YCSB is a benchmark tool; ycsb pods are created to generate a massive workload for different types of read and write operations. For more information about YCSB, see the YCSB tool.