apiVersion: apps/v1
kind: Deployment
metadata:
  name: ${_APP}
  labels:
    app: ${_APP}
spec:
  replicas: 1
  revisionHistoryLimit: 1
  selector:
    matchLabels:
      app: ${_APP}
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: ${_APP}
    spec:
      containers:
      - name: ${_APP}
        image: gcr.io/${PROJECT_ID}/${_APP}:${COMMIT_SHA}
        imagePullPolicy: Always
        ports:
        - name: http
          containerPort: 3000
        readinessProbe:
          httpGet:
            path: /healthcheck
            port: 3000
            scheme: HTTP
          initialDelaySeconds: 3
          periodSeconds: 3
        livenessProbe:
          failureThreshold: 3
          httpGet:
            path: /healthcheck
            port: 3000
            scheme: HTTP
          initialDelaySeconds: 90
          periodSeconds: 3
          timeoutSeconds: 10
        # Use default vars from the dev app
        envFrom:
          - configMapRef:
              name: ${_APP}
