Integrating the Leader Worker Set Operator
You can integrate the Leader Worker Set Operator with Red Hat build of Kueue so you can leverage the scheduling and resource management functionality when running LeaderWorkerSets.
The Leader Worker Set Operator allows you to manage multi-node AI/ML inference deployments efficiently. Red Hat build of Kueue provides scheduling and resource management capabilities for these deployments. You can configure Leader Worker Set Operator to leverage these capabilities when running the LeaderWorkerSet API for deploying a group of pods as a unit of replication.
Installing Leader Worker Set Operator with Red Hat build of Kueue
You can configure Red Hat build of Kueue to work with the Leader Worker Set Operator.
Prerequisites
- You have installed Red Hat build of Kueue using the Red Hat Build of Kueue Operator in the software catalog.
- You have installed Leader Worker Set Operator and Operand in the software catalog.
- You have cluster administrator permissions and the
kueue-batch-admin-rolerole. - You have access to the OpenShift Container Platform web console.
- You have installed the cert-manager Operator for Red Hat OpenShift for your cluster.
Procedure
- Add
LeaderWorkerSetto theconfig.integrations.frameworksection of the Red Hat build of Kueue cluster object, as shown in the following example:apiVersion: kueue.openshift.io/v1kind: Kueuemetadata:labels:app.kubernetes.io/name: kueue-operatorapp.kubernetes.io/managed-by: kustomizename: clusternamespace: openshift-kueue-operatorspec:managementState: Managedconfig:integrations:frameworks:- BatchJob- LeaderWorkerSet
Additional resources
- About the Leader Worker Set Operator
- LeaderWorkerSet API (Kubernetes documentation)
- Installing the cert-manager Operator for Red Hat OpenShift by using the web console
Running Leader Worker Set Operator with Red Hat build of Kueue
You can add and run the Leader Worker Set Operator to your existing frameworks.
Prerequisites
- Red Hat build of Kueue using the Red Hat Build of Kueue Operator is installed.
- Leader Worker Set Operator and Operand are installed.
- The cert-manager Operator for Red Hat OpenShift is installed.
- The
namespacewhereLeaderWorkerSetwill be created is labeled usingkueue.openshift.io/managed=true. - Ensure that the following objects have been configured:
ClusterQueueResourceFlavorLocalQueueNamespace
Procedure
- Create a file named
leaderworkerset.yaml.Example of a LeaderWorkerSetapiVersion: leaderworkerset.x-k8s.io/v1kind: LeaderWorkerSetmetadata:generation: 1name: my-lwsnamespace: my-namespacespec:leaderWorkerTemplate:leaderTemplate:metadata: {}spec:containers:- image: nginxinc/nginx-unprivileged:1.27name: leaderresources: {}restartPolicy: RecreateGroupOnPodRestartsize: 3workerTemplate:metadata: {}spec:containers:- image: nginxinc/nginx-unprivileged:1.27name: workerports:- containerPort: 8080protocol: TCPresources: {}networkConfig:subdomainPolicy: Sharedreplicas: 2rolloutStrategy:rollingUpdateConfiguration:maxSurge: 1maxUnavailable: 1type: RollingUpdatestartupPolicy: LeaderCreated - Specify the target local queue in the
metadata.labelssection of theLeaderWorkerSetconfiguration.metadata:labels:kueue.x-k8s.io/queue-name: user-queue - Apply the leader worker set configuration by running the following command:
$ oc apply -f leaderworkerset.yaml
Additional resources