Add prometheus and related containers
Add container for prometheus, mysqld_exporter, node_exporter and haproxy_exporter Change-Id: I6e4eb0391380e594b708a67365e240d3eeafd88b
This commit is contained in:
parent
b7430a07c4
commit
cbbceb0ad3
21
docker/prometheus/prometheus-base/Dockerfile.j2
Normal file
21
docker/prometheus/prometheus-base/Dockerfile.j2
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }}
|
||||||
|
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
|
||||||
|
|
||||||
|
{% block prometheus_base_header %}{% endblock %}
|
||||||
|
|
||||||
|
{% import "macros.j2" as macros with context %}
|
||||||
|
|
||||||
|
{{ macros.configure_user(name='prometheus') }}
|
||||||
|
|
||||||
|
{% if base_arch == 'x86_64' %}
|
||||||
|
ENV prometheus_arch=amd64
|
||||||
|
{% elif base_arch == 'aarch64' %}
|
||||||
|
ENV prometheus_arch=arm64
|
||||||
|
{% else %}
|
||||||
|
ENV prometheus_arch={{ base_arch }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
COPY extend_start.sh /usr/local/bin/kolla_extend_start
|
||||||
|
RUN chmod 755 /usr/local/bin/kolla_extend_start
|
||||||
|
|
||||||
|
{% block prometheus_base_footer %}{% endblock %}
|
9
docker/prometheus/prometheus-base/extend_start.sh
Normal file
9
docker/prometheus/prometheus-base/extend_start.sh
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Create log directory, with appropriate permissions
|
||||||
|
if [[ ! -d "/var/log/kolla/prometheus" ]]; then
|
||||||
|
mkdir -p /var/log/kolla/prometheus
|
||||||
|
fi
|
||||||
|
if [[ $(stat -c %a /var/log/kolla/prometheus) != "755" ]]; then
|
||||||
|
chmod 755 /var/log/kolla/prometheus
|
||||||
|
fi
|
20
docker/prometheus/prometheus-haproxy-exporter/Dockerfile.j2
Normal file
20
docker/prometheus/prometheus-haproxy-exporter/Dockerfile.j2
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
FROM {{ namespace }}/{{ image_prefix }}prometheus-base:{{ tag }}
|
||||||
|
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
|
||||||
|
|
||||||
|
{% block haproxy_exporter_header %}{% endblock %}
|
||||||
|
|
||||||
|
{% block haproxy_exporter_repository_version %}
|
||||||
|
ENV haproxy_exporter_version=0.7.1
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block haproxy_exporter_install %}
|
||||||
|
RUN curl -sSL -o /tmp/haproxy_exporter.tar.gz https://github.com/prometheus/haproxy_exporter/releases/download/v${haproxy_exporter_version}/haproxy_exporter-${haproxy_exporter_version}.linux-${prometheus_arch}.tar.gz \
|
||||||
|
&& tar xvf /tmp/haproxy_exporter.tar.gz -C /opt/ \
|
||||||
|
&& rm -f /tmp/haproxy_exporter.tar.gz \
|
||||||
|
&& ln -s /opt/haproxy_exporter* /opt/haproxy_exporter
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block haproxy_exporter_footer %}{% endblock %}
|
||||||
|
{% block footer %}{% endblock %}
|
||||||
|
|
||||||
|
USER prometheus
|
20
docker/prometheus/prometheus-mysqld-exporter/Dockerfile.j2
Normal file
20
docker/prometheus/prometheus-mysqld-exporter/Dockerfile.j2
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
FROM {{ namespace }}/{{ image_prefix }}prometheus-base:{{ tag }}
|
||||||
|
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
|
||||||
|
|
||||||
|
{% block mysqld_exporter_header %}{% endblock %}
|
||||||
|
|
||||||
|
{% block mysqld_exporter_repository_version %}
|
||||||
|
ENV mysqld_exporter_version=0.10.0
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block mysqld_exporter_install %}
|
||||||
|
RUN curl -ssL -o /tmp/mysqld_exporter.tar.gz https://github.com/prometheus/mysqld_exporter/releases/download/v${mysqld_exporter_version}/mysqld_exporter-${mysqld_exporter_version}.linux-${prometheus_arch}.tar.gz \
|
||||||
|
&& tar xvf /tmp/mysqld_exporter.tar.gz -C /opt/ \
|
||||||
|
&& rm -f /tmp/mysqld_exporter.tar.gz \
|
||||||
|
&& ln -s /opt/mysqld_exporter* /opt/mysqld_exporter
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block mysqld_exporter_footer %}{% endblock %}
|
||||||
|
{% block footer %}{% endblock %}
|
||||||
|
|
||||||
|
USER prometheus
|
20
docker/prometheus/prometheus-node-exporter/Dockerfile.j2
Normal file
20
docker/prometheus/prometheus-node-exporter/Dockerfile.j2
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
FROM {{ namespace }}/{{ image_prefix }}prometheus-base:{{ tag }}
|
||||||
|
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
|
||||||
|
|
||||||
|
{% block node_exporter_header %}{% endblock %}
|
||||||
|
|
||||||
|
{% block node_exporter_repository_version %}
|
||||||
|
ENV node_exporter_version=0.14.0
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block node_exporter_install %}
|
||||||
|
RUN curl -sSL -o /tmp/node_exporter.tar.gz https://github.com/prometheus/node_exporter/releases/download/v${node_exporter_version}/node_exporter-${node_exporter_version}.linux-${prometheus_arch}.tar.gz \
|
||||||
|
&& tar xvf /tmp/node_exporter.tar.gz -C /opt/ \
|
||||||
|
&& rm -f /tmp/node_exporter.tar.gz \
|
||||||
|
&& ln -s /opt/node_exporter* /opt/node_exporter
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block node_exporter_footer %}{% endblock %}
|
||||||
|
{% block footer %}{% endblock %}
|
||||||
|
|
||||||
|
USER prometheus
|
21
docker/prometheus/prometheus-server/Dockerfile.j2
Normal file
21
docker/prometheus/prometheus-server/Dockerfile.j2
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
FROM {{ namespace }}/{{ image_prefix }}prometheus-base:{{ tag }}
|
||||||
|
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
|
||||||
|
|
||||||
|
{% block prometheus_server_header %}{% endblock %}
|
||||||
|
|
||||||
|
{% block prometheus_server_repository_version %}
|
||||||
|
ENV prometheus_version=1.7.1
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block prometheus_server_install %}
|
||||||
|
RUN curl -sSL -o /tmp/prometheus.tar.gz https://github.com/prometheus/prometheus/releases/download/v${prometheus_version}/prometheus-${prometheus_version}.linux-${prometheus_arch}.tar.gz \
|
||||||
|
&& tar xvf /tmp/prometheus.tar.gz -C /opt/ \
|
||||||
|
&& rm -f /tmp/prometheus.tar.gz \
|
||||||
|
&& ln -s /opt/prometheus* /opt/prometheus \
|
||||||
|
&& mkdir -p /etc/prometheus /data
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block prometheus_server_footer %}{% endblock %}
|
||||||
|
{% block footer %}{% endblock %}
|
||||||
|
|
||||||
|
USER prometheus
|
@ -919,7 +919,11 @@ USERS = {
|
|||||||
'blazar-user': {
|
'blazar-user': {
|
||||||
'uid': 42471,
|
'uid': 42471,
|
||||||
'gid': 42471,
|
'gid': 42471,
|
||||||
}
|
},
|
||||||
|
'prometheus-user': {
|
||||||
|
'uid': 42472,
|
||||||
|
'gid': 42472,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- Container image for prometheus timeseries database
|
||||||
|
- Container images for the prometheus exporters node_exporter, mysqld_exporter
|
||||||
|
and haproxy_exporter
|
Loading…
Reference in New Issue
Block a user