Created
December 11, 2015 10:10
-
-
Save tsunammis/7731d1c4aecb0d86977e to your computer and use it in GitHub Desktop.
Cluster of NSQ on Kubernetes for multiple hosts (kubernetes.io)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: ReplicationController | |
metadata: | |
name: nsq | |
spec: | |
replicas: 4 | |
selector: | |
name: nsq | |
template: | |
metadata: | |
labels: | |
name: nsq | |
spec: | |
containers: | |
- name: nsq | |
image: nsqio/nsq | |
command: ["sh", "-c", "nsqd --lookupd-tcp-address=nsqlookupd.default.svc.cluster.local:4160 --broadcast-address=$(hostname -i)"] | |
ports: | |
- containerPort: 4150 | |
name: tcp | |
protocol: TCP | |
- containerPort: 4151 | |
name: http | |
protocol: TCP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: ReplicationController | |
metadata: | |
name: nsqadmin | |
spec: | |
replicas: 1 | |
selector: | |
name: nsqadmin | |
template: | |
metadata: | |
labels: | |
name: nsqadmin | |
spec: | |
containers: | |
- name: nsqadmin | |
image: nsqio/nsq | |
command: ["nsqadmin", "--lookupd-http-address=nsqlookupd.default.svc.cluster.local:4161"] | |
ports: | |
- containerPort: 4171 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: nsqadmin | |
labels: | |
name: nsqadmin | |
spec: | |
type: LoadBalancer | |
ports: | |
- port: 4171 | |
targetPort: 4171 | |
protocol: TCP | |
name: http | |
selector: | |
name: nsqadmin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: ReplicationController | |
metadata: | |
name: nsqlookupd | |
spec: | |
replicas: 1 | |
selector: | |
name: nsqlookupd | |
template: | |
metadata: | |
labels: | |
name: nsqlookupd | |
spec: | |
containers: | |
- name: nsqlookupd | |
image: nsqio/nsq | |
command: ["nsqlookupd"] | |
ports: | |
- containerPort: 4160 | |
name: tcp | |
protocol: TCP | |
- containerPort: 4161 | |
name: http | |
protocol: TCP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: nsqlookupd | |
labels: | |
name: nsqlookupd | |
spec: | |
type: LoadBalancer | |
ports: | |
- port: 4160 | |
name: tcp | |
targetPort: 4160 | |
- port: 4161 | |
name: http | |
targetPort: 4161 | |
selector: | |
name: nsqlookupd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment