apiVersion: apps/v1
kind: Deployment
metadata:
  name: codepix
spec:
  replicas: 5
  selector:
    matchLabels:
      app: codepix
  template:
    metadata:
      labels:
        app: codepix
    spec:
      containers:
        - name: codepix
          image: gabsms/codepix:latest
          command: [ "./codepix", "all" ]
          ports:
            - containerPort: 50051
          volumeMounts:
            - name: codepix-volume
              mountPath: /go/src/.env
              subPath: .env
          envFrom:
            - secretRef:
                name: codepix-secret
          resources:
            requests:
              memory: "256Mi"
              cpu: "200m"
            limits:
              memory: "512Mi"
              cpu: "450m"
      volumes:
        - name: codepix-volume
          configMap:
            name: codepix-conf
            items:
              - key: env
                path: .env