apiVersion: apps/v1
kind: Deployment
metadata:
  name: claude-agent
  namespace: agents
spec:
  replicas: 1
  selector:
    matchLabels:
      app: claude-agent
  template:
    metadata:
      labels:
        app: claude-agent
    spec:
      serviceAccountName: agent-sa
      imagePullSecrets:
      - name: gitea-registry
      containers:
      - name: agent
        image: git.fuq.tv/admin/aiworker-agent:latest
        imagePullPolicy: Always
        env:
        - name: ANTHROPIC_API_KEY
          valueFrom:
            secretKeyRef:
              name: agent-secrets
              key: anthropic-api-key
        - name: BACKEND_URL
          value: "https://api.fuq.tv"
        - name: MCP_ENDPOINT
          value: "https://api.fuq.tv/api/mcp"
        - name: GITEA_URL
          value: "https://git.fuq.tv"
        - name: GITEA_TOKEN
          valueFrom:
            secretKeyRef:
              name: agent-secrets
              key: gitea-token
        - name: AGENT_ID
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        - name: NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        resources:
          requests:
            cpu: 500m
            memory: 1Gi
          limits:
            cpu: 2000m
            memory: 4Gi
        volumeMounts:
        - name: workspace
          mountPath: /workspace
      volumes:
      - name: workspace
        emptyDir: {}
