|
| 1 | +--- |
| 2 | +stepnum: 1 |
| 3 | +level: 4 |
| 4 | +ref: airgapped-env-tutorial-step1 |
| 5 | +title: Mirror the Operator catalog and disable the default catalog. |
| 6 | +content: | |
| 7 | + Red Hat Operator catalogs contain metadata that :abbr:`OLM |
| 8 | + (Operator Lifecycle Manager)` queries to install Operators |
| 9 | + and their dependencies on a cluster. You must create a copy of |
| 10 | + the Operator catalog and then disable the default catalog as a |
| 11 | + cluster administrator. |
| 12 | +
|
| 13 | + The ``relatedImages`` in the operator bundle lists the following |
| 14 | + images: |
| 15 | +
|
| 16 | + - Images directly used by the operator, which are the current |
| 17 | + version of ``mongodb-enterprise-init-database-ubi``, |
| 18 | + ``mongodb-enterprise-init-ops-manager-ubi``, |
| 19 | + ``mongodb-enterprise-init-appdb-ubi``, |
| 20 | + ``mongodb-enterprise-init-database-ubi``. |
| 21 | + - All currently supported images of |onprem|, AppDB and |
| 22 | + ``mongodb-agent-ubi`` that can be configured in an |onprem| |
| 23 | + deployment. |
| 24 | +
|
| 25 | + For ``init`` images, use only the version that is present in the |
| 26 | + latest |k8s-op-short| version. |
| 27 | + |
| 28 | + The size of all related images referenced by the operator bundle |
| 29 | + is over 26 GB. |
| 30 | +
|
| 31 | + Your mirroring command won't pick unsupported versions of the |
| 32 | + AppDB images. If you want to use any other unsupported version, |
| 33 | + you must manually provide these images to the mirror registry. For |
| 34 | + other versions for a given operator version, see `image for Deployment |
| 35 | + <https://github.com/mongodb/mongodb-enterprise-kubernetes/blob/master/mongodb-enterprise.yaml>`__. |
| 36 | +
|
| 37 | + For the full list of images defined in the ``RELATED_IMAGE_*`` |
| 38 | + environment variables, see the :abbr:`CSV (cluster service versions)` |
| 39 | + `file <https://github.com/redhat-openshift-ecosystem/certified-operators/blob/main/operators/mongodb-enterprise/1.18.0/manifests/mongodb-enterprise.clusterserviceversion.yaml>`__. |
| 40 | +
|
| 41 | + a. To mirror, see :oshft-doc:`Mirroring images for a disconnected |
| 42 | + installation </installing/disconnected_install/installing-mirroring-installation-images.html#olm-mirroring-catalog_installing-mirroring-installation-images>`. |
| 43 | +
|
| 44 | + When you run the ``oc adm catalog mirror`` command to mirror the |
| 45 | + catalog, it generates the ``imageContentSourcePolicy.yaml`` file, |
| 46 | + which you must `apply <https://access.redhat.com/documentation/en-us/red_hat_openshift_container_storage/4.5/html/preparing_to_deploy_in_a_disconnected_environment/creating-operator-imagecontentsourcepolicy_rhocs>`__ |
| 47 | + to remap original source to mirrored images. For example: |
| 48 | +
|
| 49 | + .. code-block:: shell |
| 50 | +
|
| 51 | + oc apply -f ./<output dir>/imageContentSourcePolicy.yaml |
| 52 | +
|
| 53 | + To learn more, see :oshft-doc:`Mirroring Operator catalogs for use |
| 54 | + with disconnected clusters |
| 55 | + </installing/disconnected_install/installing-mirroring-installation-images.html#olm-mirror-catalog_installing-mirroring-installation-images>`. |
| 56 | + For a list of supported MongoDB versions for each |onprem| version, |
| 57 | + see :opsmgr:`Compatible MongoDB Version |
| 58 | + </tutorial/prepare-backing-mongodb-instances/#use-a-compatible-mongodb-version>`. |
| 59 | +
|
| 60 | + #. To disable the default catalog, add |
| 61 | + ``disableAllDefaultSources: true`` to the ``OperatorHub`` object. |
| 62 | + |
| 63 | + To learn more, see :oshft-doc:`Using Operator Lifecycle Manager on |
| 64 | + restricted networks </operators/admin/olm-restricted-networks.html>`. |
| 65 | + |
| 66 | +--- |
| 67 | +stepnum: 2 |
| 68 | +level: 4 |
| 69 | +ref: airgapped-env-tutorial-step2 |
| 70 | +title: Install the |k8s-op-short|. |
| 71 | +content: | |
| 72 | + To learn more, see: |
| 73 | +
|
| 74 | + - :ref:`plan-k8s-operator-install` |
| 75 | + - :ref:`install-k8s` |
| 76 | +
|
| 77 | +--- |
| 78 | +stepnum: 3 |
| 79 | +level: 4 |
| 80 | +ref: airgapped-env-tutorial-step3 |
| 81 | +title: "Deploy |onprem| in Local Mode." |
| 82 | +content: | |
| 83 | +
|
| 84 | + To deploy |onprem| in Local Mode, you must do the following: |
| 85 | +
|
| 86 | + a. Copy the following example |onprem| |k8s| |k8s-obj| and save it as |
| 87 | + a ``.yaml`` file. |
| 88 | +
|
| 89 | + - Use the |onprem| configuration setting |
| 90 | + ``automation.versions.source: local`` in |
| 91 | + :opsmgrkube:`spec.configuration` to enable Local Mode. |
| 92 | +
|
| 93 | + - Define a |k8s-pv| for the |onprem| StatefulSet to store the |
| 94 | + MongoDB installation archive. {+mdbagent+}\s running in MongoDB |
| 95 | + database resource containers that you create with the |k8s-op-short| |
| 96 | + download the installation archives from |onprem| instead of from the |
| 97 | + Internet. |
| 98 | +
|
| 99 | + .. code-block:: yaml |
| 100 | + :linenos: |
| 101 | +
|
| 102 | + apiVersion: mongodb.com/v1 |
| 103 | + kind: MongoDBOpsManager |
| 104 | + metadata: |
| 105 | + name: ops-manager-localmode |
| 106 | + spec: |
| 107 | + replicas: 2 |
| 108 | + version: "6.0.0" |
| 109 | + adminCredentials: ops-manager-admin-secret |
| 110 | + configuration: |
| 111 | + # this enables local mode in Ops Manager |
| 112 | + automation.versions.source: local |
| 113 | + statefulSet: |
| 114 | + spec: |
| 115 | + # the Persistent Volume Claim will be created for each Ops Manager Pod |
| 116 | + volumeClaimTemplates: |
| 117 | + - metadata: |
| 118 | + name: mongodb-versions |
| 119 | + spec: |
| 120 | + accessModes: [ "ReadWriteOnce" ] |
| 121 | + resources: |
| 122 | + requests: |
| 123 | + storage: "20Gi" |
| 124 | + template: |
| 125 | + spec: |
| 126 | + containers: |
| 127 | + - name: mongodb-ops-manager |
| 128 | + volumeMounts: |
| 129 | + - name: mongodb-versions |
| 130 | + # this is the directory in each Pod where all MongoDB |
| 131 | + # archives must be put |
| 132 | + mountPath: /mongodb-ops-manager/mongodb-releases |
| 133 | + backup: |
| 134 | + enabled: false |
| 135 | + applicationDatabase: |
| 136 | + members: 3 |
| 137 | + persistent: true |
| 138 | +
|
| 139 | + To learn more about the settings, see :ref:`deploy-om-container`. |
| 140 | +
|
| 141 | + #. Configure ``oc`` to default to your namespace. |
| 142 | +
|
| 143 | + .. code-block:: sh |
| 144 | + |
| 145 | + oc config set-context $(oc config current-context) --namespace=<metadata.namespace> |
| 146 | +
|
| 147 | + #. Copy the following |onprem| resource settings, paste into |
| 148 | + your existing |onprem| resource, and save your |onprem| config |
| 149 | + file. |
| 150 | +
|
| 151 | + .. code-block:: yaml |
| 152 | + :linenos: |
| 153 | +
|
| 154 | + configuration: |
| 155 | + # this enables local mode in Ops Manager |
| 156 | + automation.versions.source: local |
| 157 | + statefulSet: |
| 158 | + spec: |
| 159 | + # the Persistent Volume Claim will be created for each Ops Manager Pod |
| 160 | + volumeClaimTemplates: |
| 161 | + - metadata: |
| 162 | + name: mongodb-versions |
| 163 | + spec: |
| 164 | + accessModes: [ "ReadWriteOnce" ] |
| 165 | + resources: |
| 166 | + requests: |
| 167 | + storage: "20Gi" |
| 168 | + template: |
| 169 | + spec: |
| 170 | + containers: |
| 171 | + - name: mongodb-ops-manager |
| 172 | + volumeMounts: |
| 173 | + - name: mongodb-versions |
| 174 | + # this is the directory in each Pod where all MongoDB |
| 175 | + # archives must be put |
| 176 | + mountPath: /mongodb-ops-manager/mongodb-releases |
| 177 | +
|
| 178 | + #. Copy the MongoDB installation archive to the |onprem| Persistent |
| 179 | + Volume. |
| 180 | +
|
| 181 | + To learn how to copy MongoDB installation archive, see step 10 in |
| 182 | + the :ref:`Configure an Ops Manager Resource to use Local Mode |
| 183 | + <deploy-om-container-local-mode>` procedure. |
| 184 | +
|
| 185 | + #. Create credentials and store them as a secret. |
| 186 | + |
| 187 | + Run the following command: |
| 188 | + |
| 189 | + .. note:: |
| 190 | + |
| 191 | + Provide your public and private key values for the following |
| 192 | + parameters. To learn more, see :ref:`create-k8s-credentials`. |
| 193 | + |
| 194 | + .. code-block:: sh |
| 195 | +
|
| 196 | + oc \ |
| 197 | + create secret generic ops-manager-admin-key \ |
| 198 | + --from-literal="publicKey=<publicKey>" \ |
| 199 | + --from-literal="privateKey=<privateKey>" |
| 200 | +
|
| 201 | + #. Create a ConfigMap similar to the following: |
| 202 | + |
| 203 | + .. code-block:: sh |
| 204 | +
|
| 205 | + cat <<EOF | oc apply -f - |
| 206 | + apiVersion: v1 |
| 207 | + kind: ConfigMap |
| 208 | + metadata: |
| 209 | + name: my-project |
| 210 | + namespace: mongodb |
| 211 | + data: |
| 212 | + projectName: myProjectName # this is an optional parameter |
| 213 | + orgId: 5b890e0feacf0b76ff3e7183 # this is an optional parameter |
| 214 | + baseUrl: https://ops.example.com:8443 |
| 215 | + EOF |
| 216 | +
|
| 217 | + To learn more about the settings in the ConfigMap, see step 7 in |
| 218 | + the :ref:`openshift-quick-start-ref`. |
| 219 | +
|
| 220 | + To learn more about deploying |onprem| in Local Mode, see |
| 221 | + :ref:`deploy-om-container-local-mode`. |
| 222 | +
|
| 223 | +--- |
| 224 | +stepnum: 4 |
| 225 | +level: 4 |
| 226 | +ref: airgapped-env-tutorial-step4 |
| 227 | +title: Deploy a MongoDB Database Resource. |
| 228 | +content: | |
| 229 | + You can :ref:`deploy-replica-set` or a :ref:`deploy-sharded-cluster`. |
| 230 | + To learn more, see :ref:`k8s-deploy-mdb-resources`. |
| 231 | +... |
0 commit comments