Skip to content

Commit 826acf4

Browse files
author
Michael Burke
committed
Nodes Jobs docs fixes during ROSA review
1 parent 8de72b9 commit 826acf4

6 files changed

+30
-18
lines changed

modules/nodes-nodes-jobs-about.adoc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,39 +15,39 @@ There are two possible resource types that allow creating run-once objects in {p
1515

1616
Job::
1717
A regular job is a run-once object that creates a task and ensures the job finishes.
18-
18+
+
1919
There are three main types of task suitable to run as a job:
20-
20+
+
2121
* Non-parallel jobs:
2222
** A job that starts only one pod, unless the pod fails.
2323
** The job is complete as soon as its pod terminates successfully.
24-
24+
+
2525
* Parallel jobs with a fixed completion count:
2626
** a job that starts multiple pods.
2727
** The job represents the overall task and is complete when there is one successful pod for each value in the range `1` to the `completions` value.
28-
28+
+
2929
* Parallel jobs with a work queue:
3030
** A job with multiple parallel worker processes in a given pod.
3131
** {product-title} coordinates pods to determine what each should work on or use an external queue service.
3232
** Each pod is independently capable of determining whether or not all peer pods are complete and that the entire job is done.
3333
** When any pod from the job terminates with success, no new pods are created.
3434
** When at least one pod has terminated with success and all pods are terminated, the job is successfully completed.
3535
** When any pod has exited with success, no other pod should be doing any work for this task or writing any output. Pods should all be in the process of exiting.
36-
36+
+
3737
For more information about how to make use of the different types of job, see link:https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#job-patterns[Job Patterns] in the Kubernetes documentation.
3838

3939
Cron job::
4040

4141
A job can be scheduled to run multiple times, using a cron job.
42-
42+
+
4343
A _cron job_ builds on a regular job by allowing you to specify
4444
how the job should be run. Cron jobs are part of the
4545
link:http://kubernetes.io/docs/user-guide/cron-jobs[Kubernetes] API, which
4646
can be managed with `oc` commands like other object types.
47-
47+
+
4848
Cron jobs are useful for creating periodic and recurring tasks, like running backups or sending emails.
4949
Cron jobs can also schedule individual tasks for a specific time, such as if you want to schedule a job for a low activity period. A cron job creates a `Job` object based on the timezone configured on the control plane node that runs the cronjob controller.
50-
50+
+
5151
[WARNING]
5252
====
5353
A cron job creates a `Job` object approximately once per execution time of its

modules/nodes-nodes-jobs-creating-cron.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ spec:
4040
image: perl
4141
command: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
4242
restartPolicy: OnFailure <10>
43+
#...
4344
----
4445
+
4546
<1> Schedule for the job specified in link:https://en.wikipedia.org/wiki/Cron[cron format]. In this example, the job will run every minute.

modules/nodes-nodes-jobs-creating.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ spec:
3434
image: perl
3535
command: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
3636
restartPolicy: OnFailure <6>
37+
#...
3738
----
3839
<1> Optional: Specify how many pod replicas a job should run in parallel; defaults to `1`.
3940
* For non-parallel jobs, leave unset. When unset, defaults to `1`.

modules/nodes-pods-daemonsets-creating.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ metadata:
3232
name: <namespace>
3333
annotations:
3434
openshift.io/node-selector: ''
35+
#...
3536
----
3637
====
3738
@@ -76,6 +77,7 @@ spec:
7677
terminationMessagePath: /dev/termination-log
7778
serviceAccount: default
7879
terminationGracePeriodSeconds: 10
80+
#...
7981
----
8082
<1> The label selector that determines which pods belong to the daemon set.
8183
<2> The pod template's label selector. Must match the label selector above.

nodes/jobs/nodes-nodes-jobs.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ spec:
3636
image: perl
3737
command: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
3838
restartPolicy: OnFailure <6>
39+
#...
3940
----
4041
<1> The pod replicas a job should run in parallel.
4142
<2> Successful pod completions are needed to mark a job completed.

nodes/jobs/nodes-pods-daemonsets.adoc

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,30 @@ the cluster.
2929

3030
== Scheduled by default scheduler
3131

32-
A daemon set ensures that all eligible nodes run a copy of a pod. Normally, the node that a pod runs on is selected by the Kubernetes scheduler. However, previously daemon set pods are created and scheduled by the daemon set controller. That introduces the following issues:
32+
A daemon set ensures that all eligible nodes run a copy of a pod. Normally, the node that a pod runs on is selected by the Kubernetes scheduler. However, daemon set pods are created and scheduled by the daemon set controller. That introduces the following issues:
3333

3434
* Inconsistent pod behavior: Normal pods waiting to be scheduled are created and in Pending state, but daemon set pods are not created in `Pending` state. This is confusing to the user.
3535
* Pod preemption is handled by default scheduler. When preemption is enabled, the daemon set controller will make scheduling decisions without considering pod priority and preemption.
3636

37-
The *ScheduleDaemonSetPods* feature, enabled by default in {product-title}, lets you to schedule daemon sets using the default scheduler instead of the daemon set controller, by adding the `NodeAffinity` term to the daemon set pods, instead of the `spec.nodeName` term. The default scheduler is then used to bind the pod to the target host. If node affinity of the daemon set pod already exists, it is replaced. The daemon set controller only performs these operations when creating or modifying daemon set pods, and no changes are made to the `spec.template` of the daemon set.
37+
The *ScheduleDaemonSetPods* feature, enabled by default in {product-title}, lets you schedule daemon sets using the default scheduler instead of the daemon set controller, by adding the `NodeAffinity` term to the daemon set pods, instead of the `spec.nodeName` term. The default scheduler is then used to bind the pod to the target host. If node affinity of the daemon set pod already exists, it is replaced. The daemon set controller only performs these operations when creating or modifying daemon set pods, and no changes are made to the `spec.template` of the daemon set.
3838

3939
[source,yaml]
4040
----
41-
nodeAffinity:
42-
requiredDuringSchedulingIgnoredDuringExecution:
43-
nodeSelectorTerms:
44-
- matchFields:
45-
- key: metadata.name
46-
operator: In
47-
values:
48-
- target-host-name
41+
kind: Pod
42+
apiVersion: v1
43+
metadata:
44+
name: hello-node-6fbccf8d9-9tmzr
45+
#...
46+
spec:
47+
nodeAffinity:
48+
requiredDuringSchedulingIgnoredDuringExecution:
49+
nodeSelectorTerms:
50+
- matchFields:
51+
- key: metadata.name
52+
operator: In
53+
values:
54+
- target-host-name
55+
#...
4956
----
5057

5158
In addition, a `node.kubernetes.io/unschedulable:NoSchedule` toleration is added automatically to daemon set pods. The default scheduler ignores unschedulable Nodes when scheduling daemon set pods.

0 commit comments

Comments
 (0)