generated.proto 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624
  1. /*
  2. Copyright The Kubernetes Authors.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. // This file was autogenerated by go-to-protobuf. Do not edit it manually!
  14. syntax = "proto2";
  15. package k8s.io.api.batch.v1;
  16. import "k8s.io/api/core/v1/generated.proto";
  17. import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
  18. import "k8s.io/apimachinery/pkg/runtime/generated.proto";
  19. import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
  20. // Package-wide variables from generator "generated".
  21. option go_package = "k8s.io/api/batch/v1";
  22. // CronJob represents the configuration of a single cron job.
  23. message CronJob {
  24. // Standard object's metadata.
  25. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  26. // +optional
  27. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  28. // Specification of the desired behavior of a cron job, including the schedule.
  29. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
  30. // +optional
  31. optional CronJobSpec spec = 2;
  32. // Current status of a cron job.
  33. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
  34. // +optional
  35. optional CronJobStatus status = 3;
  36. }
  37. // CronJobList is a collection of cron jobs.
  38. message CronJobList {
  39. // Standard list metadata.
  40. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  41. // +optional
  42. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
  43. // items is the list of CronJobs.
  44. repeated CronJob items = 2;
  45. }
  46. // CronJobSpec describes how the job execution will look like and when it will actually run.
  47. message CronJobSpec {
  48. // The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
  49. optional string schedule = 1;
  50. // The time zone name for the given schedule, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones.
  51. // If not specified, this will default to the time zone of the kube-controller-manager process.
  52. // The set of valid time zone names and the time zone offset is loaded from the system-wide time zone
  53. // database by the API server during CronJob validation and the controller manager during execution.
  54. // If no system-wide time zone database can be found a bundled version of the database is used instead.
  55. // If the time zone name becomes invalid during the lifetime of a CronJob or due to a change in host
  56. // configuration, the controller will stop creating new new Jobs and will create a system event with the
  57. // reason UnknownTimeZone.
  58. // More information can be found in https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#time-zones
  59. // +optional
  60. optional string timeZone = 8;
  61. // Optional deadline in seconds for starting the job if it misses scheduled
  62. // time for any reason. Missed jobs executions will be counted as failed ones.
  63. // +optional
  64. optional int64 startingDeadlineSeconds = 2;
  65. // Specifies how to treat concurrent executions of a Job.
  66. // Valid values are:
  67. //
  68. // - "Allow" (default): allows CronJobs to run concurrently;
  69. // - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet;
  70. // - "Replace": cancels currently running job and replaces it with a new one
  71. // +optional
  72. optional string concurrencyPolicy = 3;
  73. // This flag tells the controller to suspend subsequent executions, it does
  74. // not apply to already started executions. Defaults to false.
  75. // +optional
  76. optional bool suspend = 4;
  77. // Specifies the job that will be created when executing a CronJob.
  78. optional JobTemplateSpec jobTemplate = 5;
  79. // The number of successful finished jobs to retain. Value must be non-negative integer.
  80. // Defaults to 3.
  81. // +optional
  82. optional int32 successfulJobsHistoryLimit = 6;
  83. // The number of failed finished jobs to retain. Value must be non-negative integer.
  84. // Defaults to 1.
  85. // +optional
  86. optional int32 failedJobsHistoryLimit = 7;
  87. }
  88. // CronJobStatus represents the current state of a cron job.
  89. message CronJobStatus {
  90. // A list of pointers to currently running jobs.
  91. // +optional
  92. // +listType=atomic
  93. repeated .k8s.io.api.core.v1.ObjectReference active = 1;
  94. // Information when was the last time the job was successfully scheduled.
  95. // +optional
  96. optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4;
  97. // Information when was the last time the job successfully completed.
  98. // +optional
  99. optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastSuccessfulTime = 5;
  100. }
  101. // Job represents the configuration of a single job.
  102. message Job {
  103. // Standard object's metadata.
  104. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  105. // +optional
  106. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  107. // Specification of the desired behavior of a job.
  108. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
  109. // +optional
  110. optional JobSpec spec = 2;
  111. // Current status of a job.
  112. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
  113. // +optional
  114. optional JobStatus status = 3;
  115. }
  116. // JobCondition describes current state of a job.
  117. message JobCondition {
  118. // Type of job condition, Complete or Failed.
  119. optional string type = 1;
  120. // Status of the condition, one of True, False, Unknown.
  121. optional string status = 2;
  122. // Last time the condition was checked.
  123. // +optional
  124. optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastProbeTime = 3;
  125. // Last time the condition transit from one status to another.
  126. // +optional
  127. optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 4;
  128. // (brief) reason for the condition's last transition.
  129. // +optional
  130. optional string reason = 5;
  131. // Human readable message indicating details about last transition.
  132. // +optional
  133. optional string message = 6;
  134. }
  135. // JobList is a collection of jobs.
  136. message JobList {
  137. // Standard list metadata.
  138. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  139. // +optional
  140. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
  141. // items is the list of Jobs.
  142. repeated Job items = 2;
  143. }
  144. // JobSpec describes how the job execution will look like.
  145. message JobSpec {
  146. // Specifies the maximum desired number of pods the job should
  147. // run at any given time. The actual number of pods running in steady state will
  148. // be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism),
  149. // i.e. when the work left to do is less than max parallelism.
  150. // More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/
  151. // +optional
  152. optional int32 parallelism = 1;
  153. // Specifies the desired number of successfully finished pods the
  154. // job should be run with. Setting to null means that the success of any
  155. // pod signals the success of all pods, and allows parallelism to have any positive
  156. // value. Setting to 1 means that parallelism is limited to 1 and the success of that
  157. // pod signals the success of the job.
  158. // More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/
  159. // +optional
  160. optional int32 completions = 2;
  161. // Specifies the duration in seconds relative to the startTime that the job
  162. // may be continuously active before the system tries to terminate it; value
  163. // must be positive integer. If a Job is suspended (at creation or through an
  164. // update), this timer will effectively be stopped and reset when the Job is
  165. // resumed again.
  166. // +optional
  167. optional int64 activeDeadlineSeconds = 3;
  168. // Specifies the policy of handling failed pods. In particular, it allows to
  169. // specify the set of actions and conditions which need to be
  170. // satisfied to take the associated action.
  171. // If empty, the default behaviour applies - the counter of failed pods,
  172. // represented by the jobs's .status.failed field, is incremented and it is
  173. // checked against the backoffLimit. This field cannot be used in combination
  174. // with restartPolicy=OnFailure.
  175. //
  176. // +optional
  177. optional PodFailurePolicy podFailurePolicy = 11;
  178. // successPolicy specifies the policy when the Job can be declared as succeeded.
  179. // If empty, the default behavior applies - the Job is declared as succeeded
  180. // only when the number of succeeded pods equals to the completions.
  181. // When the field is specified, it must be immutable and works only for the Indexed Jobs.
  182. // Once the Job meets the SuccessPolicy, the lingering pods are terminated.
  183. //
  184. // +optional
  185. optional SuccessPolicy successPolicy = 16;
  186. // Specifies the number of retries before marking this job failed.
  187. // Defaults to 6, unless backoffLimitPerIndex (only Indexed Job) is specified.
  188. // When backoffLimitPerIndex is specified, backoffLimit defaults to 2147483647.
  189. // +optional
  190. optional int32 backoffLimit = 7;
  191. // Specifies the limit for the number of retries within an
  192. // index before marking this index as failed. When enabled the number of
  193. // failures per index is kept in the pod's
  194. // batch.kubernetes.io/job-index-failure-count annotation. It can only
  195. // be set when Job's completionMode=Indexed, and the Pod's restart
  196. // policy is Never. The field is immutable.
  197. // +optional
  198. optional int32 backoffLimitPerIndex = 12;
  199. // Specifies the maximal number of failed indexes before marking the Job as
  200. // failed, when backoffLimitPerIndex is set. Once the number of failed
  201. // indexes exceeds this number the entire Job is marked as Failed and its
  202. // execution is terminated. When left as null the job continues execution of
  203. // all of its indexes and is marked with the `Complete` Job condition.
  204. // It can only be specified when backoffLimitPerIndex is set.
  205. // It can be null or up to completions. It is required and must be
  206. // less than or equal to 10^4 when is completions greater than 10^5.
  207. // +optional
  208. optional int32 maxFailedIndexes = 13;
  209. // A label query over pods that should match the pod count.
  210. // Normally, the system sets this field for you.
  211. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
  212. // +optional
  213. optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4;
  214. // manualSelector controls generation of pod labels and pod selectors.
  215. // Leave `manualSelector` unset unless you are certain what you are doing.
  216. // When false or unset, the system pick labels unique to this job
  217. // and appends those labels to the pod template. When true,
  218. // the user is responsible for picking unique labels and specifying
  219. // the selector. Failure to pick a unique label may cause this
  220. // and other jobs to not function correctly. However, You may see
  221. // `manualSelector=true` in jobs that were created with the old `extensions/v1beta1`
  222. // API.
  223. // More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#specifying-your-own-pod-selector
  224. // +optional
  225. optional bool manualSelector = 5;
  226. // Describes the pod that will be created when executing a job.
  227. // The only allowed template.spec.restartPolicy values are "Never" or "OnFailure".
  228. // More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/
  229. optional .k8s.io.api.core.v1.PodTemplateSpec template = 6;
  230. // ttlSecondsAfterFinished limits the lifetime of a Job that has finished
  231. // execution (either Complete or Failed). If this field is set,
  232. // ttlSecondsAfterFinished after the Job finishes, it is eligible to be
  233. // automatically deleted. When the Job is being deleted, its lifecycle
  234. // guarantees (e.g. finalizers) will be honored. If this field is unset,
  235. // the Job won't be automatically deleted. If this field is set to zero,
  236. // the Job becomes eligible to be deleted immediately after it finishes.
  237. // +optional
  238. optional int32 ttlSecondsAfterFinished = 8;
  239. // completionMode specifies how Pod completions are tracked. It can be
  240. // `NonIndexed` (default) or `Indexed`.
  241. //
  242. // `NonIndexed` means that the Job is considered complete when there have
  243. // been .spec.completions successfully completed Pods. Each Pod completion is
  244. // homologous to each other.
  245. //
  246. // `Indexed` means that the Pods of a
  247. // Job get an associated completion index from 0 to (.spec.completions - 1),
  248. // available in the annotation batch.kubernetes.io/job-completion-index.
  249. // The Job is considered complete when there is one successfully completed Pod
  250. // for each index.
  251. // When value is `Indexed`, .spec.completions must be specified and
  252. // `.spec.parallelism` must be less than or equal to 10^5.
  253. // In addition, The Pod name takes the form
  254. // `$(job-name)-$(index)-$(random-string)`,
  255. // the Pod hostname takes the form `$(job-name)-$(index)`.
  256. //
  257. // More completion modes can be added in the future.
  258. // If the Job controller observes a mode that it doesn't recognize, which
  259. // is possible during upgrades due to version skew, the controller
  260. // skips updates for the Job.
  261. // +optional
  262. optional string completionMode = 9;
  263. // suspend specifies whether the Job controller should create Pods or not. If
  264. // a Job is created with suspend set to true, no Pods are created by the Job
  265. // controller. If a Job is suspended after creation (i.e. the flag goes from
  266. // false to true), the Job controller will delete all active Pods associated
  267. // with this Job. Users must design their workload to gracefully handle this.
  268. // Suspending a Job will reset the StartTime field of the Job, effectively
  269. // resetting the ActiveDeadlineSeconds timer too. Defaults to false.
  270. //
  271. // +optional
  272. optional bool suspend = 10;
  273. // podReplacementPolicy specifies when to create replacement Pods.
  274. // Possible values are:
  275. // - TerminatingOrFailed means that we recreate pods
  276. // when they are terminating (has a metadata.deletionTimestamp) or failed.
  277. // - Failed means to wait until a previously created Pod is fully terminated (has phase
  278. // Failed or Succeeded) before creating a replacement Pod.
  279. //
  280. // When using podFailurePolicy, Failed is the the only allowed value.
  281. // TerminatingOrFailed and Failed are allowed values when podFailurePolicy is not in use.
  282. // +optional
  283. optional string podReplacementPolicy = 14;
  284. // ManagedBy field indicates the controller that manages a Job. The k8s Job
  285. // controller reconciles jobs which don't have this field at all or the field
  286. // value is the reserved string `kubernetes.io/job-controller`, but skips
  287. // reconciling Jobs with a custom value for this field.
  288. // The value must be a valid domain-prefixed path (e.g. acme.io/foo) -
  289. // all characters before the first "/" must be a valid subdomain as defined
  290. // by RFC 1123. All characters trailing the first "/" must be valid HTTP Path
  291. // characters as defined by RFC 3986. The value cannot exceed 63 characters.
  292. // This field is immutable.
  293. // +optional
  294. optional string managedBy = 15;
  295. }
  296. // JobStatus represents the current state of a Job.
  297. message JobStatus {
  298. // The latest available observations of an object's current state. When a Job
  299. // fails, one of the conditions will have type "Failed" and status true. When
  300. // a Job is suspended, one of the conditions will have type "Suspended" and
  301. // status true; when the Job is resumed, the status of this condition will
  302. // become false. When a Job is completed, one of the conditions will have
  303. // type "Complete" and status true.
  304. //
  305. // A job is considered finished when it is in a terminal condition, either
  306. // "Complete" or "Failed". A Job cannot have both the "Complete" and "Failed" conditions.
  307. // Additionally, it cannot be in the "Complete" and "FailureTarget" conditions.
  308. // The "Complete", "Failed" and "FailureTarget" conditions cannot be disabled.
  309. //
  310. // More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/
  311. // +optional
  312. // +patchMergeKey=type
  313. // +patchStrategy=merge
  314. // +listType=atomic
  315. repeated JobCondition conditions = 1;
  316. // Represents time when the job controller started processing a job. When a
  317. // Job is created in the suspended state, this field is not set until the
  318. // first time it is resumed. This field is reset every time a Job is resumed
  319. // from suspension. It is represented in RFC3339 form and is in UTC.
  320. //
  321. // Once set, the field can only be removed when the job is suspended.
  322. // The field cannot be modified while the job is unsuspended or finished.
  323. //
  324. // +optional
  325. optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time startTime = 2;
  326. // Represents time when the job was completed. It is not guaranteed to
  327. // be set in happens-before order across separate operations.
  328. // It is represented in RFC3339 form and is in UTC.
  329. // The completion time is set when the job finishes successfully, and only then.
  330. // The value cannot be updated or removed. The value indicates the same or
  331. // later point in time as the startTime field.
  332. // +optional
  333. optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time completionTime = 3;
  334. // The number of pending and running pods which are not terminating (without
  335. // a deletionTimestamp).
  336. // The value is zero for finished jobs.
  337. // +optional
  338. optional int32 active = 4;
  339. // The number of pods which reached phase Succeeded.
  340. // The value increases monotonically for a given spec. However, it may
  341. // decrease in reaction to scale down of elastic indexed jobs.
  342. // +optional
  343. optional int32 succeeded = 5;
  344. // The number of pods which reached phase Failed.
  345. // The value increases monotonically.
  346. // +optional
  347. optional int32 failed = 6;
  348. // The number of pods which are terminating (in phase Pending or Running
  349. // and have a deletionTimestamp).
  350. //
  351. // This field is beta-level. The job controller populates the field when
  352. // the feature gate JobPodReplacementPolicy is enabled (enabled by default).
  353. // +optional
  354. optional int32 terminating = 11;
  355. // completedIndexes holds the completed indexes when .spec.completionMode =
  356. // "Indexed" in a text format. The indexes are represented as decimal integers
  357. // separated by commas. The numbers are listed in increasing order. Three or
  358. // more consecutive numbers are compressed and represented by the first and
  359. // last element of the series, separated by a hyphen.
  360. // For example, if the completed indexes are 1, 3, 4, 5 and 7, they are
  361. // represented as "1,3-5,7".
  362. // +optional
  363. optional string completedIndexes = 7;
  364. // FailedIndexes holds the failed indexes when spec.backoffLimitPerIndex is set.
  365. // The indexes are represented in the text format analogous as for the
  366. // `completedIndexes` field, ie. they are kept as decimal integers
  367. // separated by commas. The numbers are listed in increasing order. Three or
  368. // more consecutive numbers are compressed and represented by the first and
  369. // last element of the series, separated by a hyphen.
  370. // For example, if the failed indexes are 1, 3, 4, 5 and 7, they are
  371. // represented as "1,3-5,7".
  372. // The set of failed indexes cannot overlap with the set of completed indexes.
  373. //
  374. // +optional
  375. optional string failedIndexes = 10;
  376. // uncountedTerminatedPods holds the UIDs of Pods that have terminated but
  377. // the job controller hasn't yet accounted for in the status counters.
  378. //
  379. // The job controller creates pods with a finalizer. When a pod terminates
  380. // (succeeded or failed), the controller does three steps to account for it
  381. // in the job status:
  382. //
  383. // 1. Add the pod UID to the arrays in this field.
  384. // 2. Remove the pod finalizer.
  385. // 3. Remove the pod UID from the arrays while increasing the corresponding
  386. // counter.
  387. //
  388. // Old jobs might not be tracked using this field, in which case the field
  389. // remains null.
  390. // The structure is empty for finished jobs.
  391. // +optional
  392. optional UncountedTerminatedPods uncountedTerminatedPods = 8;
  393. // The number of active pods which have a Ready condition and are not
  394. // terminating (without a deletionTimestamp).
  395. optional int32 ready = 9;
  396. }
  397. // JobTemplateSpec describes the data a Job should have when created from a template
  398. message JobTemplateSpec {
  399. // Standard object's metadata of the jobs created from this template.
  400. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  401. // +optional
  402. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  403. // Specification of the desired behavior of the job.
  404. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
  405. // +optional
  406. optional JobSpec spec = 2;
  407. }
  408. // PodFailurePolicy describes how failed pods influence the backoffLimit.
  409. message PodFailurePolicy {
  410. // A list of pod failure policy rules. The rules are evaluated in order.
  411. // Once a rule matches a Pod failure, the remaining of the rules are ignored.
  412. // When no rule matches the Pod failure, the default handling applies - the
  413. // counter of pod failures is incremented and it is checked against
  414. // the backoffLimit. At most 20 elements are allowed.
  415. // +listType=atomic
  416. repeated PodFailurePolicyRule rules = 1;
  417. }
  418. // PodFailurePolicyOnExitCodesRequirement describes the requirement for handling
  419. // a failed pod based on its container exit codes. In particular, it lookups the
  420. // .state.terminated.exitCode for each app container and init container status,
  421. // represented by the .status.containerStatuses and .status.initContainerStatuses
  422. // fields in the Pod status, respectively. Containers completed with success
  423. // (exit code 0) are excluded from the requirement check.
  424. message PodFailurePolicyOnExitCodesRequirement {
  425. // Restricts the check for exit codes to the container with the
  426. // specified name. When null, the rule applies to all containers.
  427. // When specified, it should match one the container or initContainer
  428. // names in the pod template.
  429. // +optional
  430. optional string containerName = 1;
  431. // Represents the relationship between the container exit code(s) and the
  432. // specified values. Containers completed with success (exit code 0) are
  433. // excluded from the requirement check. Possible values are:
  434. //
  435. // - In: the requirement is satisfied if at least one container exit code
  436. // (might be multiple if there are multiple containers not restricted
  437. // by the 'containerName' field) is in the set of specified values.
  438. // - NotIn: the requirement is satisfied if at least one container exit code
  439. // (might be multiple if there are multiple containers not restricted
  440. // by the 'containerName' field) is not in the set of specified values.
  441. // Additional values are considered to be added in the future. Clients should
  442. // react to an unknown operator by assuming the requirement is not satisfied.
  443. optional string operator = 2;
  444. // Specifies the set of values. Each returned container exit code (might be
  445. // multiple in case of multiple containers) is checked against this set of
  446. // values with respect to the operator. The list of values must be ordered
  447. // and must not contain duplicates. Value '0' cannot be used for the In operator.
  448. // At least one element is required. At most 255 elements are allowed.
  449. // +listType=set
  450. repeated int32 values = 3;
  451. }
  452. // PodFailurePolicyOnPodConditionsPattern describes a pattern for matching
  453. // an actual pod condition type.
  454. message PodFailurePolicyOnPodConditionsPattern {
  455. // Specifies the required Pod condition type. To match a pod condition
  456. // it is required that specified type equals the pod condition type.
  457. optional string type = 1;
  458. // Specifies the required Pod condition status. To match a pod condition
  459. // it is required that the specified status equals the pod condition status.
  460. // Defaults to True.
  461. // +optional
  462. optional string status = 2;
  463. }
  464. // PodFailurePolicyRule describes how a pod failure is handled when the requirements are met.
  465. // One of onExitCodes and onPodConditions, but not both, can be used in each rule.
  466. message PodFailurePolicyRule {
  467. // Specifies the action taken on a pod failure when the requirements are satisfied.
  468. // Possible values are:
  469. //
  470. // - FailJob: indicates that the pod's job is marked as Failed and all
  471. // running pods are terminated.
  472. // - FailIndex: indicates that the pod's index is marked as Failed and will
  473. // not be restarted.
  474. // - Ignore: indicates that the counter towards the .backoffLimit is not
  475. // incremented and a replacement pod is created.
  476. // - Count: indicates that the pod is handled in the default way - the
  477. // counter towards the .backoffLimit is incremented.
  478. // Additional values are considered to be added in the future. Clients should
  479. // react to an unknown action by skipping the rule.
  480. optional string action = 1;
  481. // Represents the requirement on the container exit codes.
  482. // +optional
  483. optional PodFailurePolicyOnExitCodesRequirement onExitCodes = 2;
  484. // Represents the requirement on the pod conditions. The requirement is represented
  485. // as a list of pod condition patterns. The requirement is satisfied if at
  486. // least one pattern matches an actual pod condition. At most 20 elements are allowed.
  487. // +listType=atomic
  488. // +optional
  489. repeated PodFailurePolicyOnPodConditionsPattern onPodConditions = 3;
  490. }
  491. // SuccessPolicy describes when a Job can be declared as succeeded based on the success of some indexes.
  492. message SuccessPolicy {
  493. // rules represents the list of alternative rules for the declaring the Jobs
  494. // as successful before `.status.succeeded >= .spec.completions`. Once any of the rules are met,
  495. // the "SuccessCriteriaMet" condition is added, and the lingering pods are removed.
  496. // The terminal state for such a Job has the "Complete" condition.
  497. // Additionally, these rules are evaluated in order; Once the Job meets one of the rules,
  498. // other rules are ignored. At most 20 elements are allowed.
  499. // +listType=atomic
  500. repeated SuccessPolicyRule rules = 1;
  501. }
  502. // SuccessPolicyRule describes rule for declaring a Job as succeeded.
  503. // Each rule must have at least one of the "succeededIndexes" or "succeededCount" specified.
  504. message SuccessPolicyRule {
  505. // succeededIndexes specifies the set of indexes
  506. // which need to be contained in the actual set of the succeeded indexes for the Job.
  507. // The list of indexes must be within 0 to ".spec.completions-1" and
  508. // must not contain duplicates. At least one element is required.
  509. // The indexes are represented as intervals separated by commas.
  510. // The intervals can be a decimal integer or a pair of decimal integers separated by a hyphen.
  511. // The number are listed in represented by the first and last element of the series,
  512. // separated by a hyphen.
  513. // For example, if the completed indexes are 1, 3, 4, 5 and 7, they are
  514. // represented as "1,3-5,7".
  515. // When this field is null, this field doesn't default to any value
  516. // and is never evaluated at any time.
  517. //
  518. // +optional
  519. optional string succeededIndexes = 1;
  520. // succeededCount specifies the minimal required size of the actual set of the succeeded indexes
  521. // for the Job. When succeededCount is used along with succeededIndexes, the check is
  522. // constrained only to the set of indexes specified by succeededIndexes.
  523. // For example, given that succeededIndexes is "1-4", succeededCount is "3",
  524. // and completed indexes are "1", "3", and "5", the Job isn't declared as succeeded
  525. // because only "1" and "3" indexes are considered in that rules.
  526. // When this field is null, this doesn't default to any value and
  527. // is never evaluated at any time.
  528. // When specified it needs to be a positive integer.
  529. //
  530. // +optional
  531. optional int32 succeededCount = 2;
  532. }
  533. // UncountedTerminatedPods holds UIDs of Pods that have terminated but haven't
  534. // been accounted in Job status counters.
  535. message UncountedTerminatedPods {
  536. // succeeded holds UIDs of succeeded Pods.
  537. // +listType=set
  538. // +optional
  539. repeated string succeeded = 1;
  540. // failed holds UIDs of failed Pods.
  541. // +listType=set
  542. // +optional
  543. repeated string failed = 2;
  544. }