apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: stan
  namespace: leaq
spec:
  serviceName: stan
  replicas: 1
  selector:
    matchLabels:
      app: stan
  template:
    metadata:
      labels:
        app: stan
    spec:
      volumes:
        - name: data-stan
          emptyDir:
            sizeLimit: 70Gi
      containers:
        - name: stan
          image: nats-streaming:0.21
          ports:
            - containerPort: 4222
              name: client
            - containerPort: 8222
              name: monitoring
          args:
            - "--cluster_id"
            - "stan"
            - "--store"
            - "FILE"
            - "--dir"
            - "/data"
            - "--max_msgs"
            - "0"
            - "--max_bytes"
            - "64424509440"
            - "--max_age"
            - "720h"
            - "--nats_server"
            - "nats://nats:4222"
          resources:
            requests:
              cpu: 150m
              memory: 400Mi
            limits:
              cpu: "1"
              memory: 1.5Gi
          volumeMounts:
            - name: data-stan
              mountPath: /data
              readOnly: false
