# The deployment for cstor-pool and cstor-pool-mgmt.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: cstor-pool-deploy
  labels:
    app: cstor-pool
spec:
  replicas: 1
  selector:
    matchLabels:
      app: cstor-pool
  template:
    metadata:
      labels:
        app: cstor-pool
    spec:
      containers:
      - name: cstor-pool
        image: openebs/cstor-pool:ci
        ports:
        - containerPort: 80
        securityContext: 
          privileged: true

        volumeMounts:
        - name: device
          mountPath: /dev     
        - name: tmp
          mountPath: /tmp
#         mountPropagation: Bidirectional
        lifecycle:
          postStart:
            exec:
              command: ["/bin/sh", "-c", "sleep 15"]

      - name:    cstor-pool-mgmt
        image: gkganeshr/cstor-pool-mgmt:v1
        ports:
        - containerPort: 80
        securityContext: 
          privileged: true
        volumeMounts:
        - name: device
          mountPath: /dev
        - name: tmp
          mountPath: /tmp
#          mountPropagation: Bidirectional
        env:
        - name: cstorid
          value: "9368bb1c-5cfc-11e8-b6fb-54e1ad4a9dd4"

        lifecycle:
          postStart:
            exec:
              command: ["/bin/sh", "-c", "sleep 15"]

      volumes:
      - name: device
        hostPath:
          # directory location on host
          path: /dev
          # this field is optional
          type: Directory
      - name: tmp
        hostPath:
          path: /var/openebs/shared-a2b
          type: Directory
