apiVersion: apps/v1
kind: Deployment
metadata:
  name: bucket-text-api
  labels:
    app: bucket-text-api
  annotations:
    bm.bmutziu.me/cloud: gcp
    bm.bmutziu.me/name-prefix: bm
    bm.bmutziu.me/on-delete-policy: destroy
spec:
  replicas: 2
  selector:
    matchLabels:
      app: bucket-text-api
  template:
    metadata:
      labels:
        app: bucket-text-api
    spec:
      containers:
      - name: bucket-text-api
        image: bmutziu/bucket-text-api
        ports:
          - containerPort: 8000
        env:
          - name: PORT
            value: "8000"
          - name: GCP_PROJECT
            value : doc-20210122235631
          - name: BUCKET_NAME
            value: bm-default-bucket-text-api
          - name: GOOGLE_APPLICATION_CREDENTIALS
            value: /var/secrets/gcp/account.json
        volumeMounts:
          - mountPath: /var/secrets/gcp
            name: storage-writer-key
        resources:
          limits:
            cpu: "500m"
            memory: "128Mi"
      volumes:
        - name: storage-writer-key
          # this secret was created separately using `kubectl create secret generic storage-writer-key --from-file=sa.json=sa.json`
          secret:
            secretName: storage-writer-key
