]> 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)
committerPatrick Seidensal <pseidensal@suse.com>
Tue, 26 May 2020 10:49:34 +0000 (12:49 +0200)
Namely,
- Grafana
- Prometheus
- Alertmanager and
- Node exporter.

Fixes: https://tracker.ceph.com/issues/45463
Signed-off-by: Patrick Seidensal <pseidensal@suse.com>
doc/cephadm/monitoring.rst
src/pybind/mgr/cephadm/module.py

index 579949103081f4cb5c7e6afbab9eabb485b2381e..eac55585077f641b133f2ee07f7ac7aa87218508 100644 (file)
@@ -57,6 +57,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 9db98b977b93d03a90a4ac9598278ba58b23bfa1..385c171c3891b0102aab2970c7440406429b40d9 100644 (file)
@@ -186,6 +186,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',
@@ -251,6 +271,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
@@ -891,6 +915,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 = []