diff --git a/.env b/.env new file mode 100644 index 0000000000000000000000000000000000000000..714b76c4c281223d7f9be5bc26d91fcc67828b84 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +COMPOSE_PROJECT_NAME=beats diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f92da7b142f506a53baa2e4028ac3e501c5919d9..e15e707a1e7765dc5a15aca3e3bfafdee9f3e3da 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,3 +2,50 @@ include: - project: shore/ci-templates file: templates/pre-commit.yml + - project: shore/ci-templates + file: templates/docker.yml + +stages: + - test + - build + - push + - deploy + +build: + extends: .compose-build + tags: [ns4.shore.co.il] + +push: + extends: .compose-push + stage: push + tags: [ns4.shore.co.il] + +pull-ns4: + extends: .compose-pull + stage: deploy + tags: [ns4.shore.co.il] + +pull-host01: + extends: .compose-pull + stage: deploy + tags: [host01.shore.co.il] + +pull-kodi: + extends: .compose-pull + stage: deploy + tags: [kodi.shore.co.il] + +run-ns4: + extends: .compose-run + stage: deploy + tags: [ns4.shore.co.il] + +run-host01: + extends: .compose-run + stage: deploy + tags: [host01.shore.co.il] + +run-kodi: + extends: .compose-run + stage: deploy + tags: [kodi.shore.co.il] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..f13f45aaf52b54cf6f413cd46c0262234aaeb86c --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,30 @@ +--- +version: '3.7' +services: + filebeat: + build: + context: filebeat + image: registry.shore.co.il/filebeat + restart: always + + journalbeat: + build: + context: journalbeat + image: registry.shore.co.il/journalbeat + restart: always + + metricbeat: + build: + context: metricbeat + image: registry.shore.co.il/metricbeat + restart: always + + packetbeat: + build: + context: packetbeat + image: registry.shore.co.il/packetbeat + restart: always + +networks: + default: + name: shore diff --git a/filebeat/.dockerignore b/filebeat/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..789981ab6a3b26093b6d19ba87c05ab2a58b905f --- /dev/null +++ b/filebeat/.dockerignore @@ -0,0 +1,2 @@ +* +!filebeat.yml diff --git a/filebeat/Dockerfile b/filebeat/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..d008a904241190d61137c316c8db5e343b8f331b --- /dev/null +++ b/filebeat/Dockerfile @@ -0,0 +1,4 @@ +FROM docker.elastic.co/beats/filebeat-oss:7.12.1 +COPY --chown=root:filebeat filebeat.yml /usr/share/filebeat/filebeat.yml +RUN chmod 640 filebeat.yml && filebeat test config +HEALTHCHECK CMD curl --fail http://localhost:5066/stats || exit 1 diff --git a/filebeat/filebeat.yml b/filebeat/filebeat.yml new file mode 100644 index 0000000000000000000000000000000000000000..58df7c5a192c9f81877309ebce973186cf324c41 --- /dev/null +++ b/filebeat/filebeat.yml @@ -0,0 +1,11 @@ +--- +output.elasticsearch: + hosts: + - https://elasticsearch.shore.co.il + +logging: + level: warning + json: true + +http: + enabled: true diff --git a/journalbeat/.dockerignore b/journalbeat/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..87d59c23c5751f442f618fe29e02cf9261b778be --- /dev/null +++ b/journalbeat/.dockerignore @@ -0,0 +1,2 @@ +* +!journalbeat.yml diff --git a/journalbeat/Dockerfile b/journalbeat/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..c3a5543bfce67889d338a90b93e5a77703be9085 --- /dev/null +++ b/journalbeat/Dockerfile @@ -0,0 +1,4 @@ +FROM docker.elastic.co/beats/journalbeat-oss:7.12.1 +COPY --chown=root:journalbeat journalbeat.yml /usr/share/journalbeat/journalbeat.yml +RUN chmod 640 journalbeat.yml && journalbeat test config +HEALTHCHECK CMD curl --fail http://localhost:5066/stats || exit 1 diff --git a/journalbeat/journalbeat.yml b/journalbeat/journalbeat.yml new file mode 100644 index 0000000000000000000000000000000000000000..58df7c5a192c9f81877309ebce973186cf324c41 --- /dev/null +++ b/journalbeat/journalbeat.yml @@ -0,0 +1,11 @@ +--- +output.elasticsearch: + hosts: + - https://elasticsearch.shore.co.il + +logging: + level: warning + json: true + +http: + enabled: true diff --git a/metricbeat/.dockerignore b/metricbeat/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..236853aa1ec15a72f8380c82865d6d7963868280 --- /dev/null +++ b/metricbeat/.dockerignore @@ -0,0 +1,2 @@ +* +!metricbeat.yml diff --git a/metricbeat/Dockerfile b/metricbeat/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..78c7997eee89c03a16d559590594926529e57861 --- /dev/null +++ b/metricbeat/Dockerfile @@ -0,0 +1,4 @@ +FROM docker.elastic.co/beats/metricbeat-oss:7.12.1 +COPY --chown=root:metricbeat metricbeat.yml /usr/share/metricbeat/metricbeat.yml +RUN chmod 640 metricbeat.yml && metricbeat test config +HEALTHCHECK CMD curl --fail http://localhost:5066/stats || exit 1 diff --git a/metricbeat/metricbeat.yml b/metricbeat/metricbeat.yml new file mode 100644 index 0000000000000000000000000000000000000000..58df7c5a192c9f81877309ebce973186cf324c41 --- /dev/null +++ b/metricbeat/metricbeat.yml @@ -0,0 +1,11 @@ +--- +output.elasticsearch: + hosts: + - https://elasticsearch.shore.co.il + +logging: + level: warning + json: true + +http: + enabled: true diff --git a/packetbeat/.dockerignore b/packetbeat/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..1937d83e3bf56d412256d9d465b102bfbb9583c1 --- /dev/null +++ b/packetbeat/.dockerignore @@ -0,0 +1,2 @@ +* +!packetbeat.yml diff --git a/packetbeat/Dockerfile b/packetbeat/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..b202e6417bbf7dedfd138d3daf3e01dda386e638 --- /dev/null +++ b/packetbeat/Dockerfile @@ -0,0 +1,4 @@ +FROM docker.elastic.co/beats/packetbeat-oss:7.12.1 +COPY --chown=root:packetbeat packetbeat.yml /usr/share/packetbeat/packetbeat.yml +RUN chmod 640 packetbeat.yml && packetbeat test config +HEALTHCHECK CMD curl --fail http://localhost:5066/stats || exit 1 diff --git a/packetbeat/packetbeat.yml b/packetbeat/packetbeat.yml new file mode 100644 index 0000000000000000000000000000000000000000..58df7c5a192c9f81877309ebce973186cf324c41 --- /dev/null +++ b/packetbeat/packetbeat.yml @@ -0,0 +1,11 @@ +--- +output.elasticsearch: + hosts: + - https://elasticsearch.shore.co.il + +logging: + level: warning + json: true + +http: + enabled: true