Skip to content

Commit

Permalink
Merge pull request #59 from sherifabdlnaby/v2.1.0
Browse files Browse the repository at this point in the history
V2.1.0
  • Loading branch information
sherifabdlnaby authored Feb 25, 2022
2 parents 05d934b + 04637d7 commit 1929804
Show file tree
Hide file tree
Showing 10 changed files with 114 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
COMPOSE_PROJECT_NAME=elastic
ELK_VERSION=7.16.2
ELK_VERSION=7.17.0

#----------- Resources --------------------------#
ELASTICSEARCH_HEAP=1024m
Expand Down
18 changes: 5 additions & 13 deletions .github/auto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ categories:
- 'enhancement'
- 'feature'
- 'patch'
- title: '⬆️ Updates'
- title: '⬆️ Upgrades'
labels:
- 'dependency-update'
- 'upgrades'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
Expand All @@ -42,16 +42,16 @@ categories:
- 'auto-update'
- title: '📝 Documentation'
labels:
- 'chore'
- 'docs'

autolabeler:
- label: 'chore'
- label: 'docs'
files:
- '*.md'
- label: 'enhancement'
title: '/enhancement|fixes/i'

- label: 'dependency-update'
- label: 'upgrades'
title: '/⬆️/i'

- label: 'bugfix'
Expand All @@ -77,11 +77,3 @@ template: |
## Changes
$CHANGES
replacers:
# Remove irrelevant information from Renovate bot
- search: '/(?<=---\s+)+^#.*(Renovate configuration|Configuration)(?:.|\n)*?This PR has been generated .*/gm'
replace: ''
# Remove Renovate bot banner image
- search: '/\[!\[[^\]]*Renovate\][^\]]*\](\([^)]*\))?\s*\n+/gm'
replace: ''
33 changes: 33 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# A sample workflow which checks out the code, builds a container
# image using Docker and scans that image for vulnerabilities using
# Snyk. The results are then uploaded to GitHub Security Code Scanning
#
# For more examples, including how to limit scans to only high-severity
# issues, monitor images for newly disclosed vulnerabilities in Snyk and
# fail PR checks for new vulnerabilities, see https://github.com/snyk/actions/

name: Build
on:
push:
branches: [ main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]

jobs:
Run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build & Deploy
run: make setup && make up
- name: Test Elasticsearch
run: timeout 240s sh -c "until curl https://elastic:changeme@localhost:9200 --insecure --silent; do echo 'Elasticsearch Not Up, Retrying...'; sleep 3; done" && echo 'Elasticsearch is up'
- name: Test Kibana
run: timeout 240s sh -c "until curl https://localhost:5601 --insecure --silent; do echo 'Kibana Not Ready, Retrying...'; sleep 3; done" && echo 'Kibana is up'

9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@
<h4 align="center">Configured to be ready to be used for Log, Metrics, APM, Alerting, Machine Learning, and Security (SIEM) usecases.</h4>
<p align="center">
<a>
<img src="https://img.shields.io/badge/Elastic%20Stack-7.16.2-blue?style=flat&logo=elasticsearch" alt="Elastic Stack Version 7^^">
<img src="https://img.shields.io/badge/Elastic%20Stack-7.17.0-blue?style=flat&logo=elasticsearch" alt="Elastic Stack Version 7^^">
</a>
<a>
<img src="https://img.shields.io/github/v/tag/sherifabdlnaby/elastdocker?label=release&amp;sort=semver">
</a>
<a href="https://github.com/sherifabdlnaby/elastdocker/actions/workflows/build.yml">
<img src="https://github.com/sherifabdlnaby/elastdocker/actions/workflows/build.yml/badge.svg">
</a>
<a>
<img src="https://img.shields.io/badge/Log4Shell-mitigated-brightgreen?style=flat&logo=java">
</a>
Expand All @@ -35,7 +38,7 @@ Suitable for Demoing, MVPs and small production deployments.

Based on [Official Elastic Docker Images](https://www.docker.elastic.co/)

Stack Version: [7.16.2](https://www.elastic.co/blog/elastic-stack-7-16-2-released)
Stack Version: [7.17.0](https://www.elastic.co/blog/elastic-stack-7-17-0-released)
> You can change Elastic Stack version by setting `ELK_VERSION` in `.env` file and rebuild your images. Any version >= 7.0.0 is compatible with this template.
### Main Features 📜
Expand Down Expand Up @@ -180,7 +183,7 @@ $ make prune
* Some Configuration are parameterized in the `.env` file.
* `ELASTIC_PASSWORD`, user `elastic`'s password (default: `changeme` _pls_).
* `ELK_VERSION` Elastic Stack Version (default: `7.16.2`)
* `ELK_VERSION` Elastic Stack Version (default: `7.17.0`)
* `ELASTICSEARCH_HEAP`, how much Elasticsearch allocate from memory (default: 1GB -good for development only-)
* `LOGSTASH_HEAP`, how much Logstash allocate from memory.
* Other configurations which their such as cluster name, and node name, etc.
Expand Down
12 changes: 10 additions & 2 deletions docker-compose.nodes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ volumes:

services:
elasticsearch-1:
image: docker.elastic.co/elasticsearch/elasticsearch:${ELK_VERSION}
image: elastdocker/elasticsearch:${ELK_VERSION}
build:
context: elasticsearch/
args:
ELK_VERSION: ${ELK_VERSION}
restart: unless-stopped
environment:
ELASTIC_USERNAME: ${ELASTIC_USERNAME}
Expand Down Expand Up @@ -39,7 +43,11 @@ services:
soft: 200000
hard: 200000
elasticsearch-2:
image: docker.elastic.co/elasticsearch/elasticsearch:${ELK_VERSION}
image: elastdocker/elasticsearch:${ELK_VERSION}
build:
context: elasticsearch/
args:
ELK_VERSION: ${ELK_VERSION}
restart: unless-stopped
environment:
ELASTIC_USERNAME: ${ELASTIC_USERNAME}
Expand Down
18 changes: 15 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ secrets:

services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:${ELK_VERSION}
image: elastdocker/elasticsearch:${ELK_VERSION}
build:
context: elasticsearch/
args:
ELK_VERSION: ${ELK_VERSION}
restart: unless-stopped
environment:
ELASTIC_USERNAME: ${ELASTIC_USERNAME}
Expand Down Expand Up @@ -64,7 +68,11 @@ services:
test: ["CMD", "sh", "-c", "curl -sf --insecure https://$ELASTIC_USERNAME:$ELASTIC_PASSWORD@localhost:9200/_cat/health | grep -ioE 'green|yellow' || echo 'not green/yellow cluster status'"]

logstash:
image: docker.elastic.co/logstash/logstash:${ELK_VERSION}
image: elastdocker/logstash:${ELK_VERSION}
build:
context: logstash/
args:
ELK_VERSION: $ELK_VERSION
restart: unless-stopped
volumes:
- ./logstash/config/logstash.yml:/usr/share/logstash/config/logstash.yml:ro
Expand All @@ -85,7 +93,11 @@ services:
test: ["CMD", "curl", "-s" ,"-XGET", "http://127.0.0.1:9600"]

kibana:
image: docker.elastic.co/kibana/kibana:${ELK_VERSION}
image: elastdocker/kibana:${ELK_VERSION}
build:
context: kibana/
args:
ELK_VERSION: $ELK_VERSION
restart: unless-stopped
volumes:
- ./kibana/config/:/usr/share/kibana/config:ro
Expand Down
12 changes: 12 additions & 0 deletions elasticsearch/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ARG ELK_VERSION

# https://github.com/elastic/elasticsearch-docker
FROM docker.elastic.co/elasticsearch/elasticsearch:${ELK_VERSION}

# Add healthcheck
COPY scripts/docker-healthcheck .
HEALTHCHECK CMD sh ./docker-healthcheck

# Add your elasticsearch plugins setup here
# Example: RUN elasticsearch-plugin install analysis-icu
#RUN elasticsearch-plugin install --batch repository-s3
14 changes: 14 additions & 0 deletions elasticsearch/scripts/docker-healthcheck
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
set -eo pipefail

host="$(hostname --ip-address || echo '127.0.0.1')"

if health="$(curl -fsSL "http://$ELASTIC_USERNAME:$ELASTIC_PASSWORD@$host:9200/_cat/health?h=status")"; then
health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ")
if [ "$health" = 'green' ] || [ "$health" = "yellow" ]; then
exit 0
fi
echo >&2 "unexpected health status: $health"
fi

exit 1
8 changes: 8 additions & 0 deletions kibana/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ARG ELK_VERSION

# https://github.com/elastic/kibana-docker
FROM docker.elastic.co/kibana/kibana:${ELK_VERSION}
ARG ELK_VERSION

# Add your kibana plugins setup here
# Example: RUN kibana-plugin install <name|url>
10 changes: 10 additions & 0 deletions logstash/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
ARG ELK_VERSION

# https://github.com/elastic/logstash-docker
FROM docker.elastic.co/logstash/logstash:${ELK_VERSION}

HEALTHCHECK --interval=240s --timeout=120s --retries=5 \
CMD curl -s -XGET 'http://127.0.0.1:9600'

# Add your logstash plugins setup here
# Example: RUN logstash-plugin install logstash-filter-json

0 comments on commit 1929804

Please sign in to comment.