{"id":22174902,"url":"https://github.com/knappek/mongodbatlas-operator","last_synced_at":"2025-07-26T15:32:13.744Z","repository":{"id":122289201,"uuid":"185866179","full_name":"Knappek/mongodbatlas-operator","owner":"Knappek","description":"A Kubernetes Operator for MongoDB Atlas: https://www.mongodb.com/cloud/atlas","archived":false,"fork":false,"pushed_at":"2020-10-29T20:45:29.000Z","size":148412,"stargazers_count":14,"open_issues_count":16,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-21T09:47:15.270Z","etag":null,"topics":["gitops","golang","kubernetes","kubernetes-crd","mongodb-atlas","operator"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Knappek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-09T20:22:22.000Z","updated_at":"2024-06-21T07:16:43.000Z","dependencies_parsed_at":"2024-06-20T07:54:00.557Z","dependency_job_id":"865a79ec-f92d-44a2-b23e-5db5490377da","html_url":"https://github.com/Knappek/mongodbatlas-operator","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Knappek%2Fmongodbatlas-operator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Knappek%2Fmongodbatlas-operator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Knappek%2Fmongodbatlas-operator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Knappek%2Fmongodbatlas-operator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Knappek","download_url":"https://codeload.github.com/Knappek/mongodbatlas-operator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227692782,"owners_count":17805175,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gitops","golang","kubernetes","kubernetes-crd","mongodb-atlas","operator"],"created_at":"2024-12-02T07:54:43.827Z","updated_at":"2024-12-02T07:54:44.612Z","avatar_url":"https://github.com/Knappek.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MongoDB Atlas Kubernetes Operator\n\n[![Build Status](https://cloud.drone.io/api/badges/Knappek/mongodbatlas-operator/status.svg)](https://cloud.drone.io/Knappek/mongodbatlas-operator)\n[![Go Report Card](https://goreportcard.com/badge/github.com/Knappek/mongodbatlas-operator)](https://goreportcard.com/report/github.com/Knappek/mongodbatlas-operator)\n[![codecov](https://codecov.io/gh/Knappek/mongodbatlas-operator/branch/master/graph/badge.svg)](https://codecov.io/gh/Knappek/mongodbatlas-operator)\n\n## Overview\n\nA Kubernetes Operator for [MongoDB Atlas](https://www.mongodb.com/cloud/atlas) with which you can manage your MongoDB Atlas projects and clusters from within Kubernetes such as you do with your containerized applications. It is built using the [Operator Framework](https://github.com/operator-framework) and [Kubernetes Custom Resource Definitions (CRDs)](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/#customresourcedefinitions).\n\nThis project was inspired from the [MongoDB Atlas Terraform Provider](https://github.com/akshaykarle/terraform-provider-mongodbatlas) with the goal to have Kubernetes as the single source for both your (stateless) applications and MongoDB Atlas as the persistence layer. The benefit over using the Terraform provider is that `mongodbatlas-operator` ensures via Reconcile loops to have the desired state matching with the actual state and thus following the GitOps approach.\n\n![](docs/mongodbatlas-operator-example.gif)\n\n\u003c!-- vim-markdown-toc GFM --\u003e\n\n* [Scope](#scope)\n* [Prerequisites](#prerequisites)\n* [Getting Started](#getting-started)\n  * [Deploy Operator](#deploy-operator)\n  * [Create a MongoDB Atlas Project](#create-a-mongodb-atlas-project)\n  * [Create a Cluster](#create-a-cluster)\n  * [List all MongoDB Atlas resources](#list-all-mongodb-atlas-resources)\n* [Cleanup](#cleanup)\n* [Contributing](#contributing)\n\n\u003c!-- vim-markdown-toc --\u003e\n\n## Scope\n\n**Currently it supports**:\n\n* Create/Delete MongoDB Atlas Projects\n* Create/Update/Delete MongoDB Atlas Clusters\n* Create/Update/Delete MongoDB Atlas Database Users\n* Create/Update/Delete MongoDB Atlas Alert Configurations\n\n## Prerequisites\n\n* A running Kubernetes cluster, for example [Minikube](https://github.com/kubernetes/minikube) or [kind](https://github.com/kubernetes-sigs/kind)\n* A MongoDB Atlas Account\n* [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)\n\n## Getting Started\n\nThis example creates a MongoDB Atlas project and a cluster inside this project.\n\n### Deploy Operator\n\nFirst, create the MongoDB Atlas project CRD and some RBAC:\n\n```shell\nkubectl create -f deploy/service_account.yaml\nkubectl create -f deploy/role.yaml\nkubectl create -f deploy/role_binding.yaml\nkubectl create -f deploy/crds/knappek_v1alpha1_mongodbatlasproject_crd.yaml\nkubectl create -f deploy/crds/knappek_v1alpha1_mongodbatlascluster_crd.yaml\n```\n\nCreate a Kubernetes secret containing the Private Key of the [MongoDB Atlas Programmatic API Key](https://docs.atlas.mongodb.com/configure-api-access/#programmatic-api-keys)\n\n```shell\nkubectl create secret generic example-monogdb-atlas-project \\\n    --from-literal=privateKey=xxxxxxxxx\n```\n\nAdapt the environment variable `ATLAS_PUBLIC_KEY` in [operator.yaml](./deploy/operator.yaml) to your public key.\n\nDeploy the MongoDB Atlas Project Operator:\n\n```shell\nkubectl apply -f deploy/operator.yaml\n```\n\n### Create a MongoDB Atlas Project\n\nAdapt [knappek_v1alpha1_mongodbatlasproject_cr.yaml](./deploy/crds/knappek_v1alpha1_mongodbatlasproject_cr.yaml) accordingly and deploy your first MongoDB Atlas Project\n\n```shell\nkubectl apply -f deploy/crds/knappek_v1alpha1_mongodbatlasproject_cr.yaml\n```\n\n### Create a Cluster\n\nAdapt [knappek_v1alpha1_mongodbatlascluster_cr.yaml](./deploy/crds/knappek_v1alpha1_mongodbatlascluster_cr.yaml) accordingly and deploy your first MongoDB Atlas Cluster\n\n```shell\nkubectl apply -f deploy/crds/knappek_v1alpha1_mongodbatlascluster_cr.yaml\n```\n\n### List all MongoDB Atlas resources\n\nYou can easily list all MongoDB Atlas related resources with\n\n```shell\nkubectl get mongodbatlas\n```\n\n## Cleanup\n\n```shell\nkubectl delete -f deploy/crds/knappek_v1alpha1_mongodbatlascluster_cr.yaml\nkubectl delete -f deploy/crds/knappek_v1alpha1_mongodbatlasproject_cr.yaml\nkubectl delete -f deploy/\nkubectl delete -f deploy/crds/\n```\n\n## Environment Variables\n\nYou can specify the following environment variables in the Operator's [operator.yaml](./deploy/operator.yaml):\n\n\n| Name | Description | Default | Required |\n|------|-------------|---------|----------|\n| WATCH_NAMESPACE | The namespace which the operator should watch for MongoDBAtlas CRDs. | `metadata.namespace` | yes |\n| POD_NAME | Operator pod name. | `metadata.name` | no |\n| OPERATOR_NAME | Operator name. | n/a | no |\n| ATLAS_PRIVATE_KEY | The private key of the Atlas API. | n/a | yes |\n| ATLAS_PUBLIC_KEY | The private key of the Atlas API. | n/a | yes |\n| RECONCILIATION_TIME | Time in seconds which should be used to periodically reconcile the actual status in MongoDB Atlas with the current status in the corresponding Kubernetes CRD. | `\"120\"` | no |\n\n## Contributing\n\nI am working on this project in my spare time, hence feature development and release cycles could be improved ;). Contributors are welcome!\n\nRead through the [Contributing Guidelines and Code of Conduct](./CONTRIBUTING.md).\n\nMore information how to contribute/develop can be found in the [docs](./docs/CONTRIBUTING.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknappek%2Fmongodbatlas-operator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknappek%2Fmongodbatlas-operator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknappek%2Fmongodbatlas-operator/lists"}