]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: custom images for monitoring components
authorPatrick Seidensal <pseidensal@suse.com>
Mon, 25 May 2020 13:43:38 +0000 (15:43 +0200)
committerSebastian Wagner <sebastian.wagner@suse.com>
Tue, 2 Jun 2020 12:58:27 +0000 (14:58 +0200)
Namely,
- Grafana
- Prometheus
- Alertmanager and
- Node exporter.

Fixes: https://tracker.ceph.com/issues/45463
Signed-off-by: Patrick Seidensal <pseidensal@suse.com>
(cherry picked from commit 5d601bc781ab163599f3f17d788a36a1207d7624)

doc/cephadm/monitoring.rst
src/pybind/mgr/cephadm/module.py

index a698702c4212570f61a4e7e7debc5b8054fcc04e..365ce543b7a98108526da53c6a8a6abc98c1faab 100644 (file)
@@ -76,6 +76,45 @@ completed, you should see something like this from ``ceph orch ls``::
   node-exporter      2/2  6s ago     docker.io/prom/node-exporter:latest             e5a616e4b9cf  present
   prometheus         1/1  6s ago     docker.io/prom/prometheus:latest                e935122ab143  present
 
+Using custom images
+~~~~~~~~~~~~~~~~~~~
+
+It is possible to install or upgrade monitoring components based on other
+images.  To do so, the name of the image to be used needs to be stored in the
+configuration first.  The following configuration options are available.
+
+- ``container_image_prometheus``
+- ``container_image_grafana``
+- ``container_image_alertmanager``
+- ``container_image_node_exporter``
+
+Custom images can be set with the ``ceph config`` command::
+
+     ceph config set mgr mgr/cephadm/<option_name> <value>
+
+For example::
+
+     ceph config set mgr mgr/cephadm/container_image_prometheus prom/prometheus:v1.4.1
+
+.. note::
+
+     By setting a custom image, the default value will be overridden (but not
+     overwritten).  The default value changes when updates become available.
+     By setting a custom image, you will not be able to update the component
+     you have set the custom image for automatically.  You will need to
+     manually update the configuration (image name and tag) to be able to
+     install updates.
+     
+     If you choose to go with the recommendations instead, you can reset the
+     custom image you have set before.  After that, the default value will be
+     used again.  Use ``ceph config rm`` to reset the configuration option::
+
+          ceph config rm mgr mgr/cephadm/<option_name>
+
+     For example::
+
+          ceph config rm mgr mgr/cephadm/container_image_prometheus
+
 Disabling monitoring
 --------------------
 
index ca60c2f67c035ed0ea1a668ee4849399dc5489c9..91ac15072252bce0f9470a2f4cbfb005a07cdd32 100644 (file)
@@ -195,6 +195,26 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule):
             'desc': 'Container image name, without the tag',
             'runtime': True,
         },
+        {
+            'name': 'container_image_prometheus',
+            'default': 'prom/prometheus:v2.18.1',
+            'desc': 'Prometheus container image',
+        },
+        {
+            'name': 'container_image_grafana',
+            'default': 'ceph/ceph-grafana:latest',
+            'desc': 'Prometheus container image',
+        },
+        {
+            'name': 'container_image_alertmanager',
+            'default': 'prom/alertmanager:v0.20.0',
+            'desc': 'Prometheus container image',
+        },
+        {
+            'name': 'container_image_node_exporter',
+            'default': 'prom/node-exporter:v0.18.1',
+            'desc': 'Prometheus container image',
+        },
         {
             'name': 'warn_on_stray_hosts',
             'type': 'bool',
@@ -260,6 +280,10 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule):
             self.host_check_interval = 0
             self.mode = ''
             self.container_image_base = ''
+            self.container_image_prometheus = ''
+            self.container_image_grafana = ''
+            self.container_image_alertmanager = ''
+            self.container_image_node_exporter = ''
             self.warn_on_stray_hosts = True
             self.warn_on_stray_daemons = True
             self.warn_on_failed_host_check = True
@@ -925,6 +949,15 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule):
                         'key': 'container_image',
                     })
                     image = image.strip() # type: ignore
+                elif daemon_type == 'prometheus':
+                    image = self.container_image_prometheus
+                elif daemon_type == 'grafana':
+                    image = self.container_image_grafana
+                elif daemon_type == 'alertmanager':
+                    image = self.container_image_alertmanager
+                elif daemon_type == 'node-exporter':
+                    image = self.container_image_node_exporter
+
             self.log.debug('%s container image %s' % (entity, image))
 
             final_args = []