apiVersion: kueue.x-k8s.io/v1beta2
kind: ResourceFlavor
metadata:
  name: compute # Just needs to exist, can be managed with tains/tolerations
  annotations:
    argocd.argoproj.io/sync-wave: "2"
spec:
  nodeLabels:
    node-role.kubernetes.io/compute: compute
    topology.kubernetes.io/group: c1 # Only run on C1 for now
---
apiVersion: kueue.x-k8s.io/v1beta2
kind: ClusterQueue
metadata:
   name: cluster-queue
   annotations:
     argocd.argoproj.io/sync-wave: "2"
spec:
  namespaceSelector: {} # Accept workloads from any namespace
  queueingStrategy: BestEffortFIFO
  # preemption:
    # withinClusterQueue: "LowerPriority" # Allow higher priority to preempt lower
  resourceGroups:
   - coveredResources: ["cpu", "memory"] # Cover both memory and cpu resources
     flavors:
       - name: compute
         resources:
           - name: "cpu"
             nominalQuota: '32'
           - name: "memory"
             nominalQuota: 64Gi
# ---
# apiVersion: kueue.x-k8s.io/v1beta2
# kind: LocalQueue
# metadata:
#   name: prod-queue
#   namespace: prod-queue
# spec:
#   clusterQueue: cluster-queue
---
apiVersion: v1
kind: Namespace
metadata:
  name: dev-queue
  annotations:
    argocd.argoproj.io/sync-wave: "2"
---
apiVersion: kueue.x-k8s.io/v1beta2
kind: LocalQueue
metadata:
  name: dev-queue
  namespace: dev-queue
  annotations:
    argocd.argoproj.io/sync-wave: "2"
spec:
  clusterQueue: cluster-queue
---
apiVersion: v1
kind: Namespace
metadata:
  name: prod-queue
  annotations:
    argocd.argoproj.io/sync-wave: "2"
---
apiVersion: kueue.x-k8s.io/v1beta2
kind: LocalQueue
metadata:
  name: prod-queue
  namespace: prod-queue
  annotations:
    argocd.argoproj.io/sync-wave: "2"
spec:
  clusterQueue: cluster-queue
# ---
# apiVersion: kueue.x-k8s.io/v1beta2
# kind: WorkloadPriorityClass
# metadata:
#   name: "normal"
# value: 100
# ---
# apiVersion: kueue.x-k8s.io/v1beta2
# kind: WorkloadPriorityClass
# metadata:
#   name: "high"
# value: 200 # Higher value = higher priority
