Merge pull request #708 from mschneider82/master
Added: template for NSQ cluster
This commit is contained in:
commit
6cc937a45a
23
templates/nsq/0/README.md
Normal file
23
templates/nsq/0/README.md
Normal file
@ -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 = <true | false>•
|
||||
- nsqlookupd = <true | false>•
|
||||
- nsqadmin = <true | false>•
|
||||
- nsq-lb = <true | false>•
|
||||
|
||||
### Usage:
|
||||
|
||||
Select NSQ from catalog.
|
||||
|
||||
Enter the number of nodes for your NSQD cluster and NSQ Admin instances.
|
||||
|
||||
Click deploy.
|
55
templates/nsq/0/docker-compose.yml
Normal file
55
templates/nsq/0/docker-compose.yml
Normal file
@ -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'
|
68
templates/nsq/0/rancher-compose.yml
Normal file
68
templates/nsq/0/rancher-compose.yml
Normal file
@ -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
|
BIN
templates/nsq/catalogIcon-nsq.png
Normal file
BIN
templates/nsq/catalogIcon-nsq.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.1 KiB |
7
templates/nsq/config.yml
Normal file
7
templates/nsq/config.yml
Normal file
@ -0,0 +1,7 @@
|
||||
name: NSQ
|
||||
description: |
|
||||
A realtime distributed messaging platform
|
||||
version: v1.0.0-compat
|
||||
category: Message queues
|
||||
maintainer: "Matthias Schneider <ms@wck.biz>"
|
||||
projectURL: https://nsq.io/
|
Loading…
x
Reference in New Issue
Block a user