Skip to content

Commit d0de94b

Browse files
authored
Merge pull request #35516 from spurin/job_suspension_context
Added supporting context for job suspension functionality
2 parents eb7b3c4 + 733e25d commit d0de94b

File tree

1 file changed

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

1 file changed

+15
-2
lines changed

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

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,8 +510,7 @@ 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+
When you suspend a Job, any running Pods that don't have a status of `Completed` will be [terminated](/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination).
515514
with a SIGTERM signal. The Pod's graceful termination period will be honored and
516515
your Pod must handle this signal in this period. This may involve saving
517516
progress for later or undoing changes. Pods terminated this way will not count
@@ -537,6 +536,20 @@ spec:
537536
...
538537
```
539538

539+
You can also toggle Job suspension by patching the Job using the command line.
540+
541+
Suspend an active Job:
542+
543+
```shell
544+
kubectl patch job/myjob --type=strategic --patch '{"spec":{"suspend":true}}'
545+
```
546+
547+
Resume a suspended Job:
548+
549+
```shell
550+
kubectl patch job/myjob --type=strategic --patch '{"spec":{"suspend":false}}'
551+
```
552+
540553
The Job's status can be used to determine if a Job is suspended or has been
541554
suspended in the past:
542555

0 commit comments

Comments
 (0)