apiVersion: apps/v1
kind: Deployment
metadata:
  name: api-cli-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      app: api-cli
  template:
    metadata:
      labels:
        app: api-cli
    spec:
      containers:
        - image: gcr.io/bedrock-foundation/bedrock-core-services-api-cli
          imagePullPolicy: Always
          name: api-cli
          # resources:
          #   limits:
          #     cpu: "1000m"
          #     memory: "4Gi"
          env:
            - name: ENV_NAME
              value: "production"
            - name: NODE_ENV
              value: "production"
            - name: MONGO_URI
              value: "mongodb://mongo:27017/bedrock_production"
            - name: APP_URL
              value: "https://bedrock.foundation"
            - name: ADMIN_EMAIL
              value: "admin@bedrock.foundation"
            - name: ADMIN_PASSWORD
              value: "development.now"
            - name: POSTMARK_FROM
              value: "no-reply@bedrock.foundation"
            - name: UPLOADS_STORE
              value: "gcs"
            - name: UPLOADS_GCS_BUCKET
              value: "bedrock-production-uploads"
            # The `bedrock cloud` command in the CLI will help with
            # the creation and storing of secrets for production.
            - name: JWT_SECRET
              valueFrom:
                secretKeyRef:
                  name: secrets
                  key: JWT_SECRET
            - name: POSTMARK_API_KEY
              valueFrom:
                secretKeyRef:
                  name: secrets
                  key: POSTMARK_API_KEY
          volumeMounts:
            - name: jobs-cache
              mountPath: /workdir/data
      volumes:
        - name: jobs-cache
          emptyDir: {}
