apiVersion: apps/v1
kind: Deployment
metadata:
  name: frontend
  namespace: control-plane
spec:
  replicas: 2
  selector:
    matchLabels:
      app: frontend
  template:
    metadata:
      labels:
        app: frontend
    spec:
      imagePullSecrets:
      - name: gitea-registry
      containers:
      - name: frontend
        image: git.fuq.tv/admin/aiworker-frontend:latest
        imagePullPolicy: Always
        ports:
        - containerPort: 3001
        env:
        - name: PORT
          value: "3001"
        - name: BACKEND_URL
          value: "http://backend.control-plane.svc.cluster.local:3000"
        resources:
          requests:
            cpu: 100m
            memory: 128Mi
          limits:
            cpu: 500m
            memory: 512Mi
        livenessProbe:
          httpGet:
            path: /
            port: 3001
          initialDelaySeconds: 10
          periodSeconds: 30
        readinessProbe:
          httpGet:
            path: /
            port: 3001
          initialDelaySeconds: 5
          periodSeconds: 10
