Docs Menu
Docs Home
/
MongoDB Controllers for Kubernetes Operator
/

Migrate to Kubernetes Operator

Follow the steps for your deployment type to begin managing your MongoDB Enterprise and Ops Manager deployments with Kubernetes Operator instead of the MongoDB Enterprise Kubernetes Operator.

Follow these steps to migrate in most deployment scenarios. If you are using Operator Lifecycle Manager (OLM) to manage your operator deployments (typically on OpenShift clusters), see these steps instead.

1
2

This prevents both it and Kubernetes Operator from running in parallel.

3

Perform the following two tasks if you have deployed resources across multiple Kubernetes clusters:

  1. Back up the kubectl plug-in binary. This makes it easier for you to reverse the migration to Kubernetes Operator if you encounter problems.

  2. Configure the member clusters by either following the multi-cluster setup documentation (ensuring that you use the kubectl plugin from the MongoDB Controllers for Kubernetes Operator release) or manually using Helm templating.

    Important

    Kubernetes Operator's RBACs must be deployed to the member clusters before deploying Kubernetes Operator in step 5. The new RBAC resources begin with mongodb-kubernetes-operator-. You must also ensure that the mongodb-kubernetes-operator-member-list is present on your operator cluster after running the newest version of the kubectl plug-in binary.

4
kubectl apply -f https://raw.githubusercontent.com/mongodb/mongodb-kubernetes/1.0.0/public/crds.yaml

To verify that the CRDs are installed on your Kubernetes cluster, search for the mongodbcommunity CRD:

Tip

The custom resource names for Ops Manager and MongoDB Enterprise have not changed in Kubernetes Operator. Though you might not have MongoDB Community resources deployed, searching for mongodbcommunity custom resources is the simplest way to verify installation of the Kubernetes Operator.

kubectl get crds | grep mongodbcommunity
5

Warning

If you have overridden the default Helm chart values for your Enterprise Kubernetes Operator deployment, you should not use the same values for your Kubernetes Operator deployment as resource names could collide and prevent the migration from succeeding.

helm repo add mongodb https://mongodb.github.io/helm-charts && \
helm repo update && \
helm upgrade --install mongodb-kubernetes-operator mongodb/mongodb-kubernetes --namespace <your-namespace>
6

Kubernetes Operator applies updated images, ServiceAccounts, and other resources.

Important

This step triggers a rolling restart of deployed Pods, as the RBAC names have changed from the MongoDB Enterprise Kubernetes Operator to the Kubernetes Operator.

7

Kubernetes Operator deploys one operator replica by default. If you want to run more than one replica, see https://github.com/mongodb/mongodb-kubernetes/blob/master/public/mongodb-kubernetes.yaml#L263 for details on scaling up the operator.

8

You can now remove the Helm chart for the MongoDB Enterprise Kubernetes Operator, as well as the RBACs on all Kubernetes clusters and any backed-up kubectl plug-in binaries.

If you have deployed resources across multiple Kubernetes clusters, you can now safely remove the mongodb-enterprise from the member clusters and delete your backed-up kubectl plug-in binary.

To migrate from the MongoDB Enterprise Kubernetes Operator to the Kubernetes Operator using OLM (the typical deployment method on OpenShift clusters, but also possible on other Kubernetes platforms), uninstall the old operator and then install the new one:

Important

Removing the Enterprise Kubernetes Operator doesn't affect the database and Ops Manager resources that you deploy to Kubernetes. The migration process doesn't affect your workloads.

1

Replace <subscription-namespace> and <subscription-name> with the values that correspond to your resource.

kubectl -n <subscription-namespace> delete subscription <subscription-name>
2

You can usually find the CSV name by listing the CSVs in the operator's namespace. Replace <operator-namespace> and <csv-name> with the appropriate values.

kubectl -n <operator-namespace> delete csv <csv-name>
3

Kubernetes Operator is available in Red Hat's certified operators catalog, as well as the operatorhub.io catalog.

kubectl create -f <path-to-bundle>

See the following resources to learn how to migrate to Kubernetes Operator:

Back

Install

On this page