Skip to content

Commit 4b1ace8

Browse files
authored
a lot of readme updates (#89)
# Summary This pull request introduces significant updates to the MongoDB Kubernetes documentation and related files. The changes primarily focus on rebranding the project, improving documentation structure, and updating links to official resources. Below is a summary of the most important changes: ### Rebranding and Terminology Updates: * Updated project name from "MongoDB Community Kubernetes Operator" to "MongoDB Controllers for Kubernetes (MCK)" across documentation files, including `CONTRIBUTING.md`, `README.md`, and various subdirectory files. [[1]](diffhunk://#diff-eca12c0a30e25b4b46522ebf89465a03ba72a03f540796c979137931d8f92055R1-R7) [[2]](diffhunk://#diff-2d3cf7d8624f3294812ec9b260038a65c6d07bb000112d7cd3c3c4fbab994870L1-L10) [[3]](diffhunk://#diff-dc7a1cff3b4f510d1ec11b6ea1fd9b47c58b84e85caf642c40b96099a70c5cf0L1-L82) ### Documentation Enhancements: * Enhanced the `docs/mongodbcommunity/README.md` with a new "Supported Features" section, detailed Operator capabilities, and a "Linting" section listing tools used for code quality checks. * Reorganized the `docs/mongodbcommunity/contributing.md` file, removing outdated developer configuration and testing instructions to streamline contributing guidelines. ### Link and Resource Updates: * Updated outdated links in `README.md` and other files to point to the latest MongoDB Kubernetes documentation. For example, the link to the "official documentation" was updated to reflect the current version. These changes improve clarity, align the project with its new branding, and ensure that contributors and users have access to accurate and up-to-date resources.
1 parent 6efa7ab commit 4b1ace8

File tree

6 files changed

+53
-323
lines changed

6 files changed

+53
-323
lines changed

CONTRIBUTING.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Summary
2+
Contributing to the Mongodb Controllers for Kubernetes (MCK) project
3+
Pull requests are always welcome, and the MCK dev team appreciates any help the community can give to help make MongoDB better.
4+
5+
# PR Prerequisites
6+
* Please ensure you have signed our Contributor Agreement. You can find it [here](https://www.mongodb.com/legal/contributor-agreement).
7+
* Please ensure that all commits are signed.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ For **MongoDB Enterprise Advanced**, it supports:
1111
* Manages MongoDB Enterprise Advanced deployments in Kubernetes.
1212
* Integrates with MongoDB Ops Manager or Cloud Manager for advanced monitoring, backups, and automation.
1313
* Supports all MongoDB topologies: replica sets, standalone, and sharded clusters.
14-
For a full list of capabilities, see the [official documentation](https://www.mongodb.com/docs/kubernetes-operator/current/).
14+
For a full list of capabilities, see the [official documentation](https://www.mongodb.com/docs/kubernetes/current/).
1515

1616
For **MongoDB Community**, it supports:
1717
* Manages MongoDB Community Server [replica sets](https://www.mongodb.com/docs/manual/replication/)
File renamed without changes.

docs/mongodbcommunity/README.md

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,48 @@
1-
# MongoDB Community Kubernetes Operator Documentation #
1+
# MongoDB Controllers for Kubernetes (MCK) - Community #
22

3-
## Table of Contents
3+
<img align="right" src="https://mongodb-kubernetes-operator.s3.amazonaws.com/img/Leaf-Forest%402x.png">
4+
5+
This directory and readme cover use of the MongoDB Controllers for Kubernetes (MCK) Operator being used for running MongoDB Community into Kubernetes clusters.
6+
7+
If you are a MongoDB Enterprise customer and need Enterprise features such as Backup, see the [official documentation](https://www.mongodb.com/docs/kubernetes/current/) .
8+
9+
## Documentation
410

5-
- [Contribute to the MongoDB Kubernetes Operator](contributing.md)
11+
See the documentation to learn how to:
12+
13+
- [Install or upgrade](https://www.mongodb.com/docs/kubernetes/current/) the Operator
14+
- [Supported Features](#supported-features)
15+
- [Contribute](contributing.md)
616
- [MongoDB Community Kubernetes Operator Architecture](architecture.md)
7-
- [Deploy and Configure MongoDBCommunity Resources](deploy-configure.md)
17+
- [Configure Logging](logging.md) of the MongoDB resource components.
818
- [Configure Logging of the MongoDB components](logging.md)
9-
- [Create Database Users](users.md)
10-
- [Secure MongoDBCommunity Resources](secure.md)
19+
- [Create a database user](users.md) with SCRAM authentication.~~
20+
- [Secure MongoDB resource connections](secure.md) using TLS.
21+
22+
## Supported Features
23+
24+
The Operator support of MongoDB Community Edition includes the following:
25+
26+
- Create [replica sets](https://www.mongodb.com/docs/manual/replication/)
27+
- Upgrade and downgrade MongoDB server version
28+
- Scale replica sets up and down
29+
- Read from and write to the replica set while scaling, upgrading, and downgrading. These operations are done in an "always up" manner.
30+
- Report MongoDB server state via the [MongoDBCommunity resource](/config/crd/bases/mongodbcommunity.mongodb.com_mongodbcommunity.yaml) `status` field
31+
- Connect to the replica set from inside the Kubernetes cluster (no external connectivity)
32+
- Secure client-to-server and server-to-server connections with TLS
33+
- Create users with [SCRAM](https://www.mongodb.com/docs/manual/core/security-scram/) authentication
34+
- Create custom roles
35+
- Enable a [metrics target that can be used with Prometheus](prometheus/README.md)
36+
37+
## Linting
38+
39+
This project uses the following linters upon every Pull Request:
40+
41+
* `gosec` is a tool that find security problems in the code
42+
* `Black` is a tool that verifies if Python code is properly formatted
43+
* `MyPy` is a Static Type Checker for Python
44+
* `Kube-linter` is a tool that verified if all Kubernetes YAML manifests are formatted correctly
45+
* `Go vet` A built-in Go static checker
46+
* `Snyk` The vulnerability scanner
47+
48+
## Table of Contents

docs/mongodbcommunity/contributing.md

Lines changed: 1 addition & 234 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
1-
# Contributing to MongoDB Kubernetes Operator
1+
# Contributing to MongoDB Controllers for Kubernetes (MCK) - Community
22

33
First you need to get familiar with the [Architecture guide](architecture.md), which explains
44
from a high perspective how everything works together.
55

6-
After our experience building the [Enterprise MongoDB Kubernetes
7-
Operator](https://github.com/mongodb/mongodb-kubernetes), we have
8-
realized that it is very important to have a clean environment to work, and as such we have
9-
adopted a strategy that makes it easier for everyone to contribute.
10-
116
This strategy is based on using
127
[`envtest`](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/envtest) for setting up the tests
138
and `go test` for running the tests, and making the test-runner itself run as a Kubernetes Pod. This
@@ -45,231 +40,3 @@ each one of them in charge of some part of the lifecycle of the MongoDB database
4540
* Please ensure you have signed our Contributor Agreement. You can find it [here](https://www.mongodb.com/legal/contributor-agreement).
4641

4742
* Please ensure that all commits are signed.
48-
49-
## Developer Configuration
50-
51-
The operator is built using `golang`. We use a simple
52-
json file that describe some local options that you need to set for the testing environment
53-
to be able to run properly. Create a json file with the following content:
54-
55-
```json
56-
{
57-
"namespace": "mongodb",
58-
"repo_url": "localhost:5000",
59-
"operator_image": "mongodb-kubernetes-operator",
60-
"e2e_image": "community-operator-e2e",
61-
"version_upgrade_hook_image": "mongodb-kubernetes-operator-version-upgrade-post-start-hook",
62-
"agent_image": "mongodb-agent-ubi-dev",
63-
"readiness_probe_image": "mongodb-kubernetes-readinessprobe",
64-
"s3_bucket": ""
65-
}
66-
```
67-
68-
#### Config Options
69-
70-
1. `namespace` is the namespace that will be used by scripts/tooling. All the resources will be deployed here.
71-
2. `repo_url` the repository that should be used to push/pull all images.
72-
3. `operator_image` will be used as the name of the operator deployment, and the name of the operator image when build.
73-
4. `e2e_image` the name of e2e test image that will be built.
74-
5. `version_upgrade_hook_image` the name of the version upgrade post start hook image.
75-
6. `agent_image` the name of the agent image.
76-
7. `s3_bucket` the S3 bucket that Dockerfiles will be pushed to as part of the release process. Note: this is only required when running the release tasks locally.
77-
78-
79-
You can set the `MONGODB_COMMUNITY_CONFIG` environment variable to be the absolute path of this file.
80-
It will default to `~/.community-operator-dev/config.json`
81-
82-
Please see [here](./build_operator_locally.md) to see how to build and deploy the operator locally.
83-
84-
## Configure Docker registry
85-
86-
The build process consists of multiple Docker images being built. You need to specify
87-
where you want the locally built images to be pushed. The Docker registry needs to be
88-
accessible from your Kubernetes cluster.
89-
90-
### Local kind cluster
91-
For local testing you can use a [local Kind cluster](build_operator_locally.md#steps).
92-
93-
## Test Namespace
94-
95-
You can change the namespace used for tests, if you are using `Kind`, for
96-
instance, you can leave this as `mongodb`.
97-
98-
## Python Environment
99-
100-
The test runner is a Python script, in order to use it a virtualenv needs to be
101-
created.
102-
103-
**Python 3.9 is not supported yet. Please use Python 3.8.**
104-
105-
### Pip
106-
```sh
107-
python -m venv venv
108-
source venv/bin/activate
109-
python -m pip install -r requirements.txt
110-
```
111-
112-
### Pipenv
113-
114-
* create a python environment and install dependencies.
115-
```bash
116-
pipenv install -r requirements.txt
117-
```
118-
119-
* activate the python environment.
120-
```bash
121-
pipenv shell
122-
```
123-
124-
125-
# Deploying the Operator
126-
127-
In order to deploy the Operator from source, you can run the following command.
128-
129-
```sh
130-
make operator-image deploy
131-
```
132-
133-
This will build and deploy the operator to namespace specified in your configuration file.
134-
135-
If you are using a local docker registry you should run the following command.
136-
The additional `IMG_BUILD_ARGS=--insecure` variable will add the `--insecure` flag to the command creating the manifests.
137-
This is necessary if your local registry is not secure. Read more about the flag on the [documentatio](https://docs.docker.com/reference/cli/docker/manifest/#working-with-insecure-registries)
138-
139-
```sh
140-
IMG_BUILD_ARGS=--insecure make operator-image deploy
141-
```
142-
143-
144-
#### See the operator deployment
145-
```sh
146-
kubectl get pods
147-
```
148-
149-
#### (Optional) Create a MongoDBCommunity Resource
150-
151-
Follow the steps outlined [here](./deploy-configure.md) to deploy some resources.
152-
153-
#### Cleanup
154-
To remove the operator and any created resources you can run
155-
156-
```sh
157-
make undeploy
158-
```
159-
160-
Alternatively, you can run the operator locally. Make sure you follow the steps outlined in [run-operator-locally.md](run-operator-locally.md)
161-
162-
```sh
163-
make run
164-
```
165-
166-
# Running Tests
167-
168-
### Unit tests
169-
170-
Unit tests should be run from the root of the project with:
171-
172-
```sh
173-
make test
174-
```
175-
176-
### E2E Tests
177-
178-
If this is the first time running E2E tests, you will need to ensure that you have built and pushed
179-
all images required by the E2E tests. You can do this by running the following command,
180-
or with the additional `IMG_BUILD_ARGS=--insecure` described above.
181-
182-
```sh
183-
make all-images
184-
```
185-
186-
For subsequent tests you can use
187-
188-
```sh
189-
make e2e-k8s test=<test-name>
190-
```
191-
192-
This will only re-build the e2e test image. Add `IMG_BUILD_ARGS=--insecure` if necessary
193-
194-
We have built a simple mechanism to run E2E tests on your cluster using a runner
195-
that deploys a series of Kubernetes objects, runs them, and awaits for their
196-
completion. If the objects complete with a Success status, it means that the
197-
tests were run successfully.
198-
199-
The available tests can be found in the `tests/e2e` directory, at the time of this
200-
writing we have:
201-
202-
```sh
203-
$ ls -l test/e2e
204-
replica_set
205-
replica_set_change_version
206-
replica_set_readiness_probe
207-
replica_set_scale
208-
...
209-
```
210-
211-
The tests should run individually using the runner like this, or additionally with `IMG_BUILD_ARGS=--insecure`:
212-
213-
```sh
214-
make e2e-k8s test=replica_set
215-
```
216-
217-
This will run the `replica_set` E2E test which is a simple test which installs a
218-
MongoDB Replica Set and asserts that the deployed server can be connected to.
219-
220-
### Run the test locally with go test & Telepresence
221-
```sh
222-
make e2e-telepresence test=<test-name>
223-
```
224-
225-
This method uses telepresence to allow connectivity as if your local machine is in the kubernetes cluster,
226-
there will be full MongoDB connectivity using `go test` locally.
227-
228-
Note: you must install [telepresence](https://www.getambassador.io/docs/telepresence/latest/quick-start/) before using this method.
229-
230-
If on MacOS, you can run `make install-prerequisites-macos` which will perform the installation.
231-
232-
### Running with Github Actions
233-
234-
Run a single test
235-
236-
```sh
237-
make e2e-gh test=<test-name>
238-
```
239-
240-
Run all tests.
241-
242-
* Navigate to the Actions tab on the github repo
243-
* `Run E2E` > `Run Workflow` > `Your Branch`
244-
245-
Note: the code must be pushed to a remote branch before this will work.
246-
247-
248-
## Troubleshooting
249-
When you run a test locally, if the `e2e-test` pod is present, you will have to
250-
first manually delete it; failing to do so will cause the `e2e-test` pod to fail.
251-
252-
# Writing new E2E tests
253-
254-
You can start with the `replica_set` test as a starting point to write a new test.
255-
The tests are written using `envtest` and they are run using `go test`.
256-
257-
Adding a new test is as easy as creating a new directory in `test/e2e` with the
258-
new E2E test, and to run them:
259-
260-
```sh
261-
make e2e test=<test-name>
262-
```
263-
264-
# Before Committing your code
265-
266-
## Set up pre-commit hooks
267-
To set up the pre-commit hooks, please create symbolic links from the provided [hooks](https://github.com/mongodb/mongodb-kubernetes-operator/tree/master/scripts/git-hooks):
268-
269-
* Navigate to your `.git/hooks` directory:
270-
271-
`cd .git/hooks`
272-
273-
* Create a symlink for every file in the `scripts/git-hooks` directory:
274-
275-
`ln -s -f ../../scripts/git-hooks/* .`

0 commit comments

Comments
 (0)