Skip to content

Commit c558a9b

Browse files
kanchana-mongodbdan-mckeannammnjwilliams-mongo
authored
DOCSP-41620 Write a summary about static images (#1796)
* DOCSP-41620 Write a summary about static images * Apply suggestions from code review Co-authored-by: Dan Mckean <[email protected]> * DOCSP-41620 updates for DM's feedback * Update source/tutorial/plan-k8s-op-container-images.txt Co-authored-by: Nam Nguyen <[email protected]> * DOCSP-41620 updates for Nam's feedback * Apply suggestions from code review Co-authored-by: John Williams <[email protected]> * DOCSP-41620 updates for JW's and Nam's feedback --------- Co-authored-by: Dan Mckean <[email protected]> Co-authored-by: Nam Nguyen <[email protected]> Co-authored-by: John Williams <[email protected]>
1 parent 1915192 commit c558a9b

File tree

2 files changed

+123
-25
lines changed

2 files changed

+123
-25
lines changed
Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1-
Static containers are more secure and simpler than non-static
2-
containers. Static containers are immutable at runtime. In addition:
1+
Static containers are simpler and more secure than non-static
2+
containers. Static containers are immutable at runtime, which means that
3+
they don't change from the image used to create the container. In
4+
addition:
35

4-
- While running, static containers can't download binaries or run scripts or other
5-
utilities over network connections. Static containers can only download runtime
6-
configuration files.
7-
- While running, static containers can't modify any file except storage volume mounts.
8-
- Static containers don't require that you scan the containers for security vulnerabilities,
9-
as opposed to non-static containers that require container security scanning. If you use
10-
static containers, you can only run security scans on the container images
11-
themselves but not on their containers.
12-
- If you have an air-gapped environment, static containers don't require that you
13-
host the MongoDB binary on the server that hosts |onprem| or another |https| server.
6+
- While running, static containers don't download binaries or run
7+
scripts or other utilities over network connections. Static containers
8+
only download runtime configuration files.
9+
- While running, static containers don't modify any file except storage
10+
volume mounts.
11+
- You can run security scans on the container images to determine what is
12+
actually run as a live container, and the container that runs won't
13+
run binaries other than what was defined in the
14+
image.
15+
- Static containers don't require that you host the MongoDB binary on
16+
either |onprem| or another |https| server, which is especially useful
17+
if you have an air-gapped environment.
1418
- You can't run extensive ``CMD`` scripts for the static container.
1519
- You can't copy files between static containers using ``initContainer``.
1620

source/tutorial/plan-k8s-op-container-images.txt

Lines changed: 107 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,16 @@ Static Containers (Public Preview)
7777

7878
.. include:: /includes/static-containers-description.rst
7979

80-
Starting with |k8s-op-full| 1.25, you can use the Public Preview of static containers instead of
81-
the existing non-static containers that download the MongoDB binary from |com|
82-
or the Internet at runtime. You can use the following procedures to enable or disable
83-
static containers for all or individual MongoDB deployments.
80+
Starting with |k8s-op-full| 1.25, you can use the Public Preview of
81+
static containers instead of the existing non-static containers, which
82+
downloads the MongoDB binary from |com| or the Internet at runtime.
83+
You can use the procedures on this page to enable or disable static
84+
containers for all or individual MongoDB deployments.
8485

85-
Static containers use the image from the
86-
:qr-mdb:`mongodb-enterprise-server </mongodb-enterprise-server?tab=tags&tag=latest>`
87-
Quay.io repository.
86+
Static containers use the image from the :qr-mdb:`mongodb-enterprise-server
87+
</mongodb-enterprise-server?tab=tags&tag=latest>` Quay.io repository by
88+
default, but you can use your own registry if you configured it for your
89+
Kubernetes |k8s-nodes|.
8890

8991
.. _arch-static-containers:
9092

@@ -112,23 +114,56 @@ Static Container Architecture
112114
The static container architecture uses Kubernetes' :k8sdocs:`shared namespace feature </tasks/configure-pod-container/share-process-namespace/>`
113115
to run the {+mdbagent+} as a separate process so it can control the full |mongod| lifecycle and avoid downloading files over a network.
114116

115-
.. include:: /includes/static-containers-description.rst
116-
117117
.. figure:: /images/mdb-deployment-static.svg
118118
:alt: Diagram showing the high-level architecture of a MongoDB deployment with
119119
static containers configured using the MongoDB Enterprise Kubernetes Operator.
120120
:figwidth: 600px
121121

122+
.. _local-remote-mode:
123+
124+
Compatibility With Local or Remote Mode
125+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
126+
127+
If you use static containers, you don't need to configure |onprem| to
128+
run in :ref:`Local Mode <deploy-om-container-local-mode>` or
129+
:ref:`Remote Mode <deploy-om-container-remote-mode>`, unless you use
130+
queryable backups. In static container architecture, the binaries
131+
for the agent and ``mongod`` have their own container images and these
132+
are not downloaded from |onprem|.
133+
134+
Queryable backups are the exception because in the non-static container
135+
architecture, by default, the Backup Daemon downloads and runs the
136+
MongoDB Server binaries for all versions that are backed-up. This
137+
default MongoDB behavior undermines the fully static nature of the
138+
containers used to run the Backup Daemon. If you use queryable backups,
139+
you must still host the relevant MongoDB Server binaries using local or
140+
remote mode. To learn more, see :ref:`deploy-om-container-local-mode` or
141+
:ref:`deploy-om-container-remote-mode`.
142+
143+
If you used Remote or Local mode before and don't want to use queryable
144+
backups, do the following to ensure that ``mongodb-enterprise-server``
145+
`images <https://quay.io/repository/mongodb/mongodb-enterprise-server?tab=tags&tag=latest>`__
146+
can be downloaded on the |k8s-nodes| used by the pods:
147+
148+
1. Configure an internal container registry for your Kubernetes nodes.
149+
150+
The |k8s-nodes| will download the images from `Quay.io
151+
<https://quay.io/repository/mongodb/mongodb-enterprise-server?tab=tags&tag=latest>`__
152+
unless you use a local container registry.
153+
154+
2. Download and add the ``mongodb-enterprise-server`` `images
155+
<https://quay.io/repository/mongodb/mongodb-enterprise-server?tab=tags&tag=latest>`__.
156+
122157
.. _limitations-static-containers:
123158

124159
Limitations
125160
~~~~~~~~~~~
126161

127162
If you enable static containers:
128163

129-
- You must :ref:`disable-queryable-backups` so the :ref:`backup-daemon` doesn't
130-
attempt to download the MongoDB binaries from |onprem|, which undermines the immutable
131-
nature of static containers.
164+
- You must :ref:`disable-queryable-backups` so the :ref:`backup-daemon`
165+
doesn't attempt to download the MongoDB binaries from |onprem|, which
166+
undermines the immutable nature of static containers.
132167

133168
- With |onprem|, only versions 6.0.24, 7.0.5, or later are compatible.
134169
The {+k8s-op-short+} automatically uses the correct version of the
@@ -167,6 +202,33 @@ If you enable static containers:
167202
health status file so you can't tell from the health status that a version change
168203
happened, only the current health status.
169204

205+
FAQs
206+
~~~~
207+
208+
Do static containers support local or remote mode?
209+
``````````````````````````````````````````````````
210+
211+
No, if you use static containers, you don't need to configure |onprem|
212+
to run in :ref:`Local Mode <deploy-om-container-local-mode>` or
213+
:ref:`Remote Mode <deploy-om-container-remote-mode>` unless you use
214+
queryable backups. To learn more, see :ref:`Local and Remote Modes
215+
<local-remote-mode>`.
216+
217+
What are the changes for static containers?
218+
```````````````````````````````````````````
219+
220+
Static containers don't download the MongoDB binary at runtime.
221+
Instead, it uses the images from the :qr-mdb:`mongodb-enterprise-server
222+
</mongodb-enterprise-server?tab=tags&tag=latest>` Quay.io repository. To
223+
learn more about the changes, see :ref:`step 6 <migrate-to-static-containers>`.
224+
225+
How can I verify if my deployment is running in static?
226+
```````````````````````````````````````````````````````
227+
228+
There are many ways to determine if your deployment is using static
229+
container. To learn more, see :ref:`step 7
230+
<migrate-to-static-containers>`.
231+
170232
.. _migrate-to-static-containers:
171233

172234
Migrate to Static Containers
@@ -175,7 +237,7 @@ Migrate to Static Containers
175237
To migrate from non-static to static containers, set the {+mdbagent+} environment
176238
variables and enable static containers by following the steps below.
177239
You can also enable static containers during
178-
:ref:`installation <install-k8s>` or :ref:`upgrade <upgrade-k8s-operator>`.
240+
:ref:`installation <install-k8s>` or :ref:`upgrade <upgrade-k8s-operator>`.
179241

180242
.. procedure::
181243
:style: normal
@@ -186,6 +248,12 @@ You can also enable static containers during
186248

187249
Follow the procedure in :ref:`disable-queryable-backups`.
188250

251+
If you want to use :ref:`queryable backups
252+
<configure-om-queryable-backups>`, you must configure |onprem|
253+
resource to use :ref:`Local Mode <deploy-om-container-local-mode>`
254+
or :ref:`Remote Mode <deploy-om-container-remote-mode>` so that
255+
the binaries for all versions in-use can be pulled from |onprem|.
256+
189257
.. step:: Set environment variables for the {+mdbagent+} image.
190258

191259
.. tabs::
@@ -295,6 +363,32 @@ You can also enable static containers during
295363
the {+mdbagent+} and another for the MongoDB database. This update initiates a
296364
rolling restart.
297365

366+
When you migrate to static containers, the following changes apply:
367+
368+
- Kubernetes |k8s-nodes| use their configured container registry
369+
to perform the downloads.
370+
- Monitoring agent and automation agent versions are aligned.
371+
- |k8s-op-short|, instead of the agent, handles MongoDB upgrades.
372+
- |k8s-op-short| replaces the existing images, which will cause a
373+
rolling restart.
374+
375+
.. step:: Verify that deployment is running in static.
376+
377+
- Check the value for one of the following variables, which you
378+
must've set to ``static``:
379+
380+
.. list-table::
381+
:widths: 60 30
382+
383+
* - ``MDB_DEFAULT_ARCHITECTURE``
384+
- Variable for all deployments.
385+
* - ``metadata.annotations[mongodb.com/v1.architecture]``
386+
- Per-deployment variable.
387+
388+
- Check the database deployment to verify the usage of two separate
389+
images, one for the agent and one for MongoDB, and ensure that no
390+
init containers are deployed.
391+
298392
.. _migrate-to-non-static-containers:
299393

300394
Migrate to Non-Static Containers

0 commit comments

Comments
 (0)