apiVersion: apps/v1
kind: Deployment
metadata:
  name: api
  labels:
    app: api
spec:
  replicas: 3
  selector:
    matchLabels:
      app: api
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: api
        version: v2.0
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/port: "3000"
    spec:
      containers:
        - name: api
          image: walkerrandolphsmith/k8s-deployment-strategies:2.0
          ports:
            - name: http
              containerPort: 3000
            - name: probe
              containerPort: 3001
          livenessProbe:
            httpGet:
              path: /live
              port: probe
            initialDelaySeconds: 120
            periodSeconds: 120
            timeoutSeconds: 120
            failureThreshold: 120
          readinessProbe:
            httpGet:
              path: /ready
              port: probe
            initialDelaySeconds: 120
            periodSeconds: 120
            timeoutSeconds: 120
            failureThreshold: 120
          resources:
            requests:
              memory: "64Mi"
              cpu: "250m"
            limits:
              memory: "128Mi"
              cpu: "500m"
