Last changed
Contact our team to test out this image for free. Please also indicate any other images you would like to evaluate.
Chainguard's MongoDB Kubernetes Operator image enables you to deploy a MongoDB community instance to a Kubernetes cluster, as well as support replica sets, scaling the replicas up or down, version upgrades, custom roles, and TLS security.
Chainguard Containers are regularly-updated, secure-by-default container images.
For those with access, this container image is available on cgr.dev
:
Be sure to replace the ORGANIZATION
placeholder with the name used for your organization's private repository within the Chainguard Registry.
Chainguard's MongoDB Kubernetes Operator image is comparable to the MongoDB Kubernetes Operator image maintained by MongoDB.
Chainguard's MongoDB Kubernetes Operator expects /bin/sh
to be available in the MongoDB container image. If you're not using the -dev
variant, you'll need to ensure your MongoDB image includes bash
or a bash-binsh
symlink to provide compatibility.
For TLS to work with our FIPS image, we had to add a patch to swap MD5 with SHA-256, since using MD5 caused a crash due to OpenSSL rejecting unsupported algorithms under FIPS mode (EVP_DigestInit_ex
failure from md5Hex
in SCRAM credential generation).
Note that the upstream image runs the container as uid=2000
and gid=0
, but we've verified that the image works correctly with uid=65532
and gid=65532
, so we've configured it to run as non-root.
Additionally, the upstream components of the MongoDB Kubernetes Operator use different versioning schemes. For example, the main operator uses versions like 0.12.x
, while the version hook component uses 1.0.x
. You can see this in the upstream release.json
. In contrast, Chainguard images for all related components (e.g., the operator and version hook) will share the same tag, aligned with the main operator version. This is due to our Git-based automation, and because upstream does not provide separate Git tags for components like the version hook (see tags). While this differs from upstream's tagging scheme, all components are still built from the same source and version-aligned internally. Be aware that users will not see separate tags per component.
To get started with Chainguard's MongoDB Kubernetes Operator image, begin by installing the CRDs:
To launch the MongoDB Kubernetes Operator in a Docker container, use the following command:
To deploy the MongoDB Kubernetes Operator in your cluster, create the required service account and role:
Next, create a deployment manifest that will deploy the operator with the Chainguard image:
Finally, apply the service account and deployment:
Add the cert-manager
repository to your helm
repository list and ensure it's up to date:
Install cert-manager
:
Create a TLS-secured MongoDBCommunity resource:
Install mkcert and generate a certificat authority:
Run the following command and note the location of the generated root CA key and cert:
Use the files that you found in the previous step. For example if the location is /root/.local/share/mkcert
:
Create the Cert Manager issuer and secret:
Deploy MongoDB:
Wait for the replicaset to be available. Once kubectl wait mongodbcommunity/mongodb-replica-set --for=jsonpath='{.status.phase}'=Running
becomes available, you can get your connection string, username, and password by running the following:
This is an example to connect to the MongoDB cluster with Mongo shell. Use the CA from mkcert
and the certificate from the previous step.
Chainguard's free tier of Starter container images are built with Wolfi, our minimal Linux undistro.
All other Chainguard Containers are built with Chainguard OS, Chainguard's minimal Linux operating system designed to produce container images that meet the requirements of a more secure software supply chain.
The main features of Chainguard Containers include:
For cases where you need container images with shells and package managers to build or debug, most Chainguard Containers come paired with a development, or -dev
, variant.
In all other cases, including Chainguard Containers tagged as :latest
or with a specific version number, the container images include only an open-source application and its runtime dependencies. These minimal container images typically do not contain a shell or package manager.
Although the -dev
container image variants have similar security features as their more minimal versions, they include additional software that is typically not necessary in production environments. We recommend using multi-stage builds to copy artifacts from the -dev
variant into a more minimal production image.
To improve security, Chainguard Containers include only essential dependencies. Need more packages? Chainguard customers can use Custom Assembly to add packages, either through the Console, chainctl
, or API.
To use Custom Assembly in the Chainguard Console: navigate to the image you'd like to customize in your Organization's list of images, and click on the Customize image button at the top of the page.
Refer to our Chainguard Containers documentation on Chainguard Academy. Chainguard also offers VMs and Libraries — contact us for access.
This software listing is packaged by Chainguard. The trademarks set forth in this offering are owned by their respective companies, and use of them does not imply any affiliation, sponsorship, or endorsement by such companies.
Chainguard container images contain software packages that are direct or transitive dependencies. The following licenses were found in the "latest" tag of this image:
Apache-2.0
GCC-exception-3.1
GPL-2.0-or-later
GPL-3.0-or-later
LGPL-2.1-or-later
MIT
MPL-2.0
For a complete list of licenses, please refer to this Image's SBOM.
Software license agreementThis is a FIPS validated image for FedRAMP compliance.
This image is STIG hardened and scanned against the DISA General Purpose Operating System SRG with reports available.
Learn more about STIGsGet started with STIGs