sigs.k8s.io/kueue@v0.6.2/site/content/en/docs/tasks/run_flux_minicluster.md (about)

     1  ---
     2  title: "Run A Flux MiniCluster"
     3  date: 2022-02-14
     4  weight: 6
     5  description: >
     6    Run a Kueue scheduled Flux MiniCluster.
     7  ---
     8  
     9  This page shows how to leverage Kueue's scheduling and resource management capabilities when running [Flux Operator's](https://flux-framework.org/flux-operator/) MiniClusters.
    10  
    11  This guide is for [batch users](/docs/tasks#batch-user) that have a basic understanding of Kueue. For more information, see [Kueue's overview](/docs/overview).
    12  
    13  ## Before you begin
    14  
    15  Check [administer cluster quotas](/docs/tasks/administer_cluster_quotas) for details on the initial cluster setup.
    16  
    17  Check [the Flux Operator installation guide](https://flux-framework.org/flux-operator/getting_started/user-guide.html#install).
    18  
    19  ## MiniCluster definition
    20  
    21  Because a Flux MiniCluster runs as a [`batch/Job`](https://kubernetes.io/docs/concepts/workloads/controllers/job/), Kueue does not require extra components to manage a Flux MiniCluster.
    22  However, take into consideration the following aspects:
    23  
    24  ### a. Queue selection
    25  
    26  The target [local queue](/docs/concepts/local_queue) should be specified in the `spec.jobLabels` section of the MiniCluster configuration.
    27  
    28  ```yaml
    29    jobLabels:
    30      kueue.x-k8s.io/queue-name: user-queue
    31  ```
    32  
    33  ### b. Configure the resource needs
    34  
    35  The resource needs of the workload can be configured in the `spec.container[*].resources` sections of the MiniCluster configuration.
    36  
    37  ```yaml
    38  spec:
    39    containers:
    40      - image: <image>
    41        resources:
    42          requests:
    43            cpu: 4
    44            memory: "200Mi"
    45  ```
    46  
    47  ## Sample MiniCluster
    48  
    49  ```yaml
    50  apiVersion: flux-framework.org/v1alpha1
    51  kind: MiniCluster
    52  metadata:
    53    generateName: flux-sample-kueue-
    54  spec:
    55    size: 1
    56    containers:
    57      - image: ghcr.io/flux-framework/flux-restful-api:latest
    58        command: sleep 10 
    59        resources:
    60          requests:
    61            cpu: 4
    62            memory: "200Mi"
    63    jobLabels:
    64      kueue.x-k8s.io/queue-name: user-queue
    65  ```
    66  
    67  For equivalent instructions for doing this in Python, see [Run Python Jobs](/docs/tasks/run_python_jobs/#flux-operator-job).