Run A Flux MiniCluster

Run a Kueue scheduled Flux MiniCluster.

This page shows how to leverage Kueue’s scheduling and resource management capabilities when running Flux Operator’s MiniClusters.

This guide is for batch users that have a basic understanding of Kueue. For more information, see Kueue’s overview.

Before you begin

Check administer cluster quotas for details on the initial cluster setup.

Check the Flux Operator installation guide.

MiniCluster definition

Because a Flux MiniCluster runs as a batch/Job, Kueue does not require extra components to manage a Flux MiniCluster. However, take into consideration the following aspects:

a. Queue selection

The target local queue should be specified in the spec.jobLabels section of the MiniCluster configuration.

  jobLabels:
    kueue.x-k8s.io/queue-name: user-queue

b. Configure the resource needs

The resource needs of the workload can be configured in the spec.container[*].resources sections of the MiniCluster configuration.

spec:
  containers:
    - image: <image>
      resources:
        requests:
          cpu: 4
          memory: "200Mi"

Sample MiniCluster

apiVersion: flux-framework.org/v1alpha1
kind: MiniCluster
metadata:
  generateName: flux-sample-kueue-
spec:
  size: 1
  containers:
    - image: ghcr.io/flux-framework/flux-restful-api:latest
      command: sleep 10 
      resources:
        requests:
          cpu: 4
          memory: "200Mi"
  jobLabels:
    kueue.x-k8s.io/queue-name: user-queue

For equivalent instructions for doing this in Python, see Run Python Jobs.