Skip to content

Commit 6a6f56e

Browse files
committed
OSDOCS-13834: Namespace opt in docs
1 parent 9c3e7bf commit 6a6f56e

File tree

5 files changed

+84
-5
lines changed

5 files changed

+84
-5
lines changed

_topic_maps/_topic_map.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ Topics:
5757
File: using-cohorts
5858
- Name: Configuring fair sharing
5959
File: configuring-fairsharing
60+
- Name: Managing jobs and workloads
61+
File: managing-workloads
6062
---
6163
Name: Support
6264
Dir: support

configure/managing-workloads.adoc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
include::_attributes/common-attributes.adoc[]
3+
[id="managing-workloads"]
4+
= Managing jobs and workloads
5+
:context: managing-workloads
6+
7+
toc::[]
8+
9+
{product-title} does not directly manipulate jobs that are created by users. Instead, Kueue manages `Workload` objects that represent the resource requirements of a job. {product-title} automatically creates a workload for each job, and syncs any decisions and statuses between the two objects.
10+
11+
include::modules/configuring-labelpolicy.adoc[leveloffset=+1]

install/install-kueue.adoc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,15 @@ toc::[]
99
You can install {product-title} by using the {kueue-op} in OperatorHub.
1010

1111
include::modules/install-kueue-operator.adoc[leveloffset=+1]
12-
include::modules/create-kueue-cr.adoc[leveloffset=+1]
1312

1413
[role="_additional-resources"]
15-
[id="additional-resources_{context}"]
16-
== Additional resources
17-
14+
.Additional resources
1815
* link:https://docs.redhat.com/en/documentation/openshift_container_platform/latest/html/security_and_compliance/cert-manager-operator-for-red-hat-openshift#installing-the-cert-manager-operator-for-red-hat-openshift[Installing the cert-manager Operator for Red Hat OpenShift]
1916
17+
include::modules/create-kueue-cr.adoc[leveloffset=+1]
18+
include::modules/label-namespaces.adoc[leveloffset=+1]
19+
2020
[id="next-steps_{context}"]
2121
== Next steps
22-
2322
* Complete the procedures in xref:../authentication/rbac-permissions.adoc#configure-rbac-batch-admins_rbac-permissions[Configuring permissions for batch administrators] and xref:../authentication/rbac-permissions.adoc#configure-rbac-batch-users_rbac-permissions[Configuring permissions for users].
2423
* Complete the procedures in the xref:../configure/configuring-quotas.adoc#configuring-quotas[Configuring quotas] documentation.

modules/configuring-labelpolicy.adoc

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * configure/managing-workloads.adoc
4+
5+
:_mod-docs-content-type: REFERENCE
6+
[id="configuring-labelpolicy_{context}"]
7+
= Configuring label policies for jobs
8+
9+
The `spec.config.workloadManagement.labelPolicy` spec in the `Kueue` custom resource (CR) is an optional field that controls how {product-title} decides whether to manage or ignore different jobs. The allowed values are `QueueName`, `None` and empty (`""`).
10+
11+
If the `labelPolicy` setting is omitted or empty (`""`), the default policy is that {product-title} manages jobs that have a `kueue.x-k8s.io/queue-name` label, and ignores jobs that do not have the `kueue.x-k8s.io/queue-name` label. This is the same workflow as if the `labelPolicy` is set to `QueueName`.
12+
13+
If the `labelPolicy` setting is set to `None`, jobs are managed by {product-title} even if they do not have the `kueue.x-k8s.io/queue-name` label.
14+
15+
.Example `workloadManagement` spec configuration
16+
[source,yaml]
17+
----
18+
apiVersion: kueue.openshift.io/v1
19+
kind: Kueue
20+
metadata:
21+
labels:
22+
app.kubernetes.io/name: kueue-operator
23+
app.kubernetes.io/managed-by: kustomize
24+
name: cluster
25+
namespace: openshift-kueue-operator
26+
spec:
27+
config:
28+
workloadManagement:
29+
labelPolicy: QueueName
30+
# ...
31+
----
32+
33+
.Example user-created `Job` object containing the `kueue.x-k8s.io/queue-name` label
34+
[source,yaml]
35+
----
36+
apiVersion: batch/v1
37+
kind: Job
38+
metadata:
39+
generateName: sample-job-
40+
namespace: default
41+
labels:
42+
kueue.x-k8s.io/queue-name: user-queue
43+
spec:
44+
# ...
45+
----

modules/label-namespaces.adoc

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * install/install-kueue.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="label-namespaces_{context}"]
7+
= Labeling namespaces to allow {product-title} to manage jobs
8+
9+
The {product-title} Operator uses an opt-in webhook mechanism to ensure that policies are only enforced for the jobs and namespaces that it is expected to target.
10+
11+
You must label the namespaces where you want {product-title} to manage jobs with the `kueue.openshift.io/managed=true` label.
12+
13+
.Procedure
14+
15+
* Add the `kueue.openshift.io/managed=true` label to a namespace by running the following command:
16+
+
17+
[source,terminal]
18+
----
19+
$ oc label namespace <namespace> kueue.openshift.io/managed=true
20+
----
21+
22+
When you add this label, you instruct the {product-title} Operator that the namespace is managed by its webhook admission controllers. As a result, any {product-title} resources within that namespace are properly validated and mutated.

0 commit comments

Comments
 (0)