---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: rocketmq-namesrv
  namespace: rocketmq-operator
  labels:
    app: rocketmq-namesrv
spec:
  replicas: 2
  selector:
    matchLabels:
      app: rocketmq-namesrv
  template:
    metadata:
     labels:
       app: rocketmq-namesrv
    spec:
      hostNetwork: true
      dnsPolicy: ClusterFirstWithHostNet
      containers:
      - name: namesrv
        image: huanwei/rocketmq:4.3.2
        imagePullPolicy: IfNotPresent
        ports:
          - containerPort: 9876
        volumeMounts:
          - mountPath: /root/logs
            name: namesrvoptlogs
          - mountPath: /root/store
            name: namesrvoptstore
      volumes:
      - name: namesrvoptlogs
        hostPath:
          path: /data/namesrv/logs
      - name: namesrvoptstore
        hostPath:
          path: /data/namesrv/store
      nodeSelector:
           rocketmq-operator: "on"