From 2516dc537b63bc6431d5d90dceed72c9005bd8dd Mon Sep 17 00:00:00 2001 From: Raul Sanchez Date: Wed, 5 Apr 2017 20:03:23 +0200 Subject: [PATCH 1/3] Added influxdb package --- templates/influxdb/0/README.md | 20 +++++ templates/influxdb/0/docker-compose.yml | 36 +++++++++ templates/influxdb/0/rancher-compose.yml | 55 ++++++++++++++ templates/influxdb/catalogIcon-influxdb.svg | 81 +++++++++++++++++++++ templates/influxdb/config.yml | 7 ++ 5 files changed, 199 insertions(+) create mode 100644 templates/influxdb/0/README.md create mode 100644 templates/influxdb/0/docker-compose.yml create mode 100644 templates/influxdb/0/rancher-compose.yml create mode 100644 templates/influxdb/catalogIcon-influxdb.svg create mode 100644 templates/influxdb/config.yml diff --git a/templates/influxdb/0/README.md b/templates/influxdb/0/README.md new file mode 100644 index 0000000..ef7aab2 --- /dev/null +++ b/templates/influxdb/0/README.md @@ -0,0 +1,20 @@ +# Influxdb + +### Info: + + This template deploys a Influxdb. + + +### Usage: + + Select influxdb from catalog. + + Change the following cloud9 default parameters, if you need: + +- Expose influxdb=true # Exposed influxdb service +- Influxdb port=8086 # Influxdb exposed port + + Click deploy. + + Influxdb can now be accessed over the Rancher network and over exposed port. + diff --git a/templates/influxdb/0/docker-compose.yml b/templates/influxdb/0/docker-compose.yml new file mode 100644 index 0000000..63628c5 --- /dev/null +++ b/templates/influxdb/0/docker-compose.yml @@ -0,0 +1,36 @@ +version: '2' +services: +{{- if eq .Values.EXPOSE_SERVICE "true"}} + lb: + image: rancher/lb-service-haproxy:v0.6.2 + ports: + - ${influxdb_port}:8086/tcp + labels: + io.rancher.container.agent.role: environmentAdmin + io.rancher.container.create_agent: 'true' +{{- end}} + influxdb: + image: influxdb:1.2.2-alpine + stdin_open: true + tty: true + labels: + io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} + io.rancher.container.hostname_override: container_name + io.rancher.sidekicks: influxdb-volume + volumes_from: + - influxdb-volume + influxdb-volume: + network_mode: "none" + labels: + io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} + io.rancher.container.hostname_override: container_name + io.rancher.container.start_once: true + environment: + - SERVICE_UID=0 + - SERVICE_GID=0 + - SERVICE_VOLUME=/var/lib/influxdb + volumes: + - /var/lib/influxdb + volume_driver: local + image: rawmind/alpine-volume:0.0.2-1 + diff --git a/templates/influxdb/0/rancher-compose.yml b/templates/influxdb/0/rancher-compose.yml new file mode 100644 index 0000000..f0f0f16 --- /dev/null +++ b/templates/influxdb/0/rancher-compose.yml @@ -0,0 +1,55 @@ +.catalog: + name: Influxdb + description: | + Influxdb + version: 1.2.2-rancher1 + minimum_rancher_version: v1.0.0 + maintainer: "Raul Sanchez " + uuid: influxdb-0 + questions: + - variable: "EXPOSE_SERVICE" + description: "Expose Influxdb" + label: "Expose influxdb:" + required: true + type: enum + default: "true" + options: + - "true" + - "false" + - variable: "influxdb_port" + description: | + Port to expose. + label: "Influxdb port:" + default: "8086" + required: true + type: "int" +version: '2' +services: + lb: + scale: 1 + start_on_create: true + lb_config: + certs: [] + port_rules: + - hostname: '' + priority: 1 + protocol: http + service: influxdb + source_port: ${influxdb_port} + target_port: 8086 + health_check: + response_timeout: 2000 + healthy_threshold: 2 + port: 42 + unhealthy_threshold: 3 + interval: 2000 + influxdb: + scale: 1 + start_on_create: true + health_check: + response_timeout: 2000 + healthy_threshold: 2 + port: 8086 + unhealthy_threshold: 3 + interval: 2000 + diff --git a/templates/influxdb/catalogIcon-influxdb.svg b/templates/influxdb/catalogIcon-influxdb.svg new file mode 100644 index 0000000..a44cb48 --- /dev/null +++ b/templates/influxdb/catalogIcon-influxdb.svg @@ -0,0 +1,81 @@ + + + + + + diff --git a/templates/influxdb/config.yml b/templates/influxdb/config.yml new file mode 100644 index 0000000..c8ca0df --- /dev/null +++ b/templates/influxdb/config.yml @@ -0,0 +1,7 @@ +name: Influxdb +description: | + Influxdb +version: 1.2.2-rancher1 +category: Database +maintainer: "Raul Sanchez " +license: From 12e26ff2c3c5f88cc83a5e97c3c9ed0b76491d4f Mon Sep 17 00:00:00 2001 From: Raul Sanchez Date: Thu, 6 Apr 2017 11:08:33 +0200 Subject: [PATCH 2/3] Fix: rename docker-compose to tpl --- templates/influxdb/0/docker-compose.yml | 36 ------------------------- 1 file changed, 36 deletions(-) delete mode 100644 templates/influxdb/0/docker-compose.yml diff --git a/templates/influxdb/0/docker-compose.yml b/templates/influxdb/0/docker-compose.yml deleted file mode 100644 index 63628c5..0000000 --- a/templates/influxdb/0/docker-compose.yml +++ /dev/null @@ -1,36 +0,0 @@ -version: '2' -services: -{{- if eq .Values.EXPOSE_SERVICE "true"}} - lb: - image: rancher/lb-service-haproxy:v0.6.2 - ports: - - ${influxdb_port}:8086/tcp - labels: - io.rancher.container.agent.role: environmentAdmin - io.rancher.container.create_agent: 'true' -{{- end}} - influxdb: - image: influxdb:1.2.2-alpine - stdin_open: true - tty: true - labels: - io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} - io.rancher.container.hostname_override: container_name - io.rancher.sidekicks: influxdb-volume - volumes_from: - - influxdb-volume - influxdb-volume: - network_mode: "none" - labels: - io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} - io.rancher.container.hostname_override: container_name - io.rancher.container.start_once: true - environment: - - SERVICE_UID=0 - - SERVICE_GID=0 - - SERVICE_VOLUME=/var/lib/influxdb - volumes: - - /var/lib/influxdb - volume_driver: local - image: rawmind/alpine-volume:0.0.2-1 - From ae2ecaa23777af941df4d53975612649ac8c7644 Mon Sep 17 00:00:00 2001 From: Raul Sanchez Date: Thu, 6 Apr 2017 11:09:57 +0200 Subject: [PATCH 3/3] Fix: rename docker-compose to tpl --- templates/influxdb/0/docker-compose.yml.tpl | 36 +++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 templates/influxdb/0/docker-compose.yml.tpl diff --git a/templates/influxdb/0/docker-compose.yml.tpl b/templates/influxdb/0/docker-compose.yml.tpl new file mode 100644 index 0000000..63628c5 --- /dev/null +++ b/templates/influxdb/0/docker-compose.yml.tpl @@ -0,0 +1,36 @@ +version: '2' +services: +{{- if eq .Values.EXPOSE_SERVICE "true"}} + lb: + image: rancher/lb-service-haproxy:v0.6.2 + ports: + - ${influxdb_port}:8086/tcp + labels: + io.rancher.container.agent.role: environmentAdmin + io.rancher.container.create_agent: 'true' +{{- end}} + influxdb: + image: influxdb:1.2.2-alpine + stdin_open: true + tty: true + labels: + io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} + io.rancher.container.hostname_override: container_name + io.rancher.sidekicks: influxdb-volume + volumes_from: + - influxdb-volume + influxdb-volume: + network_mode: "none" + labels: + io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} + io.rancher.container.hostname_override: container_name + io.rancher.container.start_once: true + environment: + - SERVICE_UID=0 + - SERVICE_GID=0 + - SERVICE_VOLUME=/var/lib/influxdb + volumes: + - /var/lib/influxdb + volume_driver: local + image: rawmind/alpine-volume:0.0.2-1 +