apiVersion: apps/v1 
kind: Deployment
metadata:
  name: phippy-api-v1
spec:
  replicas: 2
  selector:
    matchLabels:
      app.kubernetes.io/name: phippy
      app.kubernetes.io/component: api
      app.kubernetes.io/version: v1.0
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
  template:
    metadata:
      labels:
        app.kubernetes.io/name: phippy
        app.kubernetes.io/component: api
        app.kubernetes.io/version: v1.0
    spec:
      containers:
      - name: phippy-api
        image: ghcr.io/hlesey/phippy-api:1.0
        env:
        - name: DB_HOST
          value: "phippy-db"
        - name: DB_PORT
          value: "6379"
        resources:
          limits:
            memory: "100Mi"
          requests:
            cpu: "100m"
            memory: "100Mi"
        ports:
        - name: http
          containerPort: 5000
        livenessProbe:
          httpGet:
            path: /livez
            port: http
        readinessProbe:
          httpGet:
            path: /readyz
            port: http
