This document contains a quickstart guide to build and deploy the operator locally.
This guide assumes that you have already installed the following tools:
- Create a local kubernetes cluster and start a local registry by running
./scripts/dev/setup_kind_cluster.sh
- Set the kind kubernetes context if you have not already done so:
export KUBECONFIG=~/.kube/kind
- Run the following to get kind credentials:
kind export kubeconfig
# check it worked by running:
kubectl cluster-info --context kind-kind --kubeconfig $KUBECONFIG
- Build and deploy the operator:
python ./scripts/dev/build_and_deploy_operator.py
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 manager yaml file
image
field to have the image you just built -
You can now deploy your resources following the docs
If you run into an issue in step 1, you can try the following steps as workaround:
- Manually build the operator Dockerfile
python ./scripts/dev/dockerfile_generator.py > Dockerfile
- Build the image
docker build . -t localhost:5000/mongodb-kubernetes-operator
- Push the image
docker push localhost:5000/mongodb-kubernetes-operator