Skip to content

Commit cd465b9

Browse files
authored
Add Elasticsearch Curator Docker image (#46)
* Add Elasticsearch Curator Docker image Kolla provides log aggregation, but no solution to set retention periods for aggregated logs. It therefore accumulates log data indefinitely unless a user manually intervenes. This change adds Elasticsearch Curator which provides a mechanism for automating such retention periods [1]. [1] https://www.elastic.co/guide/en/elasticsearch/client/curator/current/about.html The container contains cron to support running Curator periodically. Change-Id: Ief2c554a64ef6cc971635d7e2a718f63c310fbf6 (cherry picked from commit 37de892) * Changes to backport ES Curator patch from Train Change-Id: Id9e0b558267b593363a6adf217d8939c024f70e3
1 parent c1c198d commit cd465b9

File tree

5 files changed

+51
-0
lines changed

5 files changed

+51
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }}
2+
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
3+
4+
{% block elasticsearch_curator_header %}{% endblock %}
5+
6+
{% import "macros.j2" as macros with context %}
7+
8+
{% if base_package_type == 'rpm' %}
9+
{% set elasticsearch_curator_packages = [
10+
'cronie',
11+
'python-pip',
12+
] %}
13+
{% elif base_package_type == 'deb' %}
14+
{% set elasticsearch_curator_packages = [
15+
'cron',
16+
'python-pip',
17+
] %}
18+
{% endif %}
19+
20+
{{ macros.install_packages(elasticsearch_curator_packages | customizable("packages")) }}
21+
22+
{{ macros.configure_user(name='elasticsearch') }}
23+
24+
{% set elasticsearch_curator_pip_packages = [
25+
'elasticsearch-curator'
26+
] %}
27+
28+
RUN {{ macros.install_pip(elasticsearch_curator_pip_packages | customizable("pip_packages"), constraints = false) }} \
29+
&& mkdir -p /etc/elasticsearch-curator \
30+
&& chown -R elasticsearch: /etc/elasticsearch-curator
31+
32+
COPY extend_start.sh /usr/local/bin/kolla_extend_start
33+
RUN chmod 755 /usr/local/bin/kolla_extend_start
34+
35+
{% block elasticsearch_curator_base_footer %}{% endblock %}
36+
{% block footer %}{% endblock %}
37+
38+
# NOTE(dszumski): Cron runs as root but should be configured to launch Curator
39+
# by the elasticsearch user.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
# NOTE(dszumski): Cron runs as root but should be configured to launch Curator
4+
# by the elasticsearch user. Therefore this directory needs to be owned by
5+
# the elasticsearch user.
6+
if [[ ! -d "/var/log/kolla/elasticsearch" ]]; then
7+
install -d -m 0755 -o elasticsearch -g elasticsearch /var/log/kolla/elasticsearch
8+
fi
File renamed without changes.
File renamed without changes.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
features:
3+
- |
4+
Adds Elasticsearch Curator for managing aggregated log data.

0 commit comments

Comments
 (0)