Skip to main content

MongoDB

Document-oriented NoSQL database with ARM64 support.

CategoryDatabases
Deploy./uis deploy mongodb
Undeploy./uis undeploy mongodb
Depends onNone
Required byNone
Imagemongo:8.0.5
Default namespacedefault

What It Does

MongoDB provides a document database for applications that need flexible JSON-like storage. It is deployed as a StatefulSet (not via Helm) with authentication enabled and automatic user initialization. MongoDB is currently pre-configured with a Gravitee application user, though this coupling is planned to be removed.

Deploy

./uis deploy mongodb

No dependencies.

Verify

# Quick check
./uis verify mongodb

# Manual check
kubectl get pods -n default -l app=mongodb

# Test connection
kubectl exec -it mongodb-0 -- mongosh --quiet --eval "db.adminCommand('ping')"

Configuration

MongoDB configuration is in manifests/040-mongodb-config.yaml. Key settings:

SettingValueNotes
ArchitectureStatefulSetSingle replica, not Helm-based
Storage8Gi PVCPersistent data
Port27017Standard MongoDB port
AuthEnabledRoot credentials from secrets
Memory256Mi request, 1Gi limit

Secrets

VariableFilePurpose
DEFAULT_MONGODB_ROOT_USER.uis.secrets/secrets-config/default-secrets.envRoot admin username
DEFAULT_MONGODB_ROOT_PASSWORD.uis.secrets/secrets-config/default-secrets.envRoot admin password

Key Files

FilePurpose
manifests/040-mongodb-config.yamlStatefulSet, Service, ConfigMaps, PVC
ansible/playbooks/040-setup-mongodb.ymlDeployment playbook
ansible/playbooks/040-remove-database-mongodb.ymlRemoval playbook

Undeploy

./uis undeploy mongodb

Troubleshooting

Pod won't start:

kubectl describe pod mongodb-0
kubectl logs mongodb-0

Authentication failed:

kubectl exec -it mongodb-0 -- mongosh --username root --password \
--authenticationDatabase admin --eval "db.runCommand({connectionStatus:1})"

PVC not bound:

kubectl get pvc -l app=mongodb
kubectl describe pvc mongodb-data-mongodb-0

Learn More