From be3a12a603629a3778c6b30b9bb4c857f35bf49e Mon Sep 17 00:00:00 2001 From: Eason Date: Tue, 6 Feb 2018 23:48:43 +0800 Subject: [PATCH 1/5] add filebeat for rancher catalog for fast deployment --- templates/filebeat/0/docker-compose.yml | 22 +++++++++++ templates/filebeat/0/rancher-compose.yml | 43 +++++++++++++++++++++ templates/filebeat/1/docker-compose.yml | 22 +++++++++++ templates/filebeat/1/rancher-compose.yml | 43 +++++++++++++++++++++ templates/filebeat/2/docker-compose.yml | 22 +++++++++++ templates/filebeat/2/rancher-compose.yml | 43 +++++++++++++++++++++ templates/filebeat/catalogIcon-filebeat.svg | 13 +++++++ templates/filebeat/config.yml | 8 ++++ 8 files changed, 216 insertions(+) create mode 100644 templates/filebeat/0/docker-compose.yml create mode 100644 templates/filebeat/0/rancher-compose.yml create mode 100644 templates/filebeat/1/docker-compose.yml create mode 100644 templates/filebeat/1/rancher-compose.yml create mode 100644 templates/filebeat/2/docker-compose.yml create mode 100644 templates/filebeat/2/rancher-compose.yml create mode 100644 templates/filebeat/catalogIcon-filebeat.svg create mode 100644 templates/filebeat/config.yml diff --git a/templates/filebeat/0/docker-compose.yml b/templates/filebeat/0/docker-compose.yml new file mode 100644 index 0000000..0b39222 --- /dev/null +++ b/templates/filebeat/0/docker-compose.yml @@ -0,0 +1,22 @@ +version: '2' +services: + filebeat: + image: eason02/filebeat-alpine:5.3.1 + container_name: filebeat-alpine-5.3.1 + restart: always + labels: + io.rancher.container.pull_image: always + environment: + - env=${ENV} + - logstash=${LOGSTASH} + - project=${PROJECT} + network_mode: host + volumes: + - /var/lib/filebeat/:/filebeat/data + - ${APPLOG_PATH}:/home/user/ + - ${NGINXLOG_PATH}:/var/log/nginx/ + logging: + driver: json-file + options: + max-file: '5' + max-size: 10m diff --git a/templates/filebeat/0/rancher-compose.yml b/templates/filebeat/0/rancher-compose.yml new file mode 100644 index 0000000..b7f3ad1 --- /dev/null +++ b/templates/filebeat/0/rancher-compose.yml @@ -0,0 +1,43 @@ +version: '2' +catalog: + name: "filebeat-alpine" + version: "5.3.1" + description: "Catalog's rancher-compose" + minimun_rancher_version: v1.0.1 + maximun_rancher_version: v1.6.12 + upgrade_from: "1.0.0" + questions: + - variable: "ENV" + label: "Environment Name" + description: "Environment to distinguish data source" + default: "QA" + required: true + type: "enum" + options: + - QA + - PP + - INT + - PROD + - variable: "PROJECT" + label: "Project Name" + description: "Indicated log of which project" + required: true + type: "string" + - variable: "LOGSTASH" + label: "Logstash Host" + description: "Specific Logstash Instance Running Host for log receiving" + required: true + type: "string" + - variable: "APPLOG_PATH" + label: "Application Log Path" + description: "For alignment, put your log into below path: ${HOME_PATH}/App1/logs/xxx.log, assume your HOME_PATH=/home/user, then set Application log Path as /home/user/." + required: true + default: "/home/user/" + type: "string" + - variable: "NGINXLOG_PATH" + label: "Nginx Log Path" + description: "Default it as /var/log/nginx/" + default: "/var/log/nginx/" + type: "string" + required: true + diff --git a/templates/filebeat/1/docker-compose.yml b/templates/filebeat/1/docker-compose.yml new file mode 100644 index 0000000..f1da36d --- /dev/null +++ b/templates/filebeat/1/docker-compose.yml @@ -0,0 +1,22 @@ +version: '2' +services: + filebeat: + image: eason02/filebeat-alpine:5.6.3 + container_name: filebeat-alpine-5.6.3 + restart: always + labels: + io.rancher.container.pull_image: always + environment: + - env=${ENV} + - logstash=${LOGSTASH} + - project=${PROJECT} + network_mode: host + volumes: + - /var/lib/filebeat/:/filebeat/data + - ${APPLOG_PATH}:/home/user/ + - ${NGINXLOG_PATH}:/var/log/nginx/ + logging: + driver: json-file + options: + max-file: '5' + max-size: 10m diff --git a/templates/filebeat/1/rancher-compose.yml b/templates/filebeat/1/rancher-compose.yml new file mode 100644 index 0000000..40b0480 --- /dev/null +++ b/templates/filebeat/1/rancher-compose.yml @@ -0,0 +1,43 @@ +version: '2' +catalog: + name: "filebeat-alpine" + version: "5.6.3" + description: "Catalog's rancher-compose" + minimun_rancher_version: v1.0.1 + maximun_rancher_version: v1.6.12 + upgrade_from: "1.0.0" + questions: + - variable: "ENV" + label: "Environment Name" + description: "Environment to distinguish data source" + default: "QA" + required: true + type: "enum" + options: + - QA + - PP + - INT + - PROD + - variable: "PROJECT" + label: "Project Name" + description: "Indicated log of which project" + required: true + type: "string" + - variable: "LOGSTASH" + label: "Logstash Host" + description: "Specific Logstash Instance Running Host for log receiving" + required: true + type: "string" + - variable: "APPLOG_PATH" + label: "Application Log Path" + description: "For alignment, put your log into below path: ${HOME_PATH}/App1/logs/xxx.log, assume your HOME_PATH=/home/user, then set Application log Path as /home/user/." + required: true + default: "/home/user/" + type: "string" + - variable: "NGINXLOG_PATH" + label: "Nginx Log Path" + description: "Default it as /var/log/nginx/" + default: "/var/log/nginx/" + type: "string" + required: true + diff --git a/templates/filebeat/2/docker-compose.yml b/templates/filebeat/2/docker-compose.yml new file mode 100644 index 0000000..c6809e4 --- /dev/null +++ b/templates/filebeat/2/docker-compose.yml @@ -0,0 +1,22 @@ +version: '2' +services: + filebeat: + image: eason02/filebeat-alpine:6.1.1 + container_name: filebeat-alpine-6.1.1 + restart: always + labels: + io.rancher.container.pull_image: always + environment: + - env=${ENV} + - logstash=${LOGSTASH} + - project=${PROJECT} + network_mode: host + volumes: + - /var/lib/filebeat/:/filebeat/data + - ${APPLOG_PATH}:/home/user/ + - ${NGINXLOG_PATH}:/var/log/nginx/ + logging: + driver: json-file + options: + max-file: '5' + max-size: 10m diff --git a/templates/filebeat/2/rancher-compose.yml b/templates/filebeat/2/rancher-compose.yml new file mode 100644 index 0000000..c279ce6 --- /dev/null +++ b/templates/filebeat/2/rancher-compose.yml @@ -0,0 +1,43 @@ +version: '2' +catalog: + name: "filebeat-alpine" + version: "6.1.1" + description: "Catalog's rancher-compose" + minimun_rancher_version: v1.0.1 + maximun_rancher_version: v1.6.12 + upgrade_from: "1.0.0" + questions: + - variable: "ENV" + label: "Environment Name" + description: "Environment to distinguish data source" + default: "QA" + required: true + type: "enum" + options: + - QA + - PP + - INT + - PROD + - variable: "PROJECT" + label: "Project Name" + description: "Indicated log of which project" + required: true + type: "string" + - variable: "LOGSTASH" + label: "Logstash Host" + description: "Specific Logstash Instance Running Host for log receiving" + required: true + type: "string" + - variable: "APPLOG_PATH" + label: "Application Log Path" + description: "For alignment, put your log into below path: ${HOME_PATH}/App1/logs/xxx.log, assume your HOME_PATH=/home/user, then set Application log Path as /home/user/." + required: true + default: "/home/user/" + type: "string" + - variable: "NGINXLOG_PATH" + label: "Nginx Log Path" + description: "Default it as /var/log/nginx/" + default: "/var/log/nginx/" + type: "string" + required: true + diff --git a/templates/filebeat/catalogIcon-filebeat.svg b/templates/filebeat/catalogIcon-filebeat.svg new file mode 100644 index 0000000..ce5be11 --- /dev/null +++ b/templates/filebeat/catalogIcon-filebeat.svg @@ -0,0 +1,13 @@ + + + + + + icons-masterfilefinal + + + + + + + diff --git a/templates/filebeat/config.yml b/templates/filebeat/config.yml new file mode 100644 index 0000000..5096503 --- /dev/null +++ b/templates/filebeat/config.yml @@ -0,0 +1,8 @@ +name: Filebeat-Alpine +description: Log Shipper to logstash + +version: 6.1.1 +category: Shipper +maintainer: eason.lau02@hotmail.com +license: MIT +projectURL: https://github.com/easonlau02/filebeat-alpine From 1b58770a65fd02f451d1d912c1eb118fbfe98b5f Mon Sep 17 00:00:00 2001 From: eason lau Date: Tue, 6 Feb 2018 20:22:04 -0500 Subject: [PATCH 2/5] update filebeat/config.yml --- templates/filebeat/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/filebeat/config.yml b/templates/filebeat/config.yml index 5096503..1d67384 100644 --- a/templates/filebeat/config.yml +++ b/templates/filebeat/config.yml @@ -3,6 +3,6 @@ description: Log Shipper to logstash version: 6.1.1 category: Shipper -maintainer: eason.lau02@hotmail.com -license: MIT +#maintainer: eason.lau02@hotmail.com +#license: MIT projectURL: https://github.com/easonlau02/filebeat-alpine From d1fc1b6a6d67aa8315c9de8b5a0d66da3cfc0d6d Mon Sep 17 00:00:00 2001 From: Eason Date: Wed, 7 Feb 2018 22:39:52 +0800 Subject: [PATCH 3/5] Remove always pull image/Switch ENV for free input/Update maintainer info/MAX RANCHER VERSION --- templates/filebeat/0/docker-compose.yml | 2 -- templates/filebeat/0/rancher-compose.yml | 11 +++-------- templates/filebeat/1/docker-compose.yml | 2 -- templates/filebeat/1/rancher-compose.yml | 11 +++-------- templates/filebeat/2/docker-compose.yml | 2 -- templates/filebeat/2/rancher-compose.yml | 11 +++-------- templates/filebeat/config.yml | 2 +- 7 files changed, 10 insertions(+), 31 deletions(-) diff --git a/templates/filebeat/0/docker-compose.yml b/templates/filebeat/0/docker-compose.yml index 0b39222..203767f 100644 --- a/templates/filebeat/0/docker-compose.yml +++ b/templates/filebeat/0/docker-compose.yml @@ -4,8 +4,6 @@ services: image: eason02/filebeat-alpine:5.3.1 container_name: filebeat-alpine-5.3.1 restart: always - labels: - io.rancher.container.pull_image: always environment: - env=${ENV} - logstash=${LOGSTASH} diff --git a/templates/filebeat/0/rancher-compose.yml b/templates/filebeat/0/rancher-compose.yml index b7f3ad1..5177491 100644 --- a/templates/filebeat/0/rancher-compose.yml +++ b/templates/filebeat/0/rancher-compose.yml @@ -4,20 +4,15 @@ catalog: version: "5.3.1" description: "Catalog's rancher-compose" minimun_rancher_version: v1.0.1 - maximun_rancher_version: v1.6.12 + maximun_rancher_version: v1.6.14 upgrade_from: "1.0.0" questions: - variable: "ENV" label: "Environment Name" - description: "Environment to distinguish data source" + description: "Environment to distinguish data source, you can set it as QA/PP/PROD or your preference." default: "QA" required: true - type: "enum" - options: - - QA - - PP - - INT - - PROD + type: "string" - variable: "PROJECT" label: "Project Name" description: "Indicated log of which project" diff --git a/templates/filebeat/1/docker-compose.yml b/templates/filebeat/1/docker-compose.yml index f1da36d..9171527 100644 --- a/templates/filebeat/1/docker-compose.yml +++ b/templates/filebeat/1/docker-compose.yml @@ -4,8 +4,6 @@ services: image: eason02/filebeat-alpine:5.6.3 container_name: filebeat-alpine-5.6.3 restart: always - labels: - io.rancher.container.pull_image: always environment: - env=${ENV} - logstash=${LOGSTASH} diff --git a/templates/filebeat/1/rancher-compose.yml b/templates/filebeat/1/rancher-compose.yml index 40b0480..0ea389f 100644 --- a/templates/filebeat/1/rancher-compose.yml +++ b/templates/filebeat/1/rancher-compose.yml @@ -4,20 +4,15 @@ catalog: version: "5.6.3" description: "Catalog's rancher-compose" minimun_rancher_version: v1.0.1 - maximun_rancher_version: v1.6.12 + maximun_rancher_version: v1.6.14 upgrade_from: "1.0.0" questions: - variable: "ENV" label: "Environment Name" - description: "Environment to distinguish data source" + description: "Environment to distinguish data source, you can set it as QA/PP/PROD or your preference." default: "QA" required: true - type: "enum" - options: - - QA - - PP - - INT - - PROD + type: "string" - variable: "PROJECT" label: "Project Name" description: "Indicated log of which project" diff --git a/templates/filebeat/2/docker-compose.yml b/templates/filebeat/2/docker-compose.yml index c6809e4..2aa9a50 100644 --- a/templates/filebeat/2/docker-compose.yml +++ b/templates/filebeat/2/docker-compose.yml @@ -4,8 +4,6 @@ services: image: eason02/filebeat-alpine:6.1.1 container_name: filebeat-alpine-6.1.1 restart: always - labels: - io.rancher.container.pull_image: always environment: - env=${ENV} - logstash=${LOGSTASH} diff --git a/templates/filebeat/2/rancher-compose.yml b/templates/filebeat/2/rancher-compose.yml index c279ce6..7b543e7 100644 --- a/templates/filebeat/2/rancher-compose.yml +++ b/templates/filebeat/2/rancher-compose.yml @@ -4,20 +4,15 @@ catalog: version: "6.1.1" description: "Catalog's rancher-compose" minimun_rancher_version: v1.0.1 - maximun_rancher_version: v1.6.12 + maximun_rancher_version: v1.6.14 upgrade_from: "1.0.0" questions: - variable: "ENV" label: "Environment Name" - description: "Environment to distinguish data source" + description: "Environment to distinguish data source, you can set it as QA/PP/PROD or your preference." default: "QA" required: true - type: "enum" - options: - - QA - - PP - - INT - - PROD + type: "string" - variable: "PROJECT" label: "Project Name" description: "Indicated log of which project" diff --git a/templates/filebeat/config.yml b/templates/filebeat/config.yml index 1d67384..398d1ae 100644 --- a/templates/filebeat/config.yml +++ b/templates/filebeat/config.yml @@ -3,6 +3,6 @@ description: Log Shipper to logstash version: 6.1.1 category: Shipper -#maintainer: eason.lau02@hotmail.com +maintainer: "Eason Lau " #license: MIT projectURL: https://github.com/easonlau02/filebeat-alpine From 693f03372d565c92cea92cfdea21153c891c4235 Mon Sep 17 00:00:00 2001 From: Eason Date: Wed, 7 Feb 2018 22:45:06 +0800 Subject: [PATCH 4/5] uncomment license --- templates/filebeat/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/filebeat/config.yml b/templates/filebeat/config.yml index 398d1ae..5999e9e 100644 --- a/templates/filebeat/config.yml +++ b/templates/filebeat/config.yml @@ -4,5 +4,5 @@ description: Log Shipper to logstash version: 6.1.1 category: Shipper maintainer: "Eason Lau " -#license: MIT +license: MIT projectURL: https://github.com/easonlau02/filebeat-alpine From 00291f27361e2fad191ee1de66a804142282db8d Mon Sep 17 00:00:00 2001 From: Eason Date: Wed, 7 Feb 2018 23:20:46 +0800 Subject: [PATCH 5/5] set log path as read-only --- templates/filebeat/0/docker-compose.yml | 4 ++-- templates/filebeat/1/docker-compose.yml | 4 ++-- templates/filebeat/2/docker-compose.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/templates/filebeat/0/docker-compose.yml b/templates/filebeat/0/docker-compose.yml index 203767f..302081b 100644 --- a/templates/filebeat/0/docker-compose.yml +++ b/templates/filebeat/0/docker-compose.yml @@ -11,8 +11,8 @@ services: network_mode: host volumes: - /var/lib/filebeat/:/filebeat/data - - ${APPLOG_PATH}:/home/user/ - - ${NGINXLOG_PATH}:/var/log/nginx/ + - ${APPLOG_PATH}:/home/user/:ro + - ${NGINXLOG_PATH}:/var/log/nginx/:ro logging: driver: json-file options: diff --git a/templates/filebeat/1/docker-compose.yml b/templates/filebeat/1/docker-compose.yml index 9171527..e523439 100644 --- a/templates/filebeat/1/docker-compose.yml +++ b/templates/filebeat/1/docker-compose.yml @@ -11,8 +11,8 @@ services: network_mode: host volumes: - /var/lib/filebeat/:/filebeat/data - - ${APPLOG_PATH}:/home/user/ - - ${NGINXLOG_PATH}:/var/log/nginx/ + - ${APPLOG_PATH}:/home/user/:ro + - ${NGINXLOG_PATH}:/var/log/nginx/:ro logging: driver: json-file options: diff --git a/templates/filebeat/2/docker-compose.yml b/templates/filebeat/2/docker-compose.yml index 2aa9a50..3549a96 100644 --- a/templates/filebeat/2/docker-compose.yml +++ b/templates/filebeat/2/docker-compose.yml @@ -11,8 +11,8 @@ services: network_mode: host volumes: - /var/lib/filebeat/:/filebeat/data - - ${APPLOG_PATH}:/home/user/ - - ${NGINXLOG_PATH}:/var/log/nginx/ + - ${APPLOG_PATH}:/home/user/:ro + - ${NGINXLOG_PATH}:/var/log/nginx/:ro logging: driver: json-file options: