summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-07-13 13:26:47 +0000
committerGerrit Code Review <review@openstack.org>2018-07-13 13:26:47 +0000
commit692970bc5503ae28cbc89088ba155c8026eb6c2e (patch)
tree8e4fe83c392a1cbfc9c371fb16ceadf370286ab6
parent20736a2111000af3d4b6e2588432c2bd7be55998 (diff)
parent72f85b422635fc8ff6420549efe474c5ab6d1c05 (diff)
Merge "Add support for building Logstash"
-rw-r--r--docker/base/sources.list.ubuntu2
-rw-r--r--docker/logstash/Dockerfile.j244
-rw-r--r--docker/logstash/extend_start.sh8
-rwxr-xr-xkolla/common/config.py5
-rw-r--r--releasenotes/notes/add-logstash-27da5de156efb943.yaml3
5 files changed, 61 insertions, 1 deletions
diff --git a/docker/base/sources.list.ubuntu b/docker/base/sources.list.ubuntu
index b999624..54240fc 100644
--- a/docker/base/sources.list.ubuntu
+++ b/docker/base/sources.list.ubuntu
@@ -12,7 +12,7 @@ deb http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe
12# are qemu, libvirt, and openvswitch. 12# are qemu, libvirt, and openvswitch.
13deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/queens main 13deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/queens main
14 14
15# Elastic & kibana repo 15# Elasticsearch, Logstash & Kibana repo
16deb https://artifacts.elastic.co/packages/5.x/apt stable main 16deb https://artifacts.elastic.co/packages/5.x/apt stable main
17 17
18# InfluxDB repo 18# InfluxDB repo
diff --git a/docker/logstash/Dockerfile.j2 b/docker/logstash/Dockerfile.j2
new file mode 100644
index 0000000..2bb2684
--- /dev/null
+++ b/docker/logstash/Dockerfile.j2
@@ -0,0 +1,44 @@
1FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }}
2LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
3
4{% block logstash_header %}{% endblock %}
5
6{% import "macros.j2" as macros with context %}
7
8{{ macros.configure_user(name='logstash', shell='/bin/bash', homedir='/usr/share/logstash') }}
9
10{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
11 {% set logstash_packages = [
12 'logstash',
13 'java-1.8.0-openjdk-headless'
14 ] %}
15
16ENV JAVA_HOME /usr/lib/jvm/jre-1.8.0-openjdk/
17
18{% elif base_distro in ['debian', 'ubuntu'] %}
19 {% set logstash_packages = [
20 'logstash',
21 'openjdk-8-jre-headless'
22 ] %}
23
24{% if base_arch == 'x86_64' %}
25ARG java_arch=amd64
26{% elif base_arch == 'aarch64' %}
27ARG java_arch=arm64
28{% else %}
29ARG java_arch={{ base_arch }}
30{% endif %}
31
32ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-${java_arch}/
33
34{% endif %}
35
36{{ macros.install_packages(logstash_packages | customizable("packages")) }}
37COPY extend_start.sh /usr/local/bin/kolla_extend_start
38
39RUN chmod 755 /usr/local/bin/kolla_extend_start
40
41{% block logstash_footer %}{% endblock %}
42{% block footer %}{% endblock %}
43
44USER logstash
diff --git a/docker/logstash/extend_start.sh b/docker/logstash/extend_start.sh
new file mode 100644
index 0000000..99152b1
--- /dev/null
+++ b/docker/logstash/extend_start.sh
@@ -0,0 +1,8 @@
1#!/bin/bash
2
3if [[ ! -d "/var/log/kolla/logstash" ]]; then
4 mkdir -p /var/log/kolla/logstash
5fi
6if [[ $(stat -c %a /var/log/kolla/logstash) != "755" ]]; then
7 chmod 755 /var/log/kolla/logstash
8fi
diff --git a/kolla/common/config.py b/kolla/common/config.py
index 89a4c3e..da67d0b 100755
--- a/kolla/common/config.py
+++ b/kolla/common/config.py
@@ -58,6 +58,7 @@ _PROFILE_OPTS = [
58 'keepalived', 58 'keepalived',
59 'kibana', 59 'kibana',
60 'kolla-toolbox', 60 'kolla-toolbox',
61 'logstash',
61 'mariadb', 62 'mariadb',
62 'memcached', 63 'memcached',
63 'mongodb', 64 'mongodb',
@@ -1093,6 +1094,10 @@ USERS = {
1093 'hugetlbfs-user': { 1094 'hugetlbfs-user': {
1094 'uid': 42477, # unused user, but we need the group for vhost socket 1095 'uid': 42477, # unused user, but we need the group for vhost socket
1095 'gid': 42477, 1096 'gid': 42477,
1097 },
1098 'logstash-user': {
1099 'uid': 42478,
1100 'gid': 42478,
1096 } 1101 }
1097} 1102}
1098 1103
diff --git a/releasenotes/notes/add-logstash-27da5de156efb943.yaml b/releasenotes/notes/add-logstash-27da5de156efb943.yaml
new file mode 100644
index 0000000..c469dbf
--- /dev/null
+++ b/releasenotes/notes/add-logstash-27da5de156efb943.yaml
@@ -0,0 +1,3 @@
1---
2features:
3 - Add support for building a Logstash 5.x image.