|
| 1 | +.. _reference-architectures-deploy-operator: |
| 2 | + |
| 3 | +======================================= |
| 4 | +Deploy the MongoDB Enterprise Operator |
| 5 | +======================================= |
| 6 | + |
| 7 | +.. default-domain:: mongodb |
| 8 | + |
| 9 | +.. contents:: On this page |
| 10 | + :local: |
| 11 | + :backlinks: none |
| 12 | + :depth: 1 |
| 13 | + :class: singlecol |
| 14 | + |
| 15 | + |
| 16 | +In order to deploy multiple instances of MongoDB resources across multiple |
| 17 | +|k8s| clusters, you first need to deploy the |k8s-op-short| to one of your |
| 18 | +|k8s| clusters. Once the |k8s-op-short| is deployed to a central |k8s| cluster, |
| 19 | +you can then create and manage all of your MongoDB resources across all of your |
| 20 | +|k8s| clusters by applying updates to your central |k8s| cluster. |
| 21 | + |
| 22 | +Prerequisites |
| 23 | +------------- |
| 24 | + |
| 25 | +Before you begin the following procedure, perform the following actions: |
| 26 | + |
| 27 | +- Install ``kubectl``. |
| 28 | +- Install `Helm <https://helm.sh/docs/intro/install/>`__. |
| 29 | +- Complete the :ref:`GKE Clusters procedure <reference-architectures-gke-clusters>` or the equivalent. |
| 30 | +- Complete the :ref:`TLS Certificates procedure <reference-architectures-ca-certs>` or the equivalent. |
| 31 | +- Complete the :ref:`Istio Service mesh procedure <reference-architectures-istio-service-mesh>` or the equivalent. |
| 32 | +- Install the |kubectl-mongodb|. |
| 33 | + To install the |kubectl-mongodb|: |
| 34 | + |
| 35 | + .. include:: /includes/steps/install-kubectl-mongodb-plugin.rst |
| 36 | +- Update as needed and set the environment variables defined in the following ``env_variables.sh`` file. |
| 37 | + |
| 38 | + .. literalinclude:: /includes/code-examples/reference-architectures/setup-multi-cluster/setup-operator/env_variables.sh |
| 39 | + :language: bash |
| 40 | + :linenos: |
| 41 | + |
| 42 | +Source Code |
| 43 | +----------- |
| 44 | + |
| 45 | +You can find all included source code in the `MongoDB Kubernetes Operator repository <https://github.com/mongodb/mongodb-enterprise-kubernetes/tree/${current_branch}/architectures/setup-multi-cluster/setup-gke/setup-operator>`__. |
| 46 | + |
| 47 | +Procedure |
| 48 | +--------- |
| 49 | + |
| 50 | +.. procedure:: |
| 51 | + :style: normal |
| 52 | + |
| 53 | + .. step:: Create namespaces for the |k8s-op-short|, MongoDB and Ops Manager in each of your |k8s| clusters. |
| 54 | + |
| 55 | + .. literalinclude:: /includes/code-examples/reference-architectures/setup-multi-cluster/setup-operator/code_snippets/0045_create_namespaces.sh |
| 56 | + :language: bash |
| 57 | + |
| 58 | + .. step:: Create image pull secrets. |
| 59 | + |
| 60 | + .. literalinclude:: /includes/code-examples/reference-architectures/setup-multi-cluster/setup-operator/code_snippets/0046_create_image_pull_secrets.sh |
| 61 | + :language: bash |
| 62 | + |
| 63 | + .. step:: Configure your |k8s| clusters. |
| 64 | + |
| 65 | + Run the following command to configure your |k8s| clusters. |
| 66 | + |
| 67 | + .. io-code-block:: |
| 68 | + :copyable: true |
| 69 | + |
| 70 | + .. input:: /includes/code-examples/reference-architectures/setup-multi-cluster/setup-operator/code_snippets/0200_kubectl_mongodb_configure_multi_cluster.sh |
| 71 | + :language: bash |
| 72 | + :linenos: |
| 73 | + |
| 74 | + .. output:: /includes/code-examples/reference-architectures/setup-multi-cluster/setup-operator/output/0200_kubectl_mongodb_configure_multi_cluster.out |
| 75 | + :visible: false |
| 76 | + |
| 77 | + .. step:: Add the MongoDB Helm Charts for Kubernetes. |
| 78 | + |
| 79 | + Add the `MongoDB Helm Charts for Kubernetes <https://mongodb.github.io/helm-charts>`__ repository to Helm. |
| 80 | + |
| 81 | + .. io-code-block:: |
| 82 | + :copyable: true |
| 83 | + |
| 84 | + .. input:: /includes/code-examples/reference-architectures/setup-multi-cluster/setup-operator/code_snippets/0205_helm_configure_repo.sh |
| 85 | + :language: bash |
| 86 | + :linenos: |
| 87 | + |
| 88 | + .. output:: /includes/code-examples/reference-architectures/setup-multi-cluster/setup-operator/output/0205_helm_configure_repo.out |
| 89 | + :visible: false |
| 90 | + |
| 91 | + .. step:: Deploy the |k8s-op-short|. |
| 92 | + |
| 93 | + Use the `MongoDB Helm Charts for Kubernetes <https://mongodb.github.io/helm-charts>`__ to deploy the |k8s-op-short|. |
| 94 | + |
| 95 | + .. io-code-block:: |
| 96 | + :copyable: true |
| 97 | + |
| 98 | + .. input:: /includes/code-examples/reference-architectures/setup-multi-cluster/setup-operator/code_snippets/0210_helm_install_operator.sh |
| 99 | + :language: bash |
| 100 | + :linenos: |
| 101 | + |
| 102 | + .. output:: /includes/code-examples/reference-architectures/setup-multi-cluster/setup-operator/output/0210_helm_install_operator.out |
| 103 | + :visible: false |
| 104 | + |
| 105 | + .. step:: Check the status of your MongoDB Kubernetes Operator. |
| 106 | + |
| 107 | + .. io-code-block:: |
| 108 | + :copyable: true |
| 109 | + |
| 110 | + .. input:: /includes/code-examples/reference-architectures/setup-multi-cluster/setup-operator/code_snippets/0211_check_operator_deployment.sh |
| 111 | + :language: bash |
| 112 | + :linenos: |
| 113 | + |
| 114 | + .. output:: /includes/code-examples/reference-architectures/setup-multi-cluster/setup-operator/output/0211_check_operator_deployment.out |
| 115 | + :visible: false |
0 commit comments