From 678cfe4791cec97952978990e5ac0a49bb48941c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Ko=C5=82odziejczyk?= Date: Sun, 28 Jul 2024 22:24:41 +0200 Subject: [PATCH] improvements --- elk-ror/conf/es/readonlyrest.yml | 14 ++++++++++++++ elk-ror/conf/kbn/kbn-proxy-nginx.conf | 15 +++++++++++++++ elk-ror/docker-compose.yml | 25 ++++++++++++++++++++++--- elk-ror/images/kbn/Proxy-Dockerfile | 3 +++ elk-ror/stop-and-clean.sh | 2 +- 5 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 elk-ror/conf/kbn/kbn-proxy-nginx.conf create mode 100644 elk-ror/images/kbn/Proxy-Dockerfile diff --git a/elk-ror/conf/es/readonlyrest.yml b/elk-ror/conf/es/readonlyrest.yml index beb88ba..0d80cc8 100644 --- a/elk-ror/conf/es/readonlyrest.yml +++ b/elk-ror/conf/es/readonlyrest.yml @@ -60,6 +60,20 @@ readonlyrest: ror_kbn_auth: name: "kbn1" + - name: "Reporting tests: user2" + auth_key: user2:dev + kibana: + index: ".kibana_user2" + access: rw + indices: [ "invoices" ] + + - name: "Reporting tests: user3" + auth_key: user3:dev + kibana: + index: ".kibana_user3" + access: rw + indices: [ "invoices" ] + # USERS TO GROUPS ############ users: - username: admin diff --git a/elk-ror/conf/kbn/kbn-proxy-nginx.conf b/elk-ror/conf/kbn/kbn-proxy-nginx.conf new file mode 100644 index 0000000..c9efe0e --- /dev/null +++ b/elk-ror/conf/kbn/kbn-proxy-nginx.conf @@ -0,0 +1,15 @@ +events { } + +http { + upstream kbn-ror { + server kbn-ror:5601; + } + + server { + listen 80; + + location / { + proxy_pass http://kbn-ror; + } + } +} \ No newline at end of file diff --git a/elk-ror/docker-compose.yml b/elk-ror/docker-compose.yml index 8dd793f..67d63dd 100644 --- a/elk-ror/docker-compose.yml +++ b/elk-ror/docker-compose.yml @@ -42,12 +42,18 @@ services: depends_on: es-ror: condition: service_healthy - ports: - - "5601:5601" + deploy: + mode: replicated + replicas: 3 environment: ELASTIC_USER_PASSWORD: elastic ES_API_URL: http://es-ror:9200 - # todo: healthcheck + healthcheck: + test: [ "CMD", "curl", "--fail", "http://localhost:5601/api/status" ] + interval: 10s + timeout: 10s + retries: 30 + start_period: 60s networks: - es-ror-network ulimits: @@ -55,6 +61,19 @@ services: soft: -1 hard: -1 + kbn-proxy: + build: + context: ../. + dockerfile: elk-ror/images/kbn/Proxy-Dockerfile + depends_on: + kbn-ror: + condition: service_healthy + ports: + - "5601:80" + # todo: healthcheck + networks: + - es-ror-network + networks: es-ror-network: driver: bridge diff --git a/elk-ror/images/kbn/Proxy-Dockerfile b/elk-ror/images/kbn/Proxy-Dockerfile new file mode 100644 index 0000000..cebcf37 --- /dev/null +++ b/elk-ror/images/kbn/Proxy-Dockerfile @@ -0,0 +1,3 @@ +FROM nginx:latest + +COPY elk-ror/conf/kbn/kbn-proxy-nginx.conf /etc/nginx/nginx.conf \ No newline at end of file diff --git a/elk-ror/stop-and-clean.sh b/elk-ror/stop-and-clean.sh index 2940268..e082c38 100755 --- a/elk-ror/stop-and-clean.sh +++ b/elk-ror/stop-and-clean.sh @@ -4,6 +4,6 @@ cd "$(dirname "$0")" echo "Stopping and cleaning environment the tests were being run at ..." -docker-compose rm --stop --force +docker compose rm --stop --force echo "Done!" \ No newline at end of file