Skip to content
Commits on Source (2)
COMPOSE_PROJECT_NAME=es
......@@ -2,3 +2,25 @@
include:
- project: shore/ci-templates
file: templates/pre-commit.yml
- project: shore/ci-templates
file: templates/docker.yml
stages:
- test
- build
- deploy
build:
extends: .compose-build
tags: &tags [host01.shore.co.il]
variables:
DOCKER_BUILDKIT: ""
COMPOSE_DOCKER_CLI_BUILD: ""
pull:
extends: .compose-pull
tags: *tags
run:
extends: .compose-run
tags: *tags
*
!crontab
!config.yml
!actions.yml
# hadolint ignore=DL3006
FROM registry.shore.co.il/cron
USER root
# hadolint ignore=DL3018
RUN apk add --update --no-cache py3-pip
RUN python3 -m pip install --no-cache-dir elasticsearch-curator==5.8.4
USER nobody
COPY --chown=root:root config.yml actions.yml /etc/curator/
---
actions:
1:
action: delete_indices
description: Delete old indices
ignore_empty_list: True
filters:
- filtertype: pattern
kind: timestring
value: '%Y.%m.%d'
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: 3
---
client:
hosts:
- elasticsearch
0 3 * * * curator --config /etc/curator/config.yml /etc/curator/actions.yml || wget --spider https://notify.shore.co.il/send?message=Elasticsearch%20curator%20failed.
---
version: '3.7'
services:
curator:
build:
context: curator
links:
- elasticsearch
restart: always
elasticsearch:
environment:
'node.name': elasticsearch.shore.co.il
'cluster.name': shore.co.il
'discovery.type': single-node
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
healthcheck:
test: ["CMD", "curl", "--fail", "http://localhost:9200/_cat/health"]
image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2
restart: always
volumes:
- elasticsearch:/usr/share/elasticsearch/data
filebeat_setup:
command: >
filebeat setup
-E output.elasticsearch.hosts=['elasticsearch:9200']
-E setup.kibana.host=kibana:5601
-E setup.ilm.overwrite=true
image: docker.elastic.co/beats/filebeat-oss:7.12.1
links: &beat_links
- elasticsearch
- kibana
restart: on-failure
heartbeat_setup:
command: >
heartbeat setup
-E output.elasticsearch.hosts=['elasticsearch:9200']
-E setup.kibana.host=kibana:5601
-E setup.ilm.overwrite=true
image: docker.elastic.co/beats/heartbeat-oss:7.12.1
links: *beat_links
restart: on-failure
kibana:
environment:
ELASTICSEARCH_HOSTS: |
["http://elasticsearch:9200"]
TELEMETARY_OPTIN: !!str false
healthcheck:
test: ["CMD", "curl", "--fail", "http://localhost:5601/api/status"]
image: docker.elastic.co/kibana/kibana-oss:7.10.2
links:
- elasticsearch
restart: always
metricbeat_setup:
command: >
metricbeat setup
-E output.elasticsearch.hosts=['elasticsearch:9200']
-E setup.kibana.host=kibana:5601
-E setup.ilm.overwrite=true
image: docker.elastic.co/beats/metricbeat-oss:7.12.1
links: *beat_links
restart: on-failure
packetbeat_setup:
command: >
packetbeat setup
-E output.elasticsearch.hosts=['elasticsearch:9200']
-E setup.kibana.host=kibana:5601
-E setup.ilm.overwrite=true
image: docker.elastic.co/beats/packetbeat-oss:7.12.1
links: *beat_links
restart: on-failure
volumes:
elasticsearch:
networks:
default:
name: shore