|
| 1 | +.. _plan-k8s-operator-install: |
| 2 | + |
| 3 | +==================================== |
| 4 | +Plan your |k8s-op-full| Installation |
| 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 | +.. include:: /includes/styles/corrections.rst |
| 16 | + |
| 17 | +Use the |k8s-op-full| to deploy: |
| 18 | + |
| 19 | +- Ops Manager resources |
| 20 | +- MongoDB standalone, replica set, and sharded cluster resources |
| 21 | + |
| 22 | +.. include:: /includes/admonitions/note-k8s-supported-in-om4.rst |
| 23 | + |
| 24 | +To deploy MongoDB resources with the |k8s-op-short|, you need an |
| 25 | +|onprem| instance. Deploy this instance to |k8s| using the Operator or |
| 26 | +outside |k8s| using |
| 27 | +:opsmgr:`traditional installation methods </installation>`. The |
| 28 | +Operator uses |onprem| |api| methods to deploy then manage MongoDB |
| 29 | +resources. |
| 30 | + |
| 31 | +.. _k8s-considerations: |
| 32 | + |
| 33 | +Considerations |
| 34 | +-------------- |
| 35 | + |
| 36 | +|k8s| Compatibility |
| 37 | +~~~~~~~~~~~~~~~~~~~ |
| 38 | + |
| 39 | +|k8s-op-full| is compatible with |k8s| v1.13 or later. |
| 40 | + |
| 41 | +Docker Container Details |
| 42 | +~~~~~~~~~~~~~~~~~~~~~~~~ |
| 43 | + |
| 44 | +MongoDB builds the container images from the latest builds of the |
| 45 | +following operating systems: |
| 46 | + |
| 47 | +.. list-table:: |
| 48 | + :header-rows: 1 |
| 49 | + :widths: 50 50 |
| 50 | + |
| 51 | + * - If you get your |k8s-op-short| from... |
| 52 | + - ...the Container uses |
| 53 | + |
| 54 | + * - `quay.io <https://quay.io/repository/mongodb/mongodb-enterprise-operator?tag=latest&tab=tags>`__ |
| 55 | + or :gh:`GitHub </mongodb/mongodb-enterprise-kubernetes>` |
| 56 | + - `Ubuntu 16.04 <https://www.ubuntu.com/containers>`__ |
| 57 | + |
| 58 | + * - `OpenShift <https://access.redhat.com/containers/?tab=tags#/registry.connect.redhat.com/mongodb/enterprise-operator>`__ |
| 59 | + - `Red Hat Enterprise Linux 7 <https://www.redhat.com/en/topics/containers>`__ |
| 60 | + |
| 61 | +MongoDB, Inc. updates all packages on these images before releasing |
| 62 | +them every three weeks. |
| 63 | + |
| 64 | +.. _k8s-deployment-scopes: |
| 65 | + |
| 66 | +|k8s-op-short| Deployment Scopes |
| 67 | +-------------------------------- |
| 68 | + |
| 69 | +You can deploy the |k8s-op-short| with different scopes based on where |
| 70 | +you want to deploy |onprem| and |k8s-mdbrscs| resources: |
| 71 | + |
| 72 | +- :ref:`ns-scope-same-ns` *(Default)* |
| 73 | +- :ref:`ns-scope-different-ns` |
| 74 | +- :ref:`cluster-wide-scope` |
| 75 | + |
| 76 | +.. _ns-scope-same-ns: |
| 77 | + |
| 78 | +Operator in Same Namespace as Resources |
| 79 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 80 | +You scope the |k8s-op-short| to a namespace. The |k8s-op-short| watches |
| 81 | +|onprem| and |k8s-mdbrscs| in that same |k8s-ns|. |
| 82 | + |
| 83 | +This is the default scope when you install the |k8s-op-short| using the |
| 84 | +:ref:`installation instructions <install-k8s-operator>`. |
| 85 | + |
| 86 | +.. _ns-scope-different-ns: |
| 87 | + |
| 88 | +Operator in Different Namespace Than Resources |
| 89 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 90 | + |
| 91 | +You scope the |k8s-op-short| to a namespace. The |k8s-op-short| watches |
| 92 | +|onprem| and |k8s-mdbrscs| in the |k8s-ns| you specify. |
| 93 | + |
| 94 | +You must use ``helm`` to install the |k8s-op-short| with this scope. |
| 95 | +Follow the relevant ``helm`` :ref:`installation instructions <install-k8s-operator>`, |
| 96 | +but use the following command to set the namespace for the |
| 97 | +|k8s-op-short| to watch: |
| 98 | + |
| 99 | +.. code-block:: sh |
| 100 | + |
| 101 | + helm template --set operator.watchNamespace=<namespace> \ |
| 102 | + helm_chart | kubectl apply -f - |
| 103 | + |
| 104 | +Setting the namespace ensures that: |
| 105 | + |
| 106 | +- The namespace you want the |k8s-op-short| to watch has the correct |
| 107 | + roles and role bindings. |
| 108 | +- The |k8s-op-short| can watch and create resources in the namespace. |
| 109 | + |
| 110 | +.. _cluster-wide-scope: |
| 111 | + |
| 112 | +Cluster-Wide Scope |
| 113 | +~~~~~~~~~~~~~~~~~~ |
| 114 | + |
| 115 | +You scope the |k8s-op-short| to a cluster. The |k8s-op-short| watches |
| 116 | +|onprem| and |k8s-mdbrscs| in all |k8s-nss| in the |k8s| cluster. |
| 117 | + |
| 118 | +.. important:: |
| 119 | + |
| 120 | + You can deploy only one Operator with a cluster-wide scope per |k8s| |
| 121 | + cluster. |
| 122 | + |
| 123 | +You must use ``helm`` to install the |k8s-op-short| with this scope. |
| 124 | +Follow the relevant ``helm`` :ref:`installation instructions <install-k8s-operator>`, |
| 125 | +but make the following adjustments: |
| 126 | + |
| 127 | +1. Use the following command to set the |k8s-op-short| to watch all |
| 128 | + namespaces: |
| 129 | + |
| 130 | + .. code-block:: sh |
| 131 | + |
| 132 | + helm template --set operator.watchNamespace=* \ |
| 133 | + helm_chart | kubectl apply -f - |
| 134 | + |
| 135 | +2. Create the required service accounts for each namespace where you |
| 136 | + want to deploy |onprem| and |k8s-mdbrscs|: |
| 137 | + |
| 138 | + .. code-block:: sh |
| 139 | + |
| 140 | + helm template --set namespace=<namespace> \ |
| 141 | + helm_chart -x templates/database-roles.yaml | kubectl apply -f - |
| 142 | + |
| 143 | +.. _k8s-prerequisites: |
| 144 | + |
| 145 | +Prerequisites |
| 146 | +------------- |
| 147 | + |
| 148 | +.. include:: /includes/install/install-prereqs.rst |
| 149 | + |
| 150 | + |
0 commit comments