apiVersion: apps/v1 
kind: Deployment
metadata:
  name: phippy-api-v2
spec:
  replicas: 2
  selector:
    matchLabels:
      app: phippy-api
      version: v2.0
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
  template:
    metadata:
      labels:
        app: phippy-api
        version: v2.0
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/port: "5000"
    spec:
      containers:
      - name: phippy-api
        image: ghcr.io/hlesey/phippy-api:2.0
        env:
          - name: FLASK_ENV
            value: development
          - name: REDIS_HOST
            value: "phippy-db"
          - name: REDIS_PORT
            value: "6379"
        resources:
          requests:
            cpu: "100m"
            memory: "100Mi"
        ports:
        - name: http
          protocol: TCP
          containerPort: 5000
        livenessProbe:
          httpGet:
            path: /healthz
            port: http
          initialDelaySeconds: 15
          periodSeconds: 5
        readinessProbe:
          httpGet:
            path: /healthz
            port: http
          periodSeconds: 5
