Add support for building Logstash
Add support for building Logstash 5.x for both Centos and Debian based x86 distros. Partially-Implements: blueprint monasca-containers Change-Id: I4e2422d1cd2ae4c1f4aa63e8e543e725a1dc840c
This commit is contained in:
parent
932f31593a
commit
72f85b4226
@ -12,7 +12,7 @@ deb http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe
|
||||
# are qemu, libvirt, and openvswitch.
|
||||
deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/queens main
|
||||
|
||||
# Elastic & kibana repo
|
||||
# Elasticsearch, Logstash & Kibana repo
|
||||
deb https://artifacts.elastic.co/packages/5.x/apt stable main
|
||||
|
||||
# InfluxDB repo
|
||||
|
44
docker/logstash/Dockerfile.j2
Normal file
44
docker/logstash/Dockerfile.j2
Normal file
@ -0,0 +1,44 @@
|
||||
FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }}
|
||||
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
|
||||
|
||||
{% block logstash_header %}{% endblock %}
|
||||
|
||||
{% import "macros.j2" as macros with context %}
|
||||
|
||||
{{ macros.configure_user(name='logstash', shell='/bin/bash', homedir='/usr/share/logstash') }}
|
||||
|
||||
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
|
||||
{% set logstash_packages = [
|
||||
'logstash',
|
||||
'java-1.8.0-openjdk-headless'
|
||||
] %}
|
||||
|
||||
ENV JAVA_HOME /usr/lib/jvm/jre-1.8.0-openjdk/
|
||||
|
||||
{% elif base_distro in ['debian', 'ubuntu'] %}
|
||||
{% set logstash_packages = [
|
||||
'logstash',
|
||||
'openjdk-8-jre-headless'
|
||||
] %}
|
||||
|
||||
{% if base_arch == 'x86_64' %}
|
||||
ARG java_arch=amd64
|
||||
{% elif base_arch == 'aarch64' %}
|
||||
ARG java_arch=arm64
|
||||
{% else %}
|
||||
ARG java_arch={{ base_arch }}
|
||||
{% endif %}
|
||||
|
||||
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-${java_arch}/
|
||||
|
||||
{% endif %}
|
||||
|
||||
{{ macros.install_packages(logstash_packages | customizable("packages")) }}
|
||||
COPY extend_start.sh /usr/local/bin/kolla_extend_start
|
||||
|
||||
RUN chmod 755 /usr/local/bin/kolla_extend_start
|
||||
|
||||
{% block logstash_footer %}{% endblock %}
|
||||
{% block footer %}{% endblock %}
|
||||
|
||||
USER logstash
|
8
docker/logstash/extend_start.sh
Normal file
8
docker/logstash/extend_start.sh
Normal file
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ ! -d "/var/log/kolla/logstash" ]]; then
|
||||
mkdir -p /var/log/kolla/logstash
|
||||
fi
|
||||
if [[ $(stat -c %a /var/log/kolla/logstash) != "755" ]]; then
|
||||
chmod 755 /var/log/kolla/logstash
|
||||
fi
|
@ -58,6 +58,7 @@ _PROFILE_OPTS = [
|
||||
'keepalived',
|
||||
'kibana',
|
||||
'kolla-toolbox',
|
||||
'logstash',
|
||||
'mariadb',
|
||||
'memcached',
|
||||
'mongodb',
|
||||
@ -1093,6 +1094,10 @@ USERS = {
|
||||
'hugetlbfs-user': {
|
||||
'uid': 42477, # unused user, but we need the group for vhost socket
|
||||
'gid': 42477,
|
||||
},
|
||||
'logstash-user': {
|
||||
'uid': 42478,
|
||||
'gid': 42478,
|
||||
}
|
||||
}
|
||||
|
||||
|
3
releasenotes/notes/add-logstash-27da5de156efb943.yaml
Normal file
3
releasenotes/notes/add-logstash-27da5de156efb943.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
features:
|
||||
- Add support for building a Logstash 5.x image.
|
Loading…
x
Reference in New Issue
Block a user