diff --git a/templates/nsq/0/README.md b/templates/nsq/0/README.md new file mode 100644 index 0000000..e97faf5 --- /dev/null +++ b/templates/nsq/0/README.md @@ -0,0 +1,23 @@ +# 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 (TCP/4150, HTTP/4151) and the webinterface nsqadmin (HTTP/4171) can be reached by using the provisioned nsq-lb loadbalancer. + +### Service configuration labels: + +You can control where nsqd, nsqadmin, nsqlookupd and nsq-lb will be deployed by setting the following host labels: + +- nsqd = • +- nsqlookupd = • +- nsqadmin = • +- nsq-lb = • + +### Usage: + +Select NSQ from catalog. + +Enter the number of nodes for your NSQD cluster and NSQ Admin instances. + +Click deploy. diff --git a/templates/nsq/0/docker-compose.yml b/templates/nsq/0/docker-compose.yml new file mode 100644 index 0000000..f484a31 --- /dev/null +++ b/templates/nsq/0/docker-compose.yml @@ -0,0 +1,55 @@ +version: '2' +services: + nsqlookupd01: + image: nsqio/nsq:v1.0.0-compat + command: /nsqlookupd + labels: + io.rancher.scheduler.affinity:host_label_soft: nsqlookupd=true + io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/nsqlookupd02,io.rancher.stack_service.name=$${stack_name}/nsqlookupd03 + nsqlookupd02: + image: nsqio/nsq:v1.0.0-compat + command: /nsqlookupd + labels: + io.rancher.scheduler.affinity:host_label_soft: nsqlookupd=true + io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/nsqlookupd01,io.rancher.stack_service.name=$${stack_name}/nsqlookupd03 + nsqlookupd03: + image: nsqio/nsq:v1.0.0-compat + command: /nsqlookupd + labels: + io.rancher.scheduler.affinity:host_label_soft: nsqlookupd=true + io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/nsqlookupd01,io.rancher.stack_service.name=$${stack_name}/nsqlookupd02 + nsqd: + image: nsqio/nsq:v1.0.0-compat + 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:v1.0.0-compat + command: /nsqadmin --lookupd-http-address=nsqlookupd01:4161 --lookupd-http-address=nsqlookupd02:4161 --lookupd-http-address=nsqlookupd03:4161 + labels: + io.rancher.scheduler.affinity:host_label_soft: nsqadmin=true + io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} + nsq-lb: + image: rancher/lb-service-haproxy:v0.7.9 + ports: + - 4150:4150/tcp + - 4151:4151/tcp + - 4171:4171/tcp + labels: + io.rancher.scheduler.global: "true" + io.rancher.scheduler.affinity:host_label: nsq-lb=true + data: + image: busybox + command: /bin/true + 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..15c1631 --- /dev/null +++ b/templates/nsq/0/rancher-compose.yml @@ -0,0 +1,68 @@ +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: + retain_ip: true + scale: 1 + start_on_create: true + nsqlookupd02: + retain_ip: true + scale: 1 + start_on_create: true + nsqlookupd03: + retain_ip: true + 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: + retain_ip: true + 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/