Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.9k views
in Technique[技术] by (71.8m points)

javascript - Configure NATS max_payload on Kubernetes

my problem is that I need to increase NATS max_payload in production environment but it uses Kubernetes and I have no idea how to do that, I tried to use ConfigMap but I had not success.

In local/dev environment it uses a NATS config file with docker so it works fine.

Way to make it works local: NATS with moleculer. How can I change NATS max_payload value?

Code inside k8s/deployment.develop.yaml

(...)
apiVersion: v1
kind: ServiceAccount
metadata:
  name: nats
  namespace: develop
  labels:
    account: nats
---
apiVersion: v1
kind: Service
metadata:
  name: nats
  namespace: develop
  labels:
    app: nats
    service: nats
spec:
  ports:
    - port: 4222
      targetPort: 4222
  selector:
    app: nats
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nats-v1
  namespace: develop
  labels:
    app: nats
    version: v1
spec:
  replicas: 1
  strategy: {}
  selector:
    matchLabels:
      app: nats
      version: v1
  template:
    metadata:
      labels:
        app: nats
        version: v1
    spec:
      serviceAccountName: nats
      containers:
        - image: 'nats:alpine'
          name: nats
          ports:
            - containerPort: 4222
      restartPolicy: Always
      tolerations: []
      affinity: {}

Thanks!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...