# Note: here we do not need a k8s service since this service does not have any web/socket API (it connects to redis, but nobody connects to it)
apiVersion: apps/v1
kind: Deployment
metadata:
  name: cstar-cmd-pod-dep
  namespace: default
  labels:
    run: cstar-cmd-pod
spec:
  replicas: 1
  selector:
    matchLabels:
      run: cstar-cmd-pod
  template:
    metadata:
      labels:
        run: cstar-cmd-pod
    spec:
      volumes:
        - name: cstar-cmd-pod-src
          hostPath:
            path: '{{dir_abs}}/services/cmd-pod/src'
            type: Directory
        - name: cstar-cmd-pod-sql
          hostPath:
            path: '{{dir_abs}}/services/cmd-pod/sql'
            type: Directory
        - name: cstar-cmd-pod-dist
          hostPath:
            path: '{{dir_abs}}/services/cmd-pod/dist'
            type: Directory            
      containers:
        - image: "localhost:5000/cstar-cmd-pod:{{image_tag}}"
          name: cstar-cmd-pod-ctn
          imagePullPolicy: Always
          envFrom:
            - configMapRef:
                name: cstar-config
            - secretRef:
                name: cstar-secret
          env:
            - name: service_name
              value: cmd-pod          
          volumeMounts:
            - mountPath: /service/src
              name: cstar-cmd-pod-src
            - mountPath: /service/sql
              name: cstar-cmd-pod-sql
            - mountPath: /service/dist
              name: cstar-cmd-pod-dist              
      restartPolicy: Always
