---
apiVersion: awx.ansible.com/v1beta1
kind: AWX
metadata:
  name: awx
  namespace: awx
spec:
  # NodePort — expose on port 30080 (HTTP) and 30443 (HTTPS)
  # Simpler than ingress for direct IP access without DNS
  service_type: nodeport
  nodeport_port: 30080

  # Resource limits — tuned for 8 GiB VM
  # Web needs ~1.5 GiB (5 uWSGI workers + daphne + nginx + redis sidecar)
  # Task needs ~2 GiB (dispatcher + callback receiver + workers)
  web_resource_requirements:
    requests:
      cpu: 200m
      memory: 1Gi
    limits:
      cpu: "2"
      memory: 2Gi
  task_resource_requirements:
    requests:
      cpu: 200m
      memory: 1Gi
    limits:
      cpu: "2"
      memory: 3Gi
  ee_resource_requirements:
    requests:
      cpu: 100m
      memory: 256Mi
    limits:
      cpu: "1"
      memory: 1Gi

  # PostgreSQL — bundled (operator-managed)
  postgres_storage_class: local-path
  postgres_storage_requirements:
    requests:
      storage: 8Gi
  postgres_resource_requirements:
    requests:
      cpu: 100m
      memory: 256Mi
    limits:
      cpu: 500m
      memory: 512Mi

  # Projects — persistent storage for SCM checkouts
  # access_mode must be ReadWriteOnce for local-path (K3s default provisioner)
  projects_persistence: true
  projects_storage_class: local-path
  projects_storage_size: 4Gi
  projects_storage_access_mode: ReadWriteOnce

  # Admin account
  admin_user: admin
