2022-12-29:nsq是go语言写的消息队列。请问k3s部署nsq,yaml如何写?
答案2022-12-29:
yaml如下:
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: nsq
name: nsq
namespace: moonfdd
spec:
replicas: 1
selector:
matchLabels:
app: nsq
template:
metadata:
labels:
app: nsq
spec:
containers:
- image: "nsqio/nsq"
imagePullPolicy: IfNotPresent
name: nsqlookupd
args:
- "/nsqlookupd"
- image: "nsqio/nsq"
imagePullPolicy: IfNotPresent
name: nsqd
args:
- "/nsqd"
- "--lookupd-tcp-address"
- "localhost:4160"
volumeMounts:
- mountPath: /data
name: volv2
- image: "nsqio/nsq"
imagePullPolicy: IfNotPresent
name: nsqadmin
args:
- "/nsqadmin"
- "--lookupd-http-address"
- "localhost:4161"
volumes:
- hostPath:
path: /root/k8s/moonfdd/nsq/data
type: DirectoryOrCreate
name: volv2
---
apiVersion: v1
kind: Service
metadata:
labels:
app: nsq
name: nsq
namespace: moonfdd
spec:
ports:
- name: nsqlookupd0
port: 4160
protocol: TCP
targetPort: 4160
- name: nsqlookupd1
port: 4161
protocol: TCP
targetPort: 4161
- name: nsqd0
port: 4150
protocol: TCP
targetPort: 4150
- name: nsqd1
port: 4151
protocol: TCP
targetPort: 4151
- name: nsqadmin
port: 4171
protocol: TCP
targetPort: 4171
selector:
app: nsq
type: NodePort
web端口是58395
curl命令端口是36055
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。