This document contains a quickstart guide to build and deploy the operator locally.
This guide assumes that you have already prepared Python virtual env and installed the following tools:
- Create a local kubernetes cluster and start a local registry by running
./scripts/dev/setup_kind_cluster.sh -n test-cluster
- Alternatively create a local cluster and set current kubectl context to it.
./scripts/dev/setup_kind_cluster.sh -en test-cluster
- Run the following to get kind credentials and switch current context to the newly created cluster:
kind export kubeconfig --name test-cluster
# should return kind-test-cluster
kubectl config current-context
# should have test-cluster-control-plane node listed
kubectl get nodes
- If you didn't clone the repository with
--recurse-submodules
flag you will need to download the helm-chart submodule locally by running the following command:
git submodule update --init
- Build and deploy the operator:
# builds all required images and then deploys the operator
make all-images deploy
Note: this will build and push the operator at repo_url/mongodb-kubernetes-operator
, where repo_url
is extracted from the dev config file
-
Change the
image
field in the manager.yaml file to have the image you just built -
You can now deploy your resources following the docs