apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: rocketmq-nameserv
  labels:
    app: rocketmq

spec:
  serviceName: rocketmq
  replicas: 1
  selector:
    matchLabels:
      app: rocketmq
  template:
    metadata:
      labels:
        app: rocketmq
    spec:
      containers:
        - name: rocketmq
          image: registry.cn-hangzhou.aliyuncs.com/sre_pub/rocketmq:server
          imagePullPolicy: IfNotPresent
          resources:
            limits:
              cpu: 450m
              memory: 2000Mi
            requests:
              cpu: 400m
              memory: 2000Mi
          env:
            - name: TZ
              value: Asia/Shanghai
            - name: JAVA_OPT
              value: -Duser.home=/opt
            - name: JAVA_OPT_EXT
              value: -server -Xms1000m -Xmx1000m -Xmn256m
          ports:
            - containerPort: 9876
          volumeMounts:
            #            - name: vol-logs
            #              mountPath: /opt/logs
            - name: vol-init-d
              mountPath: /opt/store
  #      volumes:
  #        - name: vol-logs
  #          hostPath:
  #            path: /www/k8s/foxdev/rocketmq/logs
  #            type: Directory
  #        - name: vol-init-d
  #          hostPath:
  #            path: /www/k8s/foxdev/rocketmq/store
  #            type: Directory
  volumeClaimTemplates:
    - metadata:
        name: vol-init-d
      spec:
        accessModes: [ "ReadWriteOnce" ]
        resources:
          requests:
            storage: 1Gi
        #使用storageclass
#        volumeName:
#        storageClassName: nfs