Skip to content

Commit e5807eb

Browse files
committed
Add supporting context for job suspension
1 parent 550f3e5 commit e5807eb

File tree

1 file changed

+14
-2
lines changed
  • content/en/docs/concepts/workloads/controllers

1 file changed

+14
-2
lines changed

content/en/docs/concepts/workloads/controllers/job.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,8 +510,8 @@ When a Job is resumed from suspension, its `.status.startTime` field will be
510510
reset to the current time. This means that the `.spec.activeDeadlineSeconds`
511511
timer will be stopped and reset when a Job is suspended and resumed.
512512

513-
Remember that suspending a Job will delete all active Pods. When the Job is
514-
suspended, your [Pods will be terminated](/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination)
513+
Remember that suspending a Job will delete all Pods that are not Completed. When the Job is
514+
suspended, Non-Completed [Pods will be terminated](/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination)
515515
with a SIGTERM signal. The Pod's graceful termination period will be honored and
516516
your Pod must handle this signal in this period. This may involve saving
517517
progress for later or undoing changes. Pods terminated this way will not count
@@ -537,6 +537,18 @@ spec:
537537
...
538538
```
539539

540+
Alternatively, a job suspension can be toggled from the command line by patching the job resource. Suspend an active job:
541+
542+
```shell
543+
kubectl patch job/myjob -p '{"spec":{"suspend":true}}'
544+
```
545+
546+
Unsuspend an active job:
547+
548+
```shell
549+
kubectl patch job/myjob -p '{"spec":{"suspend":false}}'
550+
```
551+
540552
The Job's status can be used to determine if a Job is suspended or has been
541553
suspended in the past:
542554

0 commit comments

Comments
 (0)