apiVersion: apps/v1
kind: Deployment
metadata:
  name: planner
  namespace: planner
spec:
  replicas: 1
  selector:
    matchLabels:
      app: planner
  template:
    metadata:
      labels:
        app: planner
    spec:
      containers:
      - name: planner
        image: planner:latest
        ports:
        - containerPort: 8000
        env:
        - name: DB_PATH
          value: /data/planner.db
        - name: FRONTEND_DIR
          value: /app/frontend
        - name: DATA_DIR
          value: /data
        volumeMounts:
        - name: data
          mountPath: /data
        resources:
          requests:
            memory: "128Mi"
            cpu: "100m"
          limits:
            memory: "256Mi"
            cpu: "500m"
        readinessProbe:
          httpGet:
            path: /api/backups
            port: 8000
          initialDelaySeconds: 5
          periodSeconds: 10
      volumes:
      - name: data
        persistentVolumeClaim:
          claimName: planner-data
