apiVersion: apps/v1
kind: Deployment
metadata:
  name: mstore
  namespace: {{ .Release.Namespace }}
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mstore
  template:
    metadata:
      labels:
        app: mstore
    spec:
      restartPolicy: Always
      containers:
        - securityContext:
            privileged: true
          image: {{ include "mstore.imagePath" . }}/{{ .Values.main.image.name }}:{{ .Values.main.image.tag }} 
          imagePullPolicy: {{ .Values.main.image.imagePullPolicy }}
          name: mstore
          ports:
            - containerPort: {{ include "mstore.servicePort" . }}
              protocol: TCP
          volumeMounts:
            - name: config-volume
              mountPath: /app/etc/mstore
            - name: db-volume
              mountPath: /var/data
      volumes:
        - name: config-volume
          configMap:
            name: mstored-config
        - name: db-volume      
          persistentVolumeClaim:
            claimName: mstore-data
