apiVersion: apps/v1
kind: Deployment
metadata:
  name: codepix
spec:
  selector:
    matchLabels:
      app: codepix
  template:
    metadata:
      labels:
        app: codepix
    spec:
      containers:
      - name: codepix
        image: mvcorsi/codepix-go
        command: ["./codepix", "grpc"]
        ports:
        - containerPort: 50051
        envFrom:
          - secretRef:
              name: codepix-secret
        volumeMounts:
          - name: codepix-conf
            mountPath:  /go/src/.env
            subPath: .env
      volumes:
        - name: codepix-conf
          configMap:
            name: codepix-conf
            items:
             - key: env
               path: .env