mongodb

by Arktec Quant

Helm chartv1.0.17App 8.2.3Verified publisher

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.

ParameterDescriptionDefault
architectureDeployment mode: standalone or replicasetstandalone
image.tagMongoDB image tag / version"8.2.3"
standalone.replicaCountPod count in standalone mode1
replicaset.replicaCountNumber of replica set data nodes2
replicaset.arbiter.enabledCreate arbiter node for electionstrue
replicaset.hidden.enabledEnable hidden member (e.g. for backups)false
auth.enabledEnable MongoDB authenticationtrue
auth.rootUserRoot/admin username"root"
auth.rootPasswordRoot password (ignored if auth.existingSecret set)""
auth.existingSecretUse existing Secret for auth credentials""
standalone.persistence.sizePVC size for standalone8Gi
replicaset.persistence.sizePVC size for each replica set member8Gi
service.typeInternal service type (ClusterIP, NodePort, LoadBalancer)ClusterIP
externalService.enabledCreate external Service for clients outside the clusterfalse
metrics.enabledDeploy metrics Service for Prometheusfalse
metrics.serviceMonitor.enabledCreate ServiceMonitor CRD (Prometheus Operator)false
tls.enabledEnable TLS for MongoDB traffic (mounts cert Secret)false
security.networkPolicy.enabledCreate NetworkPolicy restricting traffictrue

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-password
    • mongodb-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 to root).
    • If auth.existingSecret is empty, the chart creates *-auth and writes:
      • auth.rootPassword into the Secret key auth.rootPasswordKey (default: mongodb-root-password).
    • If auth.existingSecret is set, the chart does not create the Secret and instead reads all credentials from that Secret using:
      • auth.rootPasswordKey for the root password.
      • auth.databasePasswordKey for the application user password (if auth.username/auth.database are set).
  • Metrics password:
    • You can source the metrics exporter password from a Secret using metrics.metricsPasswordKey (or reuse auth.metricsPasswordKey) instead of hard‑coding metrics.password.

To ensure the root user actually exists in MongoDB, the chart provides a one‑shot bootstrap Job:

  • Controlled by bootstrapJob.enabled (defaults to true).
  • Uses an image with mongosh (by default ghcr.io/arktec-quant/agentic-fabric-mongodb-mongosh:2.5.10) to:
    1. Wait for the MongoDB process to accept connections (treating Unauthorized as “mongod is up”).
    2. Connect to the admin database and create auth.rootUser with the password from the configured Secret if the user does not already exist.
  • You can override its behavior via bootstrapJob.command, bootstrapJob.image.*, and related fields in values.yaml.

Persistence

  • Standalone:
    • PVC configured via standalone.persistence.* (size, storageClass, accessModes, etc.).
  • Replica set:
    • Each member gets its own PVC via replicaset.persistence.*.
    • Advanced behavior (retention when scaled/uninstalled) is controlled by replicaset.persistence.persistentVolumeClaimRetentionPolicy.

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 mongodb user: 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:

  1. Create a Secret with tls.crt, tls.key, and ca.crt.

  2. 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, and security.container.seccompProfile=RuntimeDefault.
  • Network isolation:
    • When security.networkPolicy.enabled=true, the chart installs a NetworkPolicy that restricts ingress/egress to the MongoDB port.
    • Additional selectors and extraIngress / extraEgress rules allow you to explicitly control which namespaces and pods can reach MongoDB.
  • Secret-centric auth:
    • Credentials are always sourced from Kubernetes Secret objects (either chart‑managed or via auth.existingSecret).
    • This makes it easy to integrate with ExternalSecrets / secret stores while keeping the image free of embedded credentials.
  • TLS‑ready:
    • The TLS secret (tls.existingSecret) is mounted into the pod, and you can configure mongod TLS behavior through extraFlags.

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

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.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartmongodb is pinned at v1.0.17 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. 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