@@ -1006,6 +1006,50 @@ status:
1006
1006
terminating : 3 # three Pods are terminating and have not yet reached the Failed phase
1007
1007
` ` `
1008
1008
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
+
1009
1053
# # Alternatives
1010
1054
1011
1055
# ## Bare Pods
0 commit comments