apiVersion: apps/v1
kind: Deployment
metadata:
  name: api
spec:
  selector:
    matchLabels:
      app: api
  template:
    metadata:
      labels:
        app: api
    spec:
      containers:
      - name: api
        image: gcr.io/$(PROJECT)/api:latest
        imagePullPolicy: Always
        ports:
        - containerPort: 8080
          protocol: TCP
        envFrom:
        - configMapRef:
            name: "api-configmap"

        readinessProbe:
          httpGet:
            path: "/healthz/ready"
            port: 8080
          initialDelaySeconds: 5
          periodSeconds: 3

        livenessProbe:
          httpGet:
            path: "/healthz/alive"
            port: 8080
          initialDelaySeconds: 20
          periodSeconds: 3
