diff --git a/templates/nsq/0/README.md b/templates/nsq/0/README.md new file mode 100644 index 0000000..3317ccb --- /dev/null +++ b/templates/nsq/0/README.md @@ -0,0 +1,14 @@ +# Nsq.io + +### Info: + +This template creates, scale in and scale out a nsqd cluster on top of Rancher. By default there are 3 static nsqlookupd provisioned. +NSQD can be reached internally by using the nsq-lb Loadbalancer or directly. + +### Usage: + +Select NSQ from catalog. + +Enter the number of nodes for your NSQD cluster. + +Click deploy. diff --git a/templates/nsq/0/docker-compose.yml.tpl b/templates/nsq/0/docker-compose.yml.tpl new file mode 100644 index 0000000..0593a20 --- /dev/null +++ b/templates/nsq/0/docker-compose.yml.tpl @@ -0,0 +1,43 @@ +nsqlookupd01: + image: nsqio/nsq + command: /nsqlookupd +nsqlookupd02: + image: nsqio/nsq + command: /nsqlookupd +nsqlookupd03: + image: nsqio/nsq + command: /nsqlookupd +nsqd: + image: nsqio/nsq + command: + - /bin/sh + - -c + - nsqd --data-path=/data --lookupd-tcp-address=nsqlookupd01:4160 --lookupd-tcp-address=nsqlookupd02:4160 --lookupd-tcp-address=nsqlookupd03:4160 -broadcast-address=$$HOSTNAME + labels: + io.rancher.scheduler.affinity:host_label_soft: nsqd=true + io.rancher.scheduler.affinity:container_label_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} + io.rancher.sidekicks: data + io.rancher.container.hostname_override: container_name + volumes_from: + - data +nsqadmin: + image: nsqio/nsq + command: /nsqadmin --lookupd-http-address=nsqlookupd01:4161 --lookupd-http-address=nsqlookupd02:4161 --lookupd-http-address=nsqlookupd03:4161 +nsq-lb: + image: rancher/lb-service-haproxy:v0.7.9 + ports: + - 4150:4150/tcp + - 4151:4151/tcp + - 4171:4171/tcp + labels: + io.rancher.container.agent.role: environmentAdmin + io.rancher.container.create_agent: 'true' + io.rancher.scheduler.global: 'true' +data: + image: busybox + command: /bin/true + net: none + volumes: + - /data + labels: + io.rancher.container.start_once: 'true' diff --git a/templates/nsq/0/rancher-compose.yml b/templates/nsq/0/rancher-compose.yml new file mode 100644 index 0000000..a0477a9 --- /dev/null +++ b/templates/nsq/0/rancher-compose.yml @@ -0,0 +1,64 @@ +version: '2' +catalog: + name: NSQD + version: v1.0.0-compat + questions: + - variable: "NSQD_SCALE" + description: "Number of NSQD nodes." + label: "Nsqd Nodes" + required: true + default: "3" + type: "int" + - variable: "NSQADMIN_SCALE" + description: "Number of NSQ Admin nodes." + label: "Nsqadmin Nodes" + required: true + default: "3" + type: "int" +services: + nsqlookupd01: + scale: 1 + start_on_create: true + nsqlookupd02: + scale: 1 + start_on_create: true + nsqlookupd03: + scale: 1 + start_on_create: true + nsqadmin: + scale: ${NSQADMIN_SCALE} + start_on_create: true + data: + scale: ${NSQD_SCALE} + start_on_create: true + nsq-lb: + start_on_create: true + lb_config: + certs: [] + port_rules: + - priority: 1 + protocol: tcp + service: nsqd + source_port: 4150 + target_port: 4150 + - priority: 2 + protocol: http + service: nsqd + source_port: 4151 + target_port: 4151 + - priority: 3 + protocol: http + service: nsqadmin + source_port: 4171 + target_port: 4171 + health_check: + response_timeout: 2000 + healthy_threshold: 2 + port: 42 + unhealthy_threshold: 3 + initializing_timeout: 60000 + interval: 2000 + reinitializing_timeout: 60000 + nsqd: + scale: ${NSQD_SCALE} + start_on_create: true diff --git a/templates/nsq/catalogIcon-nsq.png b/templates/nsq/catalogIcon-nsq.png new file mode 100644 index 0000000..b9f5019 Binary files /dev/null and b/templates/nsq/catalogIcon-nsq.png differ diff --git a/templates/nsq/config.yml b/templates/nsq/config.yml new file mode 100644 index 0000000..eb7289d --- /dev/null +++ b/templates/nsq/config.yml @@ -0,0 +1,7 @@ +name: NSQ +description: | + A realtime distributed messaging platform +version: v1.0.0-compat +category: Message queues +maintainer: "Matthias Schneider " +projectURL: https://nsq.io/