apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: document-download-api
  name: document-download-api
  namespace: notification-canada-ca
spec:
  replicas: 1
  revisionHistoryLimit: 5
  selector:
    matchLabels:
      app: document-download-api
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: document-download-api
    spec:
      containers:
        - image: document-download-api
          imagePullPolicy: Always
          name: document-download-api
          env:
            - name: AUTH_TOKENS
              value: '$(AUTH_TOKENS)'
            - name: AWS_REGION
              value: '$(AWS_REGION)'
            - name: DEBUG
              value: 'False'
            - name: DOCUMENTS_BUCKET
              value: '$(DOCUMENTS_BUCKET)'
            - name: FRONTEND_HOSTNAME
              value: 'document.$(BASE_DOMAIN)'
            - name: HTTP_SCHEME
              value: 'https'
            - name: MLWR_USER
              value: '$(MLWR_USER)'
            - name: MLWR_KEY
              value: '$(MLWR_KEY)'
            - name: SECRET_KEY
              value: '$(SECRET_KEY)'
            - name: EXTRA_MIME_TYPES
              value: '$(EXTRA_MIME_TYPES)'
            - name: NEW_RELIC_APP_NAME
              value: 'notification-document-api-$(ENVIRONMENT)'
            - name: NEW_RELIC_DISTRIBUTED_TRACING_ENABLED
              value: 'true'
            - name: NEW_RELIC_LICENSE_KEY
              value: '$(NEW_RELIC_LICENSE_KEY)'
            - name: NEW_RELIC_MONITOR_MODE
              value: '$(NEW_RELIC_MONITOR_MODE)'
            - name: NOTIFY_ENVIRONMENT
              value: '$(ENVIRONMENT)'
          resources:
            requests:
              cpu: "100m"
              memory: "400Mi"
            limits:
              cpu: "400m"
              memory: "800Mi"
          ports:
            - containerPort: 7000
          readinessProbe:
            httpGet:
              path: /_status
              port: 7000
            initialDelaySeconds: 1
            periodSeconds: 3
            timeoutSeconds: 1
            successThreshold: 3
            failureThreshold: 10
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30
status: {}
