Skip to content

Latest commit

 

History

History
64 lines (43 loc) · 1.62 KB

build_operator_locally.md

File metadata and controls

64 lines (43 loc) · 1.62 KB

Quick start for building and deploy the operator locally

This document contains a quickstart guide to build and deploy the operator locally.

Prerequisites

This guide assumes that you have already installed the following tools:

Steps

  1. Create a local kubernetes cluster and start a local registry by running
./scripts/dev/setup_kind_cluster.sh
  1. Set the kind kubernetes context if you have not already done so:
export KUBECONFIG=~/.kube/kind
  1. Run the following to get kind credentials:
kind export kubeconfig
# check it worked by running:
kubectl cluster-info --context kind-kind --kubeconfig $KUBECONFIG
  1. 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

  1. Change the manager yaml file image field to have the image you just built

  2. You can now deploy your resources following the docs

Troubleshooting

If you run into an issue in step 1, you can try the following steps as workaround:

  1. Manually build the operator Dockerfile
python ./scripts/dev/dockerfile_generator.py > Dockerfile
  1. Build the image
docker build . -t localhost:5000/mongodb-kubernetes-operator
  1. Push the image
docker push localhost:5000/mongodb-kubernetes-operator