summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2020-07-01 12:18:08 +0000
committerGerrit Code Review <review@openstack.org>2020-07-01 12:18:08 +0000
commit58337efa45d4279a84ba75e515f0e0deb62a3e1f (patch)
treef9e808eae8949ba4aacd38eb52b92c94c1ad49c3
parent30ea0594f6bcb9a525a64ba94dd0d6a30cc86fcf (diff)
parent30303fddd4b067b52aad6d45b5718097de3ee43a (diff)
downloadkolla-58337efa45d4279a84ba75e515f0e0deb62a3e1f.tar.gz
kolla-58337efa45d4279a84ba75e515f0e0deb62a3e1f.zip
Merge "Add Elasticsearch Curator Docker image" into stable/train
-rw-r--r--docker/elasticsearch/elasticsearch-curator/Dockerfile.j240
-rw-r--r--docker/elasticsearch/elasticsearch-curator/extend_start.sh8
-rw-r--r--docker/elasticsearch/elasticsearch/Dockerfile.j2 (renamed from docker/elasticsearch/Dockerfile.j2)0
-rw-r--r--docker/elasticsearch/elasticsearch/extend_start.sh (renamed from docker/elasticsearch/extend_start.sh)0
-rw-r--r--releasenotes/notes/add-elasticsearch-curator-88089d04f7ccd549.yaml4
5 files changed, 52 insertions, 0 deletions
diff --git a/docker/elasticsearch/elasticsearch-curator/Dockerfile.j2 b/docker/elasticsearch/elasticsearch-curator/Dockerfile.j2
new file mode 100644
index 000000000..7497163bc
--- /dev/null
+++ b/docker/elasticsearch/elasticsearch-curator/Dockerfile.j2
@@ -0,0 +1,40 @@
+FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }}
+LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
+
+{% block elasticsearch_curator_header %}{% endblock %}
+
+{% import "macros.j2" as macros with context %}
+
+{% if base_package_type == 'rpm' %}
+ {% set elasticsearch_curator_packages = [
+ 'cronie',
+ 'python3-pip',
+ ] %}
+{% elif base_package_type == 'deb' %}
+ {% set elasticsearch_curator_packages = [
+ 'cron',
+ 'python3-pip',
+ 'python3-setuptools'
+ ] %}
+{% endif %}
+
+{{ macros.install_packages(elasticsearch_curator_packages | customizable("packages")) }}
+
+{{ macros.configure_user(name='elasticsearch') }}
+
+{% set elasticsearch_curator_pip_packages = [
+ 'elasticsearch-curator'
+] %}
+
+RUN {{ macros.install_pip(elasticsearch_curator_pip_packages | customizable("pip_packages"), constraints=false, pip_version="pip3") }} \
+ && mkdir -p /etc/elasticsearch-curator \
+ && chown -R elasticsearch: /etc/elasticsearch-curator
+
+COPY extend_start.sh /usr/local/bin/kolla_extend_start
+RUN chmod 755 /usr/local/bin/kolla_extend_start
+
+{% block elasticsearch_curator_base_footer %}{% endblock %}
+{% block footer %}{% endblock %}
+
+# NOTE(dszumski): Cron runs as root but should be configured to launch Curator
+# by the elasticsearch user.
diff --git a/docker/elasticsearch/elasticsearch-curator/extend_start.sh b/docker/elasticsearch/elasticsearch-curator/extend_start.sh
new file mode 100644
index 000000000..8af0cdd15
--- /dev/null
+++ b/docker/elasticsearch/elasticsearch-curator/extend_start.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+# NOTE(dszumski): Cron runs as root but should be configured to launch Curator
+# by the elasticsearch user. Therefore this directory needs to be owned by
+# the elasticsearch user.
+if [[ ! -d "/var/log/kolla/elasticsearch" ]]; then
+ install -d -m 0755 -o elasticsearch -g elasticsearch /var/log/kolla/elasticsearch
+fi
diff --git a/docker/elasticsearch/Dockerfile.j2 b/docker/elasticsearch/elasticsearch/Dockerfile.j2
index 7856444b9..7856444b9 100644
--- a/docker/elasticsearch/Dockerfile.j2
+++ b/docker/elasticsearch/elasticsearch/Dockerfile.j2
diff --git a/docker/elasticsearch/extend_start.sh b/docker/elasticsearch/elasticsearch/extend_start.sh
index b39f5b334..b39f5b334 100644
--- a/docker/elasticsearch/extend_start.sh
+++ b/docker/elasticsearch/elasticsearch/extend_start.sh
diff --git a/releasenotes/notes/add-elasticsearch-curator-88089d04f7ccd549.yaml b/releasenotes/notes/add-elasticsearch-curator-88089d04f7ccd549.yaml
new file mode 100644
index 000000000..79bd070ca
--- /dev/null
+++ b/releasenotes/notes/add-elasticsearch-curator-88089d04f7ccd549.yaml
@@ -0,0 +1,4 @@
+---
+features:
+ - |
+ Adds Elasticsearch Curator for managing aggregated log data.