From 38bc18b1d334780e55cd00e46eb74ea8ef76c726 Mon Sep 17 00:00:00 2001 From: "Dimitri B." Date: Sun, 8 Dec 2024 20:10:06 +0100 Subject: [PATCH] Introduce variables for all used docker images This allows to override the image names with images from private docker repositories. --- .env | 13 +++++++++++++ docker-compose.logs.yml | 2 +- docker-compose.monitor.yml | 6 +++--- docker-compose.nodes.yml | 4 ++-- docker-compose.setup.yml | 4 ++-- docker-compose.yml | 8 ++++---- 6 files changed, 25 insertions(+), 12 deletions(-) diff --git a/.env b/.env index 7308593..c688c8c 100644 --- a/.env +++ b/.env @@ -1,6 +1,19 @@ COMPOSE_PROJECT_NAME=elastic ELK_VERSION=8.10.2 +#----------- Images to use ----------------------# + +# the following images will be appended with the ELK_VERSION version number +ELASTICSEARCH_IMAGE_NAME=elastdocker/elasticsearch +LOGSTASH_IMAGE_NAME=elastdocker/logstash +KIBANA_IMAGE_NAME=elastdocker/kibana +APM_SERVER_IMAGE_NAME=elastdocker/apm-server +FILEBEAT_IMAGE_NAME=docker.elastic.co/beats/filebeat + +# the following images will be used as is +ELASTICSEARCH_EXPORTER_IMAGE=justwatch/elasticsearch_exporter:1.1.0 +LOGSTASH_EXPORTER_IMAGE=alxrem/prometheus-logstash-exporter + #----------- Resources --------------------------# ELASTICSEARCH_HEAP=1024m LOGSTASH_HEAP=512m diff --git a/docker-compose.logs.yml b/docker-compose.logs.yml index 13231fd..778d419 100644 --- a/docker-compose.logs.yml +++ b/docker-compose.logs.yml @@ -7,7 +7,7 @@ volumes: services: # Docker Logs Shipper ------------------------------ filebeat: - image: docker.elastic.co/beats/filebeat:${ELK_VERSION} + image: ${FILEBEAT_IMAGE_NAME}:${ELK_VERSION} restart: always # -e flag to log to stderr and disable syslog/file output command: -e --strict.perms=false diff --git a/docker-compose.monitor.yml b/docker-compose.monitor.yml index c9c60c3..85a7e94 100644 --- a/docker-compose.monitor.yml +++ b/docker-compose.monitor.yml @@ -4,7 +4,7 @@ services: # Prometheus Exporters ------------------------------ elasticsearch-exporter: - image: justwatch/elasticsearch_exporter:1.1.0 + image: ${ELASTICSEARCH_EXPORTER_IMAGE} restart: always command: ["--es.uri", "https://${ELASTIC_USERNAME}:${ELASTIC_PASSWORD}@${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}", "--es.ssl-skip-verify", @@ -15,7 +15,7 @@ services: - "9114:9114" logstash-exporter: - image: alxrem/prometheus-logstash-exporter + image: ${LOGSTASH_EXPORTER_IMAGE} restart: always ports: - "9304:9304" @@ -23,7 +23,7 @@ services: # Cluster Logs Shipper ------------------------------ filebeat-cluster-logs: - image: docker.elastic.co/beats/filebeat:${ELK_VERSION} + image: ${FILEBEAT_IMAGE_NAME}:${ELK_VERSION} restart: always # -e flag to log to stderr and disable syslog/file output command: -e --strict.perms=false diff --git a/docker-compose.nodes.yml b/docker-compose.nodes.yml index 70d737a..9ff67cf 100644 --- a/docker-compose.nodes.yml +++ b/docker-compose.nodes.yml @@ -7,7 +7,7 @@ volumes: services: elasticsearch-1: - image: elastdocker/elasticsearch:${ELK_VERSION} + image: ${ELASTICSEARCH_IMAGE_NAME}:${ELK_VERSION} build: context: elasticsearch/ args: @@ -44,7 +44,7 @@ services: soft: 200000 hard: 200000 elasticsearch-2: - image: elastdocker/elasticsearch:${ELK_VERSION} + image: ${ELASTICSEARCH_IMAGE_NAME}:${ELK_VERSION} build: context: elasticsearch/ args: diff --git a/docker-compose.setup.yml b/docker-compose.setup.yml index 716fb99..9950670 100644 --- a/docker-compose.setup.yml +++ b/docker-compose.setup.yml @@ -2,7 +2,7 @@ version: '3.5' services: keystore: - image: elastdocker/elasticsearch:${ELK_VERSION} + image: ${ELASTICSEARCH_IMAGE_NAME}:${ELK_VERSION} build: context: elasticsearch/ args: @@ -16,7 +16,7 @@ services: ELASTIC_PASSWORD: ${ELASTIC_PASSWORD} certs: - image: elastdocker/elasticsearch:${ELK_VERSION} + image: ${ELASTICSEARCH_IMAGE_NAME}:${ELK_VERSION} build: context: elasticsearch/ args: diff --git a/docker-compose.yml b/docker-compose.yml index 3d895fc..483cc88 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -32,7 +32,7 @@ secrets: services: elasticsearch: - image: elastdocker/elasticsearch:${ELK_VERSION} + image: ${ELASTICSEARCH_IMAGE_NAME}:${ELK_VERSION} build: context: elasticsearch/ args: @@ -77,7 +77,7 @@ services: test: ["CMD", "sh", "-c", "curl -sf --insecure https://$ELASTIC_USERNAME:$ELASTIC_PASSWORD@localhost:$ELASTICSEARCH_PORT/_cat/health | grep -ioE 'green|yellow' || echo 'not green/yellow cluster status'"] logstash: - image: elastdocker/logstash:${ELK_VERSION} + image: ${LOGSTASH_IMAGE_NAME}:${ELK_VERSION} build: context: logstash/ args: @@ -102,7 +102,7 @@ services: test: ["CMD", "curl", "-s" ,"-XGET", "http://127.0.0.1:9600"] kibana: - image: elastdocker/kibana:${ELK_VERSION} + image: ${KIBANA_IMAGE_NAME}:${ELK_VERSION} build: context: kibana/ args: @@ -128,7 +128,7 @@ services: - "${KIBANA_PORT}:${KIBANA_PORT}" apm-server: - image: elastdocker/apm-server:${ELK_VERSION} + image: ${APM_SERVER_IMAGE_NAME}:${ELK_VERSION} build: context: apm-server/ args: