mongodb
by Arktec Quant
The most secure production-grade MongoDB CE chart using Wolfi Linux runtime image and hardened security defaults.
About this chart
MongoDB Helm Chart
MongoDB CE Helm chart using the Arktec Quant agentic-fabric-mongodb runtime image based on Wolfi Linux.
Supports both standalone and replica set architectures, with optional arbiter, hidden members, TLS, NetworkPolicies, metrics, and password rotation.
Version 1.0.17
This chart version uses MongoDB 8.2.3, which includes a security fix for CVE-2025-14847. Users are strongly encouraged to upgrade to this version to address the security vulnerability.
Prerequisites
- Kubernetes 1.23+
- Helm 3.8.0+
- Dynamic PV provisioner (or pre‑created PVCs)
Quickstart
Add the chart repository and install MongoDB as a standalone instance:
helm repo add arktec-quant https://charts.arktecquant.com/
helm repo update
helm install mongodb arktec-quant/mongodb \
--namespace mongodb \
--create-namespace \
--set auth.rootPassword="change-me"
To deploy a replica set:
helm install mongodb-rs arktec-quant/mongodb \
--namespace mongodb \
--create-namespace \
--set architecture=replicaset \
--set auth.rootPassword="change-me"
Uninstalling the Chart
To uninstall/delete a release:
helm uninstall mongodb -n mongodb
This removes all Kubernetes resources created by the chart.
Depending on your storage class and standalone.persistence.resourcePolicy / replicaset.persistence.resourcePolicy, PVCs may be retained.
Key Configuration Options
The most important values are summarized below. All defaults are defined in values.yaml; the full JSON schema for UIs is in values.schema.json.
| Parameter | Description | Default |
|---|---|---|
architecture | Deployment mode: standalone or replicaset | standalone |
image.tag | MongoDB image tag / version | "8.2.3" |
standalone.replicaCount | Pod count in standalone mode | 1 |
replicaset.replicaCount | Number of replica set data nodes | 2 |
replicaset.arbiter.enabled | Create arbiter node for elections | true |
replicaset.hidden.enabled | Enable hidden member (e.g. for backups) | false |
auth.enabled | Enable MongoDB authentication | true |
auth.rootUser | Root/admin username | "root" |
auth.rootPassword | Root password (ignored if auth.existingSecret set) | "" |
auth.existingSecret | Use existing Secret for auth credentials | "" |
standalone.persistence.size | PVC size for standalone | 8Gi |
replicaset.persistence.size | PVC size for each replica set member | 8Gi |
service.type | Internal service type (ClusterIP, NodePort, LoadBalancer) | ClusterIP |
externalService.enabled | Create external Service for clients outside the cluster | false |
metrics.enabled | Deploy metrics Service for Prometheus | false |
metrics.serviceMonitor.enabled | Create ServiceMonitor CRD (Prometheus Operator) | false |
tls.enabled | Enable TLS for MongoDB traffic (mounts cert Secret) | false |
security.networkPolicy.enabled | Create NetworkPolicy restricting traffic | true |
For all available options, including PDB, password rotation job, and affinity controls, refer to values.yaml.
Authentication
By default, authentication is enabled. You can:
- Provide credentials directly via values:
helm install mongodb arktec-quant/mongodb \
--set auth.rootPassword="strong-root-pass" \
--set auth.username="app" \
--set auth.password="strong-app-pass"
-
Or supply an existing Secret using
auth.existingSecret.
The Secret must provide the following (base64‑encoded) keys:mongodb-root-passwordmongodb-username(optional)mongodb-password(optional)mongodb-database(optional)
In that case, the chart will not create its own auth Secret.
Password sources and bootstrap Job
Password handling and user creation are driven by values.yaml:
- Root/admin credentials:
auth.rootUser– logical admin username (defaults toroot).- If
auth.existingSecretis empty, the chart creates*-authand writes:auth.rootPasswordinto the Secret keyauth.rootPasswordKey(default:mongodb-root-password).
- If
auth.existingSecretis set, the chart does not create the Secret and instead reads all credentials from that Secret using:auth.rootPasswordKeyfor the root password.auth.databasePasswordKeyfor the application user password (ifauth.username/auth.databaseare set).
- Metrics password:
- You can source the metrics exporter password from a Secret using
metrics.metricsPasswordKey(or reuseauth.metricsPasswordKey) instead of hard‑codingmetrics.password.
- You can source the metrics exporter password from a Secret using
To ensure the root user actually exists in MongoDB, the chart provides a one‑shot bootstrap Job:
- Controlled by
bootstrapJob.enabled(defaults totrue). - Uses an image with
mongosh(by defaultghcr.io/arktec-quant/agentic-fabric-mongodb-mongosh:2.5.10) to:- Wait for the MongoDB process to accept connections (treating
Unauthorizedas “mongod is up”). - Connect to the
admindatabase and createauth.rootUserwith the password from the configured Secret if the user does not already exist.
- Wait for the MongoDB process to accept connections (treating
- You can override its behavior via
bootstrapJob.command,bootstrapJob.image.*, and related fields invalues.yaml.
Persistence
- Standalone:
- PVC configured via
standalone.persistence.*(size, storageClass, accessModes, etc.).
- PVC configured via
- Replica set:
- Each member gets its own PVC via
replicaset.persistence.*. - Advanced behavior (retention when scaled/uninstalled) is controlled by
replicaset.persistence.persistentVolumeClaimRetentionPolicy.
- Each member gets its own PVC via
You can also bring your own PVCs using standalone.persistence.existingClaim.
Image & Supply Chain
This chart is built to work with the Arktec Quant agentic-fabric-mongodb image
(ghcr.io/arktec-quant/agentic-fabric-mongodb, see repo arktec-quant/agentic-fabric-mongodb).
Key characteristics of the underlying image (from agentic-fabric-mongodb):
- Wolfi/Chainguard base: minimal, hardened base image which significantly reduces CVE surface compared to general-purpose distros.
- Only official MongoDB binaries: fetched per-arch from upstream archives; no compilers, build toolchains or extra shells in the final image.
- Non‑root
mongodbuser: containers run as an unprivileged user by default; no hardcoded secrets or credentials in the image. - Small, explicit runtime dependency set: only required libs such as
openssl,cyrus-sasl,krb5,numactl,procps,lz4,libpcap. - Reproducible builds and rich OCI labels for traceability (
org.opencontainers.image.source,title,description,url,licenses, etc.).
For full details on image construction and security guarantees, see the upstream README:
https://github.com/arktec-quant/agentic-fabric-mongodb.
TLS
To enable TLS for MongoDB:
-
Create a Secret with
tls.crt,tls.key, andca.crt. -
Set:
tls: enabled: true existingSecret: mongodb-tls
The chart mounts the Secret at /certs; configure MongoDB TLS flags via extraFlags (see comments in values.yaml).
Security Posture
This chart is designed to complement the hardened image with secure Kubernetes defaults:
- Least‑privilege runtime:
- Pods run as a non‑root user/group (
security.pod.runAsUser,security.pod.runAsGroup,security.pod.fsGroup) and drop all capabilities by default. security.container.allowPrivilegeEscalation=false,security.container.privileged=false, andsecurity.container.seccompProfile=RuntimeDefault.
- Pods run as a non‑root user/group (
- Network isolation:
- When
security.networkPolicy.enabled=true, the chart installs aNetworkPolicythat restricts ingress/egress to the MongoDB port. - Additional selectors and
extraIngress/extraEgressrules allow you to explicitly control which namespaces and pods can reach MongoDB.
- When
- Secret-centric auth:
- Credentials are always sourced from Kubernetes
Secretobjects (either chart‑managed or viaauth.existingSecret). - This makes it easy to integrate with ExternalSecrets / secret stores while keeping the image free of embedded credentials.
- Credentials are always sourced from Kubernetes
- TLS‑ready:
- The TLS secret (
tls.existingSecret) is mounted into the pod, and you can configuremongodTLS behavior throughextraFlags.
- The TLS secret (
Together with the hardened agentic-fabric-mongodb image, this chart provides a secure baseline for running MongoDB in Agentic Fabric and general Kubernetes environments.
Secrets and user creation are explicitly chart‑driven and can be integrated with secret managers via auth.existingSecret, *_Key fields, and the bootstrapJob while keeping the runtime image free of baked‑in credentials.
Metrics
To expose Prometheus metrics:
metrics:
enabled: true
serviceMonitor:
enabled: true
This deploys a metrics Service and, optionally, a ServiceMonitor compatible with the Prometheus Operator.
Support
- Issues: GitHub Issues
- Repository: Arktec Quant Charts
- MongoDB Documentation: https://www.mongodb.com/docs/
License
This chart is licensed under the Apache-2.0 license.
Deploy mongodb with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has mongodb on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartmongodb is pinned at v1.0.17 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply