generated.proto 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483
  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. // This is beta field and must be enabled via the `CronJobTimeZone` feature gate.
  60. // +optional
  61. optional string timeZone = 8;
  62. // Optional deadline in seconds for starting the job if it misses scheduled
  63. // time for any reason. Missed jobs executions will be counted as failed ones.
  64. // +optional
  65. optional int64 startingDeadlineSeconds = 2;
  66. // Specifies how to treat concurrent executions of a Job.
  67. // Valid values are:
  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 nil 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. // This field is alpha-level. To use this field, you must enable the
  177. // `JobPodFailurePolicy` feature gate (disabled by default).
  178. // +optional
  179. optional PodFailurePolicy podFailurePolicy = 11;
  180. // Specifies the number of retries before marking this job failed.
  181. // Defaults to 6
  182. // +optional
  183. optional int32 backoffLimit = 7;
  184. // A label query over pods that should match the pod count.
  185. // Normally, the system sets this field for you.
  186. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
  187. // +optional
  188. optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4;
  189. // manualSelector controls generation of pod labels and pod selectors.
  190. // Leave `manualSelector` unset unless you are certain what you are doing.
  191. // When false or unset, the system pick labels unique to this job
  192. // and appends those labels to the pod template. When true,
  193. // the user is responsible for picking unique labels and specifying
  194. // the selector. Failure to pick a unique label may cause this
  195. // and other jobs to not function correctly. However, You may see
  196. // `manualSelector=true` in jobs that were created with the old `extensions/v1beta1`
  197. // API.
  198. // More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#specifying-your-own-pod-selector
  199. // +optional
  200. optional bool manualSelector = 5;
  201. // Describes the pod that will be created when executing a job.
  202. // More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/
  203. optional k8s.io.api.core.v1.PodTemplateSpec template = 6;
  204. // ttlSecondsAfterFinished limits the lifetime of a Job that has finished
  205. // execution (either Complete or Failed). If this field is set,
  206. // ttlSecondsAfterFinished after the Job finishes, it is eligible to be
  207. // automatically deleted. When the Job is being deleted, its lifecycle
  208. // guarantees (e.g. finalizers) will be honored. If this field is unset,
  209. // the Job won't be automatically deleted. If this field is set to zero,
  210. // the Job becomes eligible to be deleted immediately after it finishes.
  211. // +optional
  212. optional int32 ttlSecondsAfterFinished = 8;
  213. // CompletionMode specifies how Pod completions are tracked. It can be
  214. // `NonIndexed` (default) or `Indexed`.
  215. //
  216. // `NonIndexed` means that the Job is considered complete when there have
  217. // been .spec.completions successfully completed Pods. Each Pod completion is
  218. // homologous to each other.
  219. //
  220. // `Indexed` means that the Pods of a
  221. // Job get an associated completion index from 0 to (.spec.completions - 1),
  222. // available in the annotation batch.kubernetes.io/job-completion-index.
  223. // The Job is considered complete when there is one successfully completed Pod
  224. // for each index.
  225. // When value is `Indexed`, .spec.completions must be specified and
  226. // `.spec.parallelism` must be less than or equal to 10^5.
  227. // In addition, The Pod name takes the form
  228. // `$(job-name)-$(index)-$(random-string)`,
  229. // the Pod hostname takes the form `$(job-name)-$(index)`.
  230. //
  231. // More completion modes can be added in the future.
  232. // If the Job controller observes a mode that it doesn't recognize, which
  233. // is possible during upgrades due to version skew, the controller
  234. // skips updates for the Job.
  235. // +optional
  236. optional string completionMode = 9;
  237. // Suspend specifies whether the Job controller should create Pods or not. If
  238. // a Job is created with suspend set to true, no Pods are created by the Job
  239. // controller. If a Job is suspended after creation (i.e. the flag goes from
  240. // false to true), the Job controller will delete all active Pods associated
  241. // with this Job. Users must design their workload to gracefully handle this.
  242. // Suspending a Job will reset the StartTime field of the Job, effectively
  243. // resetting the ActiveDeadlineSeconds timer too. Defaults to false.
  244. //
  245. // +optional
  246. optional bool suspend = 10;
  247. }
  248. // JobStatus represents the current state of a Job.
  249. message JobStatus {
  250. // The latest available observations of an object's current state. When a Job
  251. // fails, one of the conditions will have type "Failed" and status true. When
  252. // a Job is suspended, one of the conditions will have type "Suspended" and
  253. // status true; when the Job is resumed, the status of this condition will
  254. // become false. When a Job is completed, one of the conditions will have
  255. // type "Complete" and status true.
  256. // More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/
  257. // +optional
  258. // +patchMergeKey=type
  259. // +patchStrategy=merge
  260. // +listType=atomic
  261. repeated JobCondition conditions = 1;
  262. // Represents time when the job controller started processing a job. When a
  263. // Job is created in the suspended state, this field is not set until the
  264. // first time it is resumed. This field is reset every time a Job is resumed
  265. // from suspension. It is represented in RFC3339 form and is in UTC.
  266. // +optional
  267. optional k8s.io.apimachinery.pkg.apis.meta.v1.Time startTime = 2;
  268. // Represents time when the job was completed. It is not guaranteed to
  269. // be set in happens-before order across separate operations.
  270. // It is represented in RFC3339 form and is in UTC.
  271. // The completion time is only set when the job finishes successfully.
  272. // +optional
  273. optional k8s.io.apimachinery.pkg.apis.meta.v1.Time completionTime = 3;
  274. // The number of pending and running pods.
  275. // +optional
  276. optional int32 active = 4;
  277. // The number of pods which reached phase Succeeded.
  278. // +optional
  279. optional int32 succeeded = 5;
  280. // The number of pods which reached phase Failed.
  281. // +optional
  282. optional int32 failed = 6;
  283. // CompletedIndexes holds the completed indexes when .spec.completionMode =
  284. // "Indexed" in a text format. The indexes are represented as decimal integers
  285. // separated by commas. The numbers are listed in increasing order. Three or
  286. // more consecutive numbers are compressed and represented by the first and
  287. // last element of the series, separated by a hyphen.
  288. // For example, if the completed indexes are 1, 3, 4, 5 and 7, they are
  289. // represented as "1,3-5,7".
  290. // +optional
  291. optional string completedIndexes = 7;
  292. // UncountedTerminatedPods holds the UIDs of Pods that have terminated but
  293. // the job controller hasn't yet accounted for in the status counters.
  294. //
  295. // The job controller creates pods with a finalizer. When a pod terminates
  296. // (succeeded or failed), the controller does three steps to account for it
  297. // in the job status:
  298. // (1) Add the pod UID to the arrays in this field.
  299. // (2) Remove the pod finalizer.
  300. // (3) Remove the pod UID from the arrays while increasing the corresponding
  301. // counter.
  302. //
  303. // Old jobs might not be tracked using this field, in which case the field
  304. // remains null.
  305. // +optional
  306. optional UncountedTerminatedPods uncountedTerminatedPods = 8;
  307. // The number of pods which have a Ready condition.
  308. //
  309. // This field is beta-level. The job controller populates the field when
  310. // the feature gate JobReadyPods is enabled (enabled by default).
  311. // +optional
  312. optional int32 ready = 9;
  313. }
  314. // JobTemplateSpec describes the data a Job should have when created from a template
  315. message JobTemplateSpec {
  316. // Standard object's metadata of the jobs created from this template.
  317. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  318. // +optional
  319. optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  320. // Specification of the desired behavior of the job.
  321. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
  322. // +optional
  323. optional JobSpec spec = 2;
  324. }
  325. // PodFailurePolicy describes how failed pods influence the backoffLimit.
  326. message PodFailurePolicy {
  327. // A list of pod failure policy rules. The rules are evaluated in order.
  328. // Once a rule matches a Pod failure, the remaining of the rules are ignored.
  329. // When no rule matches the Pod failure, the default handling applies - the
  330. // counter of pod failures is incremented and it is checked against
  331. // the backoffLimit. At most 20 elements are allowed.
  332. // +listType=atomic
  333. repeated PodFailurePolicyRule rules = 1;
  334. }
  335. // PodFailurePolicyOnExitCodesRequirement describes the requirement for handling
  336. // a failed pod based on its container exit codes. In particular, it lookups the
  337. // .state.terminated.exitCode for each app container and init container status,
  338. // represented by the .status.containerStatuses and .status.initContainerStatuses
  339. // fields in the Pod status, respectively. Containers completed with success
  340. // (exit code 0) are excluded from the requirement check.
  341. message PodFailurePolicyOnExitCodesRequirement {
  342. // Restricts the check for exit codes to the container with the
  343. // specified name. When null, the rule applies to all containers.
  344. // When specified, it should match one the container or initContainer
  345. // names in the pod template.
  346. // +optional
  347. optional string containerName = 1;
  348. // Represents the relationship between the container exit code(s) and the
  349. // specified values. Containers completed with success (exit code 0) are
  350. // excluded from the requirement check. Possible values are:
  351. // - In: the requirement is satisfied if at least one container exit code
  352. // (might be multiple if there are multiple containers not restricted
  353. // by the 'containerName' field) is in the set of specified values.
  354. // - NotIn: the requirement is satisfied if at least one container exit code
  355. // (might be multiple if there are multiple containers not restricted
  356. // by the 'containerName' field) is not in the set of specified values.
  357. // Additional values are considered to be added in the future. Clients should
  358. // react to an unknown operator by assuming the requirement is not satisfied.
  359. optional string operator = 2;
  360. // Specifies the set of values. Each returned container exit code (might be
  361. // multiple in case of multiple containers) is checked against this set of
  362. // values with respect to the operator. The list of values must be ordered
  363. // and must not contain duplicates. Value '0' cannot be used for the In operator.
  364. // At least one element is required. At most 255 elements are allowed.
  365. // +listType=set
  366. repeated int32 values = 3;
  367. }
  368. // PodFailurePolicyOnPodConditionsPattern describes a pattern for matching
  369. // an actual pod condition type.
  370. message PodFailurePolicyOnPodConditionsPattern {
  371. // Specifies the required Pod condition type. To match a pod condition
  372. // it is required that specified type equals the pod condition type.
  373. optional string type = 1;
  374. // Specifies the required Pod condition status. To match a pod condition
  375. // it is required that the specified status equals the pod condition status.
  376. // Defaults to True.
  377. optional string status = 2;
  378. }
  379. // PodFailurePolicyRule describes how a pod failure is handled when the requirements are met.
  380. // One of OnExitCodes and onPodConditions, but not both, can be used in each rule.
  381. message PodFailurePolicyRule {
  382. // Specifies the action taken on a pod failure when the requirements are satisfied.
  383. // Possible values are:
  384. // - FailJob: indicates that the pod's job is marked as Failed and all
  385. // running pods are terminated.
  386. // - Ignore: indicates that the counter towards the .backoffLimit is not
  387. // incremented and a replacement pod is created.
  388. // - Count: indicates that the pod is handled in the default way - the
  389. // counter towards the .backoffLimit is incremented.
  390. // Additional values are considered to be added in the future. Clients should
  391. // react to an unknown action by skipping the rule.
  392. optional string action = 1;
  393. // Represents the requirement on the container exit codes.
  394. // +optional
  395. optional PodFailurePolicyOnExitCodesRequirement onExitCodes = 2;
  396. // Represents the requirement on the pod conditions. The requirement is represented
  397. // as a list of pod condition patterns. The requirement is satisfied if at
  398. // least one pattern matches an actual pod condition. At most 20 elements are allowed.
  399. // +listType=atomic
  400. repeated PodFailurePolicyOnPodConditionsPattern onPodConditions = 3;
  401. }
  402. // UncountedTerminatedPods holds UIDs of Pods that have terminated but haven't
  403. // been accounted in Job status counters.
  404. message UncountedTerminatedPods {
  405. // Succeeded holds UIDs of succeeded Pods.
  406. // +listType=set
  407. // +optional
  408. repeated string succeeded = 1;
  409. // Failed holds UIDs of failed Pods.
  410. // +listType=set
  411. // +optional
  412. repeated string failed = 2;
  413. }