Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maoertel/mongodb-atlas-k8s-operator
Small k8s Operator to create MongoDB Atlas users
https://github.com/maoertel/mongodb-atlas-k8s-operator
k8s-operator kubernetes mongodb mongodb-atlas operator rust
Last synced: 5 days ago
JSON representation
Small k8s Operator to create MongoDB Atlas users
- Host: GitHub
- URL: https://github.com/maoertel/mongodb-atlas-k8s-operator
- Owner: maoertel
- Created: 2024-06-17T07:38:29.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-06-21T18:08:49.000Z (5 months ago)
- Last Synced: 2024-06-22T10:27:28.981Z (5 months ago)
- Topics: k8s-operator, kubernetes, mongodb, mongodb-atlas, operator, rust
- Language: Rust
- Homepage:
- Size: 62.5 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MongoDB Atlas K8s Operator
As the orginal MongoDB Atlas K8s Operator is not taking Atlas users into account, I thought about writing my own
operator that handles this. And as there is already a lot of stuff out there for Golang, I decided to write it in Rust.It is in a POC state so a lot of happy path and things that are not handled yet, like:
- What happens to the passwords (send encrypted via email, put into Vault?)
- All the error handling regarding Atlas API
- Update the Status of the k8s resource## Use it
1. Create the CRD
```bash
kubectl create -f crds/atlasusers.yaml
```2. Start the operator
In the context of your choice, start the operator with the following command. You need to provide atlas MongoDB API key credentials.
```bash
cargo run --public-key --private-key
```3. Create a new MongoDB Atlas `AtlasUser` K8s resource
```bash
kubectl create -f crds/examples/john_doe.yaml
```What basically deployes something like that:
```yaml
apiVersion: moertel.com/v1
kind: AtlasUser
metadata:
name: johndoe
namespace: default
spec:
country: US
firstName: John
lastName: Doe
username: [email protected]
roles:
- orgId: "4723423423"
roleName: "ORG_OWNER"
```4. Check the created resource in your cluster
```bash
kubectl describe atlasusers johndoe
```