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.
Migrate from MongoDB Enterprise Operator to Kubernetes Operator for Most Deployments
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.
Perform the following two tasks if you have deployed resources across multiple Kubernetes clusters:
Back up the
kubectl
plug-in binary. This makes it easier for you to reverse the migration to Kubernetes Operator if you encounter problems.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 themongodb-kubernetes-operator-member-list
is present on your operator cluster after running the newest version of thekubectl
plug-in binary.
Install the Kubernetes Operator CRDs manually.
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
Install the new Kubernetes Operator Helm chart.
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>
The Kubernetes Operator reconciler runs and processes the existing custom resources.
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.
Wait for the resources to reconcile (reach the Running
phase) and become healthy.
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.
Remove old assets.
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.
Migrate from MongoDB Enterprise Kubernetes Operator to Kubernetes Operator with the Operator Lifecycle Manager (OLM) on OpenShift or Other Platforms
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.
Install Kubernetes Operator from a catalog available on your cluster.
Kubernetes Operator is available in Red Hat's certified operators catalog, as well as the operatorhub.io catalog.
kubectl create -f <path-to-bundle>
Migrating from the Community Kubernetes Operator to the Kubernetes Operator
See the following resources to learn how to migrate to Kubernetes Operator: