Skip to content

Commit 3f8edda

Browse files
(DOCSP-9801): Make Operator able to start if Ops Manager CRD has not … (#261)
* (DOCSP-9801): Make Operator able to start if Ops Manager CRD has not been added to K8s * (DOCSP-9801): updates based on latest engineering changes
1 parent 7ee538d commit 3f8edda

File tree

5 files changed

+100
-0
lines changed

5 files changed

+100
-0
lines changed

conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@
127127
'.. |k8s-configmaps| replace:: `ConfigMaps <https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/>`__',
128128
'.. |k8s-configmap| replace:: `ConfigMap <https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/>`__',
129129
'.. |k8s-custom-resource| replace:: `Custom Resource <https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/>`__',
130+
'.. |k8s-custom-resources| replace:: `Custom Resources <https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/>`__',
130131
'.. |k8s-crds| replace:: `CustomResourceDefinitions <https://kubernetes.io/docs/tasks/access-kubernetes-api/extend-api-custom-resource-definitions/>`__',
131132
'.. |k8s-crd| replace:: `CustomResourceDefinition <https://kubernetes.io/docs/tasks/access-kubernetes-api/extend-api-custom-resource-definitions/>`__',
132133
'.. |k8s-mdbrscs| replace:: MongoDB Kubernetes resources',

source/includes/list-tables/crds.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.. list-table::
2+
:widths: 40 60
3+
:header-rows: 1
4+
5+
* - Value
6+
- Description
7+
8+
* - ``mongodb``
9+
- Install the CustomResourceDefinitions for and watch database
10+
resources.
11+
12+
* - ``mongodbusers``
13+
- Install the CustomResourceDefinitions for and watch MongoDB
14+
user resources.
15+
16+
* - ``opsmanagers``
17+
- Install the CustomResourceDefinitions for and watch |onprem|
18+
resources.

source/includes/list-tables/k8s-helm-install-options.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,26 @@
145145
146146
registry:
147147
initAppDb: quay.io/mongodb
148+
149+
* - ``operator.watchedResources``
150+
- Custom resources that the |k8s-op-short| watches.
151+
152+
The |k8s-op-short| installs the |k8s-crds| for and watches only
153+
the resources you specify.
154+
155+
Accepted values are:
156+
157+
.. include:: /includes/list-tables/crds.rst
158+
159+
Default values are: ``mongodbusers``, ``mongodb``, and ``opsmanagers``.
160+
161+
.. example::
162+
163+
.. code-block:: sh
164+
:emphasize-lines: 2
165+
166+
operator:
167+
watchedResources:
168+
- mongodbusers
169+
- mongodb
170+
- opsmanagers

source/includes/list-tables/os-helm-install-options.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,3 +163,26 @@
163163
164164
operator:
165165
watchNamespace: *
166+
167+
* - ``operator.watchedResources``
168+
- Custom resources that the |k8s-op-short| watches.
169+
170+
The |k8s-op-short| installs the |k8s-crds| for and watches only
171+
the resources you specify.
172+
173+
Accepted values are:
174+
175+
.. include:: /includes/list-tables/crds.rst
176+
177+
Default values are: ``mongodbusers``, ``mongodb``, and ``opsmanagers``.
178+
179+
.. example::
180+
181+
.. code-block:: sh
182+
:emphasize-lines: 2
183+
184+
operator:
185+
watchedResources:
186+
- mongodbusers
187+
- mongodb
188+
- opsmanagers

source/tutorial/plan-k8s-operator-install.txt

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,41 @@ but make the following adjustments:
175175
helm template --set namespace=<namespace> \
176176
helm_chart -x templates/database-roles.yaml | kubectl apply -f -
177177

178+
Customize the CustomResourceDefinitions the |k8s-op-short| Watches
179+
------------------------------------------------------------------
180+
181+
Earlier versions of the |k8s-op-short| would crash on start up if
182+
any one of the MongoDB |k8s-crds| was not present in the cluster.
183+
For instance, you had to install the CustomResourceDefinition for
184+
|onprem| even if you did not plan to deploy it with the |k8s-op-short|.
185+
186+
You can now specify which custom resources you want the
187+
|k8s-op-short| to watch. This allows you to install the
188+
CustomResourceDefinition for only the resources that you want the
189+
|k8s-op-short| to manage.
190+
191+
You must use ``helm`` to configure the |k8s-op-short| to watch only the
192+
custom resources you specify. Follow the relevant ``helm``
193+
:ref:`installation instructions <install-k8s-operator>`,
194+
but make the following adjustments:
195+
196+
1. Decide which CustomResourceDefinitions you want to install. You can
197+
install any number of the following:
198+
199+
.. include:: /includes/list-tables/crds.rst
200+
201+
#. Use the ``-- set`` option on the ``operator.watchedResources`` field
202+
with the ``helm template`` command to specify which
203+
CustomResourceDefinitions you want to install and configure the
204+
|k8s-op-short| to watch them.
205+
206+
Separate each custom resource with a comma:
207+
208+
.. code-block:: sh
209+
210+
helm template --set operator.watchedResources="{mongodb,mongodbusers}" \
211+
helm_chart | kubectl apply -f -
212+
178213
.. _k8s-prerequisites:
179214

180215
Prerequisites

0 commit comments

Comments
 (0)