Skip to content

Commit 91f3c8a

Browse files
authored
Merge pull request #93005 from abrennan89/admin-gs
OSDOCS-14540: Content journey #1: Kueue administrator getting started
2 parents 32d050a + 85e5a78 commit 91f3c8a

12 files changed

+228
-21
lines changed

_attributes/common-attributes.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,4 +124,4 @@
124124
:mce: multicluster engine for Kubernetes Operator
125125
:mce-short: multicluster engine Operator
126126
//Kueue
127-
:ocp-full: Red Hat OpenShift Container Platform
127+
:platform: Red Hat OpenShift Container Platform

_topic_maps/_topic_map.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,10 @@ Distros: openshift-kueue
3838
Topics:
3939
- Name: RBAC permissions
4040
File: rbac-permissions
41+
---
42+
Name: Configure
43+
Dir: configure
44+
Distros: openshift-kueue
45+
Topics:
46+
- Name: Configuring quotas
47+
File: configuring-quotas

configure/_attributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../_attributes/

configure/configuring-quotas.adoc

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
include::_attributes/common-attributes.adoc[]
3+
[id="configuring-quotas"]
4+
= Configuring quotas
5+
:context: configuring-quotas
6+
7+
toc::[]
8+
9+
As an administrator, you can use {product-title} to configure quotas to optimize resource allocation and system throughput for user workloads.
10+
You can configure quotas for compute resources such as CPU, memory, pods, and GPU.
11+
12+
You can configure quotas in {product-title} by completing the following steps:
13+
14+
. Configure a cluster queue.
15+
. Configure a resource flavor.
16+
. Configure a local queue.
17+
18+
Users can then submit their workloads to the local queue.
19+
20+
include::modules/configuring-clusterqueues.adoc[leveloffset=+1]
21+
22+
[role="_next-steps"]
23+
[id="clusterqueues-next-steps_{context}"]
24+
.Next steps
25+
26+
The cluster queue is not ready for use until a xref:../configure/configuring-quotas.adoc#configuring-resourceflavors_configuring-quotas[`ResourceFlavor` object] has also been configured.
27+
28+
include::modules/configuring-resourceflavors.adoc[leveloffset=+1]
29+
30+
include::modules/configuring-localqueues.adoc[leveloffset=+1]
31+
32+
[role="_additional-resources"]
33+
[id="clusterqueues-additional-resources_{context}"]
34+
== Additional resources
35+
* xref:../authentication/rbac-permissions.adoc#rbac-permissions[RBAC permissions]
36+
* link:https://kueue.sigs.k8s.io/docs/concepts/cluster_queue/[Kubernetes documentation about cluster queues]
37+
38+
////
39+
// Save this content for user content journey abstract
40+
// Users create jobs to be admitted to {product-title} by using the standard link:https://kubernetes.io/docs/concepts/workloads/controllers/job/[Kubernetes `Job` API].
41+
// Users can create any supported `Job` object, and then add the `kueue.x-k8s.io/queue-name` label to that object to connect it to a `LocalQueue` resource.
42+
43+
[role="_additional-resources"]
44+
[id="additional-resources_{context}"]
45+
== Additional resources
46+
* link:https://docs.redhat.com/en/documentation/openshift_container_platform/latest/html/nodes/using-jobs-and-daemon-sets#nodes-nodes-jobs[Running tasks in pods using jobs]
47+
////

configure/images

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../images/

configure/modules

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../modules/

configure/snippets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../snippets/
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * /configure/configuring-quotas.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="configuring-clusterqueues_{context}"]
7+
= Configuring a cluster queue
8+
9+
A cluster queue is a cluster-scoped resource, represented by a `ClusterQueue` object, that governs a pool of resources such as CPU, memory, and pods.
10+
Cluster queues can be used to define usage limits, quotas for resource flavors, order of consumption, and fair sharing rules.
11+
12+
[NOTE]
13+
====
14+
The cluster queue is not ready for use until a `ResourceFlavor` object has also been configured.
15+
====
16+
17+
.Prerequisites
18+
19+
include::snippets/prereqs-snippet.adoc[]
20+
21+
.Procedure
22+
23+
. Create a `ClusterQueue` object as a YAML file:
24+
+
25+
.Example of a basic `ClusterQueue` object using a single resource flavor
26+
[source,yaml]
27+
----
28+
apiVersion: kueue.x-k8s.io/v1beta1
29+
kind: ClusterQueue
30+
metadata:
31+
name: example-queue
32+
spec:
33+
namespaceSelector: {} <1>
34+
resourceGroups:
35+
- coveredResources: ["cpu", "memory", "pods", "foo.com/gpu"] <2>
36+
flavors:
37+
- name: "default-flavor" <3>
38+
resources: <4>
39+
- name: "cpu"
40+
nominalQuota: 9
41+
- name: "memory"
42+
nominalQuota: 36Gi
43+
- name: "pods"
44+
nominalQuota: 5
45+
- name: "foo.com/gpu"
46+
nominalQuota: 100
47+
----
48+
<1> Defines which namespaces can use the resources governed by this cluster queue. An empty `namespaceSelector` as shown in the example means that all namespaces can use these resources.
49+
<2> Defines the resource types governed by the cluster queue. This example `ClusterQueue` object governs CPU, memory, pod, and GPU resources.
50+
<3> Defines the resource flavor that is applied to the resource types listed. In this example, the `default-flavor` resource flavor is applied to CPU, memory, pod, and GPU resources.
51+
<4> Defines the resource requirements for admitting jobs. This example cluster queue only admits jobs if the following conditions are met:
52+
+
53+
* The sum of the CPU requests is less than or equal to 9.
54+
* The sum of the memory requests is less than or equal to 36Gi.
55+
* The total number of pods is less than or equal to 5.
56+
* The sum of the GPU requests is less than or equal to 100.
57+
58+
. Apply the `ClusterQueue` object by running the following command:
59+
+
60+
[source,terminal]
61+
----
62+
$ oc apply -f <filename>.yaml
63+
----
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * /configure/configuring-quotas.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="configuring-localqueues_{context}"]
7+
= Configuring a local queue
8+
9+
A local queue is a namespaced object, represented by a `LocalQueue` object, that groups closely related workloads that belong to a single namespace.
10+
11+
As an administrator, you can configure a `LocalQueue` object to point to a cluster queue. This allocates resources from the cluster queue to workloads in the namespace specified in the `LocalQueue` object.
12+
13+
.Prerequisites
14+
15+
include::snippets/prereqs-snippet.adoc[]
16+
17+
* You have created a `ClusterQueue` object.
18+
19+
.Procedure
20+
21+
. Create a `LocalQueue` object as a YAML file:
22+
+
23+
.Example of a basic `LocalQueue` object
24+
[source,yaml]
25+
----
26+
apiVersion: kueue.x-k8s.io/v1beta1
27+
kind: LocalQueue
28+
metadata:
29+
namespace: team-a
30+
name: team-a-queue
31+
spec:
32+
clusterQueue: cluster-queue
33+
----
34+
35+
. Apply the `LocalQueue` object by running the following command:
36+
+
37+
[source,terminal]
38+
----
39+
$ oc apply -f <filename>.yaml
40+
----
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * /configure/configuring-quotas.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="configuring-resourceflavors_{context}"]
7+
= Configuring a resource flavor
8+
9+
After you have configured a `ClusterQueue` object, you can configure a `ResourceFlavor` object.
10+
11+
Resources in a cluster are typically not homogeneous. If the resources in your cluster are homogeneous, you can use an empty `ResourceFlavor` instead of adding labels to custom resource flavors.
12+
13+
You can use a custom `ResourceFlavor` object to represent different resource variations that are associated with cluster nodes through labels, taints, and tolerations. You can then associate workloads with specific node types to enable fine-grained resource management.
14+
15+
.Prerequisites
16+
17+
include::snippets/prereqs-snippet.adoc[]
18+
19+
.Procedure
20+
21+
. Create a `ResourceFlavor` object as a YAML file:
22+
+
23+
.Example of an empty `ResourceFlavor` object
24+
[source,yaml]
25+
----
26+
apiVersion: kueue.x-k8s.io/v1beta1
27+
kind: ResourceFlavor
28+
metadata:
29+
name: default-flavor
30+
----
31+
+
32+
.Example of a custom `ResourceFlavor` object
33+
[source,yaml]
34+
----
35+
apiVersion: kueue.x-k8s.io/v1beta1
36+
kind: ResourceFlavor
37+
metadata:
38+
name: "x86"
39+
spec:
40+
nodeLabels:
41+
cpu-arch: x86
42+
----
43+
44+
. Apply the `ResourceFlavor` object by running the following command:
45+
+
46+
[source,terminal]
47+
----
48+
$ oc apply -f <filename>.yaml
49+
----

0 commit comments

Comments
 (0)