Before you install the MongoDB Community Kubernetes Operator, you must:
- Install kubectl.
- Have a Kubernetes solution available to use. If you need a Kubernetes solution, see the Kubernetes documentation on picking the right solution. For testing, MongoDB recommends Kind.
- Clone this repository.
git clone https://github.com/mongodb/mongodb-kubernetes-operator.git
The MongoDB Community Kubernetes Operator is a Custom Resource Definition and a controller.
To install the MongoDB Community Kubernetes Operator:
-
Change to the directory in which you cloned the repository.
-
Install the Custom Resource Definitions.
a. Invoke the following
kubectl
command:kubectl create -f deploy/crds/mongodb.com_mongodb_crd.yaml
b. Verify that the Custom Resource Definitions installed successfully:
kubectl get crd/mongodb.mongodb.com
-
Install the Operator.
a. Invoke the following
kubectl
command to install the Operator in the specified namespace:kubectl create -f deploy/ --namespace <my-namespace>
b. Verify that the Operator installed successsfully:
kubectl get pods --namespace <my-namespace>
To upgrade the MongoDB Community Kubernetes Operator:
- Change to the directory in which you cloned the repository.
- Invoke the following
kubectl
command to upgrade the Custom Resource Definitions.kubectl apply -f deploy/crds/mongodb.com_mongodb_crd.yaml