
apiVersion: apps/v1
kind: Deployment
metadata:
  name: "carto-waze-web-api"
spec:
  replicas: 1
  selector:
    matchLabels:
      app: "carto-waze-web-api"
  template:
    metadata:
      labels:
        app: "carto-waze-web-api"
    spec:
      containers:
        - name: "carto-waze-web-api"
          image: "gcr.io/geographica-gs/carto-waze-web/api:prod"
          imagePullPolicy: Always
          command: ["gunicorn"]
          args: ["-b 0.0.0.0:5000", "app:app"]
          ports:
            - containerPort: 5000
          resources:
            requests:
              memory: "400Mi"
              cpu: "0.15"
            limits:
              memory: "550Mi"
              cpu: "0.25"
          envFrom:
            - configMapRef:
                name: "carto-waze-web-api-config"
            - secretRef:
                name: "carto-waze-web-api-secrets"
          livenessProbe:
            httpGet:
              path: /
              port: 5000
            initialDelaySeconds: 50
            timeoutSeconds: 5
            periodSeconds: 15
          readinessProbe:
            httpGet:
              path: /
              port: 5000
            initialDelaySeconds: 5
            timeoutSeconds: 3
            periodSeconds: 3
            successThreshold: 2
            failureThreshold: 100
      #     volumeMounts:
      #       - name: gcloud-credentials
      #         mountPath: /tmp/gcloud-credentials/
      #         readOnly: true
      # volumes:
      #   - name: gcloud-credentials
      #     secret:
      #       secretName: "carto-waze-web-api-secrets"
      #       items:
      #         - key: CARTO_WAZE_WEB_API_gcloud-credentials.json
      #           path: credentials.json
