apiVersion: apps/v1
kind: Deployment
metadata:
  name: cstar-vid-scaler-dep
  namespace: default
  labels:
    run: cstar-vid-scaler
spec:
  replicas: 1
  selector:
    matchLabels:
      run: cstar-vid-scaler
  template:
    metadata:
      labels:
        run: cstar-vid-scaler
    spec:
      volumes:
        # Those volumes are for development, it allow REPL dev from local build
        - name: cstar-vid-scaler-src
          hostPath:
            path: '{{dir_abs}}/services/vid-scaler/src'
            type: Directory
        - name: cstar-vid-scaler-dist
          hostPath:
            path: '{{dir_abs}}/services/vid-scaler/dist'
            type: Directory
      containers:
        - image: "localhost:5000/cstar-vid-scaler:{{image_tag}}"
          name: cstar-vid-scaler-ctn
          imagePullPolicy: Always
          envFrom:
            - configMapRef:
                name: cstar-config
            - secretRef:
                name: cstar-secret
          env:
            - name: service_name
              value: vid-scaler
          volumeMounts:
            - mountPath: /service/src
              name: cstar-vid-scaler-src
            - mountPath: /service/dist
              name: cstar-vid-scaler-dist
      restartPolicy: Always