aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docker/base/Dockerfile.j26
-rw-r--r--docker/base/sources.list.ubuntu3
-rw-r--r--docker/sensu/sensu-base/Dockerfile.j221
-rw-r--r--docker/sensu/sensu-client/Dockerfile.j222
-rwxr-xr-xkolla/common/config.py4
-rw-r--r--releasenotes/notes/sensu-client-image-45cb9c4573cd22fe.yaml3
-rw-r--r--tests/test_build.py6
7 files changed, 63 insertions, 2 deletions
diff --git a/docker/base/Dockerfile.j2 b/docker/base/Dockerfile.j2
index 8a6d04470..2f5b5ea98 100644
--- a/docker/base/Dockerfile.j2
+++ b/docker/base/Dockerfile.j2
@@ -128,12 +128,14 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
{% if base_arch == 'x86_64' %}
{% set base_centos_yum_repo_keys = base_centos_yum_repo_keys + [
+ '/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-OpsTools',
'/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Storage',
'/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization'
] %}
{% set base_centos_yum_repo_packages = base_centos_yum_repo_packages + [
'centos-release-ceph-jewel',
+ 'centos-release-opstools',
'centos-release-qemu-ev'
] %}
{% endif %}
@@ -178,11 +180,13 @@ RUN yum -y install \
&& rpm -Uvh --nodeps \
https://buildlogs.centos.org/centos/7/cloud/x86_64/openstack-mitaka/centos-release-openstack-mitaka-1-3.el7.noarch.rpm \
http://mirror.centos.org/centos-7/7/extras/x86_64/Packages/centos-release-ceph-jewel-1.0-1.el7.centos.noarch.rpm \
+ http://mirror.centos.org/centos-7/7/extras/x86_64/Packages/centos-release-opstools-1-6.el7.centos.noarch.rpm \
http://mirror.centos.org/centos-7/7/extras/x86_64/Packages/centos-release-qemu-ev-1.0-1.el7.noarch.rpm \
http://mirror.centos.org/centos-7/7/extras/x86_64/Packages/centos-release-virt-common-1-1.el7.centos.noarch.rpm \
http://mirror.centos.org/centos-7/7/extras/x86_64/Packages/centos-release-storage-common-1-2.el7.centos.noarch.rpm \
&& sed -i 's/\$releasever/7/g' /etc/yum.repos.d/CentOS-*.repo \
&& rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 \
+ && rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-OpsTools \
&& rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Storage \
&& rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization \
&& yum-config-manager --enable ol7_optional_latest ol7_addons \
@@ -299,6 +303,7 @@ COPY apt_preferences.{{ base_distro }} /etc/apt/preferences
{# 58118E89F3A912897C070ADBF76221572C52609D -- Docker Release Tool (releasedocker) <docker@docker.com> #}
{# 4D8EB5FDA37AB55F41A135203BF88A0C6A770882 -- Apache Qpid PPA Signing Key <dev@qpid.apache.org> #}
{# 901F9177AB97ACBE -- Treasure Data, Inc (Treasure Agent Official Signing key) <support@treasure-data.com> #}
+ {# A20F259AEB9C94BB -- Sensuapp (Freight) <support@hw-ops.com> #}
{% set base_apt_keys = [
'05CE15085FC09D18E99EFB22684A14CF2582E0C5',
'177F4010FE56CA3336300305F1656F24C74CD1D8',
@@ -309,6 +314,7 @@ COPY apt_preferences.{{ base_distro }} /etc/apt/preferences
'58118E89F3A912897C070ADBF76221572C52609D',
'4D8EB5FDA37AB55F41A135203BF88A0C6A770882',
'901F9177AB97ACBE',
+ 'A20F259AEB9C94BB'
] %}
{% elif base_distro == 'debian' %}
{% set base_apt_keys = [
diff --git a/docker/base/sources.list.ubuntu b/docker/base/sources.list.ubuntu
index d81692fdb..f02536273 100644
--- a/docker/base/sources.list.ubuntu
+++ b/docker/base/sources.list.ubuntu
@@ -38,3 +38,6 @@ deb http://packages.treasuredata.com/2/ubuntu/xenial/ xenial contrib
# Qdrouterd repo
deb http://ppa.launchpad.net/qpid/released/ubuntu/ xenial main
+
+# Sensu repo
+deb https://sensu.global.ssl.fastly.net/apt xenial main
diff --git a/docker/sensu/sensu-base/Dockerfile.j2 b/docker/sensu/sensu-base/Dockerfile.j2
new file mode 100644
index 000000000..f12e6f12f
--- /dev/null
+++ b/docker/sensu/sensu-base/Dockerfile.j2
@@ -0,0 +1,21 @@
+FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }}
+LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
+
+{% block sensu_base_header %}{% endblock %}
+
+{% import "macros.j2" as macros with context %}
+
+{{ macros.configure_user(name='sensu') }}
+
+{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
+ {% set sensu_base_packages = ['sensu'] %}
+{% elif base_distro in ['ubuntu'] %}
+ {% set sensu_base_packages = ['sensu'] %}
+{% else %}
+RUN echo '{{ image_name }} not yet available for {{ base_distro }}' \
+ && /bin/false
+{% endif %}
+
+{{ macros.install_packages(sensu_base_packages | customizable("packages")) }}
+
+{% block sensu_base_footer %}{% endblock %}
diff --git a/docker/sensu/sensu-client/Dockerfile.j2 b/docker/sensu/sensu-client/Dockerfile.j2
new file mode 100644
index 000000000..16abaa97f
--- /dev/null
+++ b/docker/sensu/sensu-client/Dockerfile.j2
@@ -0,0 +1,22 @@
+FROM {{ namespace }}/{{ image_prefix }}sensu-base:{{ tag }}
+LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
+
+{% block sensu_client_header %}{% endblock %}
+
+{% import "macros.j2" as macros with context %}
+
+{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
+ {% set sensu_client_packages = ['docker-client', 'osops-tools-monitoring-oschecks'] %}
+{% elif base_distro in ['debian', 'ubuntu'] %}
+ {% set sensu_client_packages = ['docker.io'] %}
+{% else %}
+RUN echo '{{ image_name }} not yet available for {{ base_distro }}' \
+ && /bin/false
+{% endif %}
+
+{{ macros.install_packages(sensu_client_packages | customizable("packages")) }}
+
+{% block sensu_client_footer %}{% endblock %}
+{% block footer %}{% endblock %}
+
+USER sensu
diff --git a/kolla/common/config.py b/kolla/common/config.py
index 5c8ba3f33..d068e81ab 100755
--- a/kolla/common/config.py
+++ b/kolla/common/config.py
@@ -862,6 +862,10 @@ USERS = {
'ec2api-user': {
'uid': 42466,
'gid': 42466,
+ },
+ 'sensu-user': {
+ 'uid': 42467,
+ 'gid': 42467,
}
}
diff --git a/releasenotes/notes/sensu-client-image-45cb9c4573cd22fe.yaml b/releasenotes/notes/sensu-client-image-45cb9c4573cd22fe.yaml
new file mode 100644
index 000000000..e1ab9854e
--- /dev/null
+++ b/releasenotes/notes/sensu-client-image-45cb9c4573cd22fe.yaml
@@ -0,0 +1,3 @@
+---
+features:
+ - Adds possibility to have container with sensu-client service.
diff --git a/tests/test_build.py b/tests/test_build.py
index 42f8aa95a..bba5101c4 100644
--- a/tests/test_build.py
+++ b/tests/test_build.py
@@ -146,7 +146,7 @@ class BuildTestUbuntuBinary(BuildTest, base.BaseTestCase):
class BuildTestUbuntuSource(BuildTest, base.BaseTestCase):
excluded_images = [
"bifrost-base",
- "opendaylight"
+ "opendaylight",
]
def setUp(self):
@@ -173,6 +173,7 @@ class BuildTestDebianBinary(BuildTest, base.BaseTestCase):
"panko-base",
"searchlight-base",
"senlin-base",
+ "sensu-base",
"solum-base",
"tacker",
"vitrage-base",
@@ -190,7 +191,8 @@ class BuildTestDebianBinary(BuildTest, base.BaseTestCase):
class BuildTestDebianSource(BuildTest, base.BaseTestCase):
excluded_images = [
"bifrost-base",
- "opendaylight"
+ "opendaylight",
+ "sensu-base",
]
def setUp(self):