Skip to content

Commit 7275d2c

Browse files
authored
Merge pull request #45132 from mimowo/job-managed-by-docs
Add docs for Job managedBy field (alpha)
2 parents c268f09 + 6b1afc2 commit 7275d2c

File tree

2 files changed

+58
-0
lines changed
  • content/en/docs

2 files changed

+58
-0
lines changed

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

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,6 +1006,50 @@ status:
10061006
terminating: 3 # three Pods are terminating and have not yet reached the Failed phase
10071007
```
10081008
1009+
### Delegation of managing a Job object to external controller
1010+
1011+
{{< feature-state for_k8s_version="v1.30" state="alpha" >}}
1012+
1013+
{{< note >}}
1014+
You can only set the `managedBy` field on Jobs if you enable the `JobManagedBy`
1015+
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
1016+
(disabled by default).
1017+
{{< /note >}}
1018+
1019+
This feature allows you to disable the built-in Job controller, for a specific
1020+
Job, and delegate reconciliation of the Job to an external controller.
1021+
1022+
You indicate the controller that reconciles the Job by setting a custom value
1023+
for the `spec.managedBy` field - any value
1024+
other than `kubernetes.io/job-controller`. The value of the field is immutable.
1025+
1026+
{{< note >}}
1027+
When using this feature, make sure the controller indicated by the field is
1028+
installed, otherwise the Job may not be reconciled at all.
1029+
{{< /note >}}
1030+
1031+
{{< note >}}
1032+
When developing an external Job controller be aware that your controller needs
1033+
to operate in a fashion conformant with the definitions of the API spec and
1034+
status fields of the Job object.
1035+
1036+
Please review these in detail the [Job API](/docs/reference/kubernetes-api/workload-resources/job-v1/).
1037+
We also recommend you running the e2e conformance tests for the Job object to
1038+
verify your implementation.
1039+
1040+
Finally, when developing an external Job controller make sure it does not use the
1041+
`batch.kubernetes.io/job-tracking` finalizer, reserved for the built-in controller.
1042+
{{< /note >}}
1043+
1044+
{{< warning >}}
1045+
If you are considering to disable the `JobManagedBy` feature gate, or to
1046+
downgrade the cluster to a version without the feature gate enabled, check if
1047+
there are jobs with a custom value of the `spec.managedBy` field. If there
1048+
are such jobs, there is a risk that they might be reconciled by two controllers
1049+
after the operation: the built-in Job controller and the external controller
1050+
indicated by the field value.
1051+
{{< /warning >}}
1052+
10091053
## Alternatives
10101054

10111055
### Bare Pods
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: JobManagedBy
3+
content_type: feature_gate
4+
5+
_build:
6+
list: never
7+
render: false
8+
9+
stages:
10+
- stage: alpha
11+
defaultValue: false
12+
fromVersion: "1.30"
13+
---
14+
Allows to delegate reconciliation of a Job object to an external controller.

0 commit comments

Comments
 (0)