From 729906f15d059b7419acfbb98a0ac5b381780160 Mon Sep 17 00:00:00 2001 From: William Jimenez Date: Wed, 22 Nov 2017 14:10:08 -0800 Subject: [PATCH 1/6] new catalog item: cowcheck --- templates/cowcheck/0/docker-compose.yml | 17 ++++++++++++ templates/cowcheck/0/rancher-compose.yml | 35 ++++++++++++++++++++++++ templates/cowcheck/config.yml | 8 ++++++ 3 files changed, 60 insertions(+) create mode 100644 templates/cowcheck/0/docker-compose.yml create mode 100644 templates/cowcheck/0/rancher-compose.yml create mode 100644 templates/cowcheck/config.yml diff --git a/templates/cowcheck/0/docker-compose.yml b/templates/cowcheck/0/docker-compose.yml new file mode 100644 index 0000000..3e750e8 --- /dev/null +++ b/templates/cowcheck/0/docker-compose.yml @@ -0,0 +1,17 @@ +version: '2' +services: + cowcheck: + image: wjimenez5271/cowcheck:0.2.0 + environment: + LOG_LEVEL: ${LOG_LEVEL} + DOCKER_API_VERSION: ${DOCKER_API_VERSION} + DATA_SPACE_THRESHOLD: ${DATA_SPACE_THRESHOLD} + METADATA_SPACE_THRESHOLD: ${METADATA_SPACE_THRESHOLD} + POLL_INTERVAL: ${POLL_INTERVAL} + stdin_open: true + tty: true + ports: + - 5050:5050/tcp + labels: + io.rancher.container.pull_image: always + io.rancher.scheduler.global: 'true' diff --git a/templates/cowcheck/0/rancher-compose.yml b/templates/cowcheck/0/rancher-compose.yml new file mode 100644 index 0000000..04eb3af --- /dev/null +++ b/templates/cowcheck/0/rancher-compose.yml @@ -0,0 +1,35 @@ +version: '2' +catalog: + name: cowcheck + version: 0.2.0 + description: A microservice for checking the health of a Rancher node + minimum_rancher_version: v.1.6.0 + questions: + - variable: POLL_INTERVAL + label: POLL_INTERVAL + description: | Frequency in seconds to run checks + type: string + default: 1.24 + - variable: ENABLE_STORAGE_CHECK + label: ENABLE_STORAGE_CHECK + description: | Enable storage check + type: bool + default: false + - variable: DATA_SPACE_THRESHOLD + label: DATA_SPACE_THRESHOLD + description: | Minimum amount of free Docker Data Storage space in bytes + type: string + default: 1.24 + - variable: METADATA_SPACE_THRESHOLD + label: METADATA_SPACE_THRESHOLD + description: | Minimum amount of free Docker Data Storage space in bytes + type: string + default: 1.24 + - variable: DOCKER_API_VERSION + label: DOCKER_API_VERSION + description: | Version of the Docker API to use (storage checks only) + type: string + default: 1.24 +services: + cowcheck: + start_on_create: true diff --git a/templates/cowcheck/config.yml b/templates/cowcheck/config.yml new file mode 100644 index 0000000..f45e887 --- /dev/null +++ b/templates/cowcheck/config.yml @@ -0,0 +1,8 @@ +name: Cowcheck +description: | + A microservice for checking the health of a Rancher node +version: 0.2.0 +category: Monitoring +maintainer: "William Jimenez " +license: Apache 2.0 +projectURL: https://github.com/wjimenez5271/cowcheck From 3b07fe5a1b75555220b48a0ab24fce1c340380ac Mon Sep 17 00:00:00 2001 From: William Jimenez Date: Tue, 19 Dec 2017 16:09:52 -0800 Subject: [PATCH 2/6] making fixes per rawmind0's suggestions --- templates/cowcheck/0/docker-compose.yml | 3 +- templates/cowcheck/0/rancher-compose.yml | 55 +++++++++++++----------- 2 files changed, 31 insertions(+), 27 deletions(-) diff --git a/templates/cowcheck/0/docker-compose.yml b/templates/cowcheck/0/docker-compose.yml index 3e750e8..a9c861c 100644 --- a/templates/cowcheck/0/docker-compose.yml +++ b/templates/cowcheck/0/docker-compose.yml @@ -11,7 +11,6 @@ services: stdin_open: true tty: true ports: - - 5050:5050/tcp + - ${PUBLISH_PORT}:5050/tcp labels: - io.rancher.container.pull_image: always io.rancher.scheduler.global: 'true' diff --git a/templates/cowcheck/0/rancher-compose.yml b/templates/cowcheck/0/rancher-compose.yml index 04eb3af..9ef475d 100644 --- a/templates/cowcheck/0/rancher-compose.yml +++ b/templates/cowcheck/0/rancher-compose.yml @@ -5,31 +5,36 @@ catalog: description: A microservice for checking the health of a Rancher node minimum_rancher_version: v.1.6.0 questions: - - variable: POLL_INTERVAL - label: POLL_INTERVAL - description: | Frequency in seconds to run checks - type: string - default: 1.24 - - variable: ENABLE_STORAGE_CHECK - label: ENABLE_STORAGE_CHECK - description: | Enable storage check - type: bool - default: false - - variable: DATA_SPACE_THRESHOLD - label: DATA_SPACE_THRESHOLD - description: | Minimum amount of free Docker Data Storage space in bytes - type: string - default: 1.24 - - variable: METADATA_SPACE_THRESHOLD - label: METADATA_SPACE_THRESHOLD - description: | Minimum amount of free Docker Data Storage space in bytes - type: string - default: 1.24 - - variable: DOCKER_API_VERSION - label: DOCKER_API_VERSION - description: | Version of the Docker API to use (storage checks only) - type: string - default: 1.24 + - variable: POLL_INTERVAL + label: POLL_INTERVAL + description: | Frequency in seconds to run checks + type: string + default: 1.24 + - variable: ENABLE_STORAGE_CHECK + label: ENABLE_STORAGE_CHECK + description: | Enable storage check + type: bool + default: false + - variable: DATA_SPACE_THRESHOLD + label: DATA_SPACE_THRESHOLD + description: | Minimum amount of free Docker Data Storage space in bytes + type: string + default: 1.24 + - variable: METADATA_SPACE_THRESHOLD + label: METADATA_SPACE_THRESHOLD + description: | Minimum amount of free Docker Data Storage space in bytes + type: string + default: 1.24 + - variable: DOCKER_API_VERSION + label: DOCKER_API_VERSION + description: | Version of the Docker API to use (storage checks only) + type: string + default: 1.24 + - variable: PUBLISH_PORT + label: PUBLISH_PORT + description: | Port to publish the service. + type: int + default: 5050 services: cowcheck: start_on_create: true From bdeab9230b222f1e94c4efc9823ea6cd45ce234a Mon Sep 17 00:00:00 2001 From: William Jimenez Date: Wed, 20 Dec 2017 10:34:21 -0800 Subject: [PATCH 3/6] yaml syntax fix --- templates/cowcheck/0/rancher-compose.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/templates/cowcheck/0/rancher-compose.yml b/templates/cowcheck/0/rancher-compose.yml index 9ef475d..0ff5434 100644 --- a/templates/cowcheck/0/rancher-compose.yml +++ b/templates/cowcheck/0/rancher-compose.yml @@ -7,32 +7,32 @@ catalog: questions: - variable: POLL_INTERVAL label: POLL_INTERVAL - description: | Frequency in seconds to run checks + description: Frequency in seconds to run checks type: string default: 1.24 - variable: ENABLE_STORAGE_CHECK label: ENABLE_STORAGE_CHECK - description: | Enable storage check + description: Enable storage check type: bool default: false - variable: DATA_SPACE_THRESHOLD label: DATA_SPACE_THRESHOLD - description: | Minimum amount of free Docker Data Storage space in bytes + description: Minimum amount of free Docker Data Storage space in bytes type: string default: 1.24 - variable: METADATA_SPACE_THRESHOLD label: METADATA_SPACE_THRESHOLD - description: | Minimum amount of free Docker Data Storage space in bytes + description: Minimum amount of free Docker Data Storage space in bytes type: string default: 1.24 - variable: DOCKER_API_VERSION label: DOCKER_API_VERSION - description: | Version of the Docker API to use (storage checks only) + description: Version of the Docker API to use (storage checks only) type: string default: 1.24 - variable: PUBLISH_PORT label: PUBLISH_PORT - description: | Port to publish the service. + description: Port to publish the service. type: int default: 5050 services: From 8765315959c2236732abdedb361f9042542a96e2 Mon Sep 17 00:00:00 2001 From: William Jimenez Date: Wed, 20 Dec 2017 10:35:25 -0800 Subject: [PATCH 4/6] syntax fix --- templates/cowcheck/0/rancher-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/cowcheck/0/rancher-compose.yml b/templates/cowcheck/0/rancher-compose.yml index 0ff5434..329c30a 100644 --- a/templates/cowcheck/0/rancher-compose.yml +++ b/templates/cowcheck/0/rancher-compose.yml @@ -13,7 +13,7 @@ catalog: - variable: ENABLE_STORAGE_CHECK label: ENABLE_STORAGE_CHECK description: Enable storage check - type: bool + type: boolean default: false - variable: DATA_SPACE_THRESHOLD label: DATA_SPACE_THRESHOLD From 5b4e31b63f26c00369f2f5bbc68a44e1bc719505 Mon Sep 17 00:00:00 2001 From: William Jimenez Date: Wed, 20 Dec 2017 16:55:12 -0800 Subject: [PATCH 5/6] adding catalog item image --- templates/cowcheck/catalogIcon-cowcheck.svg | 1 + 1 file changed, 1 insertion(+) create mode 100644 templates/cowcheck/catalogIcon-cowcheck.svg diff --git a/templates/cowcheck/catalogIcon-cowcheck.svg b/templates/cowcheck/catalogIcon-cowcheck.svg new file mode 100644 index 0000000..f444074 --- /dev/null +++ b/templates/cowcheck/catalogIcon-cowcheck.svg @@ -0,0 +1 @@ +rancher-catalog \ No newline at end of file From f61ff661bea6ff7d0def8aa0a69f81450c42e71d Mon Sep 17 00:00:00 2001 From: William Jimenez Date: Thu, 21 Dec 2017 09:20:16 -0800 Subject: [PATCH 6/6] add sane defaults --- templates/cowcheck/0/rancher-compose.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/cowcheck/0/rancher-compose.yml b/templates/cowcheck/0/rancher-compose.yml index 329c30a..6a3a908 100644 --- a/templates/cowcheck/0/rancher-compose.yml +++ b/templates/cowcheck/0/rancher-compose.yml @@ -9,7 +9,7 @@ catalog: label: POLL_INTERVAL description: Frequency in seconds to run checks type: string - default: 1.24 + default: 60 - variable: ENABLE_STORAGE_CHECK label: ENABLE_STORAGE_CHECK description: Enable storage check @@ -19,12 +19,12 @@ catalog: label: DATA_SPACE_THRESHOLD description: Minimum amount of free Docker Data Storage space in bytes type: string - default: 1.24 + default: 50000000 - variable: METADATA_SPACE_THRESHOLD label: METADATA_SPACE_THRESHOLD - description: Minimum amount of free Docker Data Storage space in bytes + description: Minimum amount of free Docker Metadata Storage space in bytes type: string - default: 1.24 + default: 50000000 - variable: DOCKER_API_VERSION label: DOCKER_API_VERSION description: Version of the Docker API to use (storage checks only)