generated.proto 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  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 = "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. // Optional deadline in seconds for starting the job if it misses scheduled
  51. // time for any reason. Missed jobs executions will be counted as failed ones.
  52. // +optional
  53. optional int64 startingDeadlineSeconds = 2;
  54. // Specifies how to treat concurrent executions of a Job.
  55. // Valid values are:
  56. // - "Allow" (default): allows CronJobs to run concurrently;
  57. // - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet;
  58. // - "Replace": cancels currently running job and replaces it with a new one
  59. // +optional
  60. optional string concurrencyPolicy = 3;
  61. // This flag tells the controller to suspend subsequent executions, it does
  62. // not apply to already started executions. Defaults to false.
  63. // +optional
  64. optional bool suspend = 4;
  65. // Specifies the job that will be created when executing a CronJob.
  66. optional JobTemplateSpec jobTemplate = 5;
  67. // The number of successful finished jobs to retain. Value must be non-negative integer.
  68. // Defaults to 3.
  69. // +optional
  70. optional int32 successfulJobsHistoryLimit = 6;
  71. // The number of failed finished jobs to retain. Value must be non-negative integer.
  72. // Defaults to 1.
  73. // +optional
  74. optional int32 failedJobsHistoryLimit = 7;
  75. }
  76. // CronJobStatus represents the current state of a cron job.
  77. message CronJobStatus {
  78. // A list of pointers to currently running jobs.
  79. // +optional
  80. // +listType=atomic
  81. repeated k8s.io.api.core.v1.ObjectReference active = 1;
  82. // Information when was the last time the job was successfully scheduled.
  83. // +optional
  84. optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScheduleTime = 4;
  85. // Information when was the last time the job successfully completed.
  86. // +optional
  87. optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastSuccessfulTime = 5;
  88. }
  89. // Job represents the configuration of a single job.
  90. message Job {
  91. // Standard object's metadata.
  92. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  93. // +optional
  94. optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  95. // Specification of the desired behavior of a job.
  96. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
  97. // +optional
  98. optional JobSpec spec = 2;
  99. // Current status of a job.
  100. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
  101. // +optional
  102. optional JobStatus status = 3;
  103. }
  104. // JobCondition describes current state of a job.
  105. message JobCondition {
  106. // Type of job condition, Complete or Failed.
  107. optional string type = 1;
  108. // Status of the condition, one of True, False, Unknown.
  109. optional string status = 2;
  110. // Last time the condition was checked.
  111. // +optional
  112. optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastProbeTime = 3;
  113. // Last time the condition transit from one status to another.
  114. // +optional
  115. optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 4;
  116. // (brief) reason for the condition's last transition.
  117. // +optional
  118. optional string reason = 5;
  119. // Human readable message indicating details about last transition.
  120. // +optional
  121. optional string message = 6;
  122. }
  123. // JobList is a collection of jobs.
  124. message JobList {
  125. // Standard list metadata.
  126. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  127. // +optional
  128. optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
  129. // items is the list of Jobs.
  130. repeated Job items = 2;
  131. }
  132. // JobSpec describes how the job execution will look like.
  133. message JobSpec {
  134. // Specifies the maximum desired number of pods the job should
  135. // run at any given time. The actual number of pods running in steady state will
  136. // be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism),
  137. // i.e. when the work left to do is less than max parallelism.
  138. // More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/
  139. // +optional
  140. optional int32 parallelism = 1;
  141. // Specifies the desired number of successfully finished pods the
  142. // job should be run with. Setting to nil means that the success of any
  143. // pod signals the success of all pods, and allows parallelism to have any positive
  144. // value. Setting to 1 means that parallelism is limited to 1 and the success of that
  145. // pod signals the success of the job.
  146. // More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/
  147. // +optional
  148. optional int32 completions = 2;
  149. // Specifies the duration in seconds relative to the startTime that the job
  150. // may be continuously active before the system tries to terminate it; value
  151. // must be positive integer. If a Job is suspended (at creation or through an
  152. // update), this timer will effectively be stopped and reset when the Job is
  153. // resumed again.
  154. // +optional
  155. optional int64 activeDeadlineSeconds = 3;
  156. // Specifies the number of retries before marking this job failed.
  157. // Defaults to 6
  158. // +optional
  159. optional int32 backoffLimit = 7;
  160. // A label query over pods that should match the pod count.
  161. // Normally, the system sets this field for you.
  162. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
  163. // +optional
  164. optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4;
  165. // manualSelector controls generation of pod labels and pod selectors.
  166. // Leave `manualSelector` unset unless you are certain what you are doing.
  167. // When false or unset, the system pick labels unique to this job
  168. // and appends those labels to the pod template. When true,
  169. // the user is responsible for picking unique labels and specifying
  170. // the selector. Failure to pick a unique label may cause this
  171. // and other jobs to not function correctly. However, You may see
  172. // `manualSelector=true` in jobs that were created with the old `extensions/v1beta1`
  173. // API.
  174. // More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#specifying-your-own-pod-selector
  175. // +optional
  176. optional bool manualSelector = 5;
  177. // Describes the pod that will be created when executing a job.
  178. // More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/
  179. optional k8s.io.api.core.v1.PodTemplateSpec template = 6;
  180. // ttlSecondsAfterFinished limits the lifetime of a Job that has finished
  181. // execution (either Complete or Failed). If this field is set,
  182. // ttlSecondsAfterFinished after the Job finishes, it is eligible to be
  183. // automatically deleted. When the Job is being deleted, its lifecycle
  184. // guarantees (e.g. finalizers) will be honored. If this field is unset,
  185. // the Job won't be automatically deleted. If this field is set to zero,
  186. // the Job becomes eligible to be deleted immediately after it finishes.
  187. // This field is alpha-level and is only honored by servers that enable the
  188. // TTLAfterFinished feature.
  189. // +optional
  190. optional int32 ttlSecondsAfterFinished = 8;
  191. // CompletionMode specifies how Pod completions are tracked. It can be
  192. // `NonIndexed` (default) or `Indexed`.
  193. //
  194. // `NonIndexed` means that the Job is considered complete when there have
  195. // been .spec.completions successfully completed Pods. Each Pod completion is
  196. // homologous to each other.
  197. //
  198. // `Indexed` means that the Pods of a
  199. // Job get an associated completion index from 0 to (.spec.completions - 1),
  200. // available in the annotation batch.kubernetes.io/job-completion-index.
  201. // The Job is considered complete when there is one successfully completed Pod
  202. // for each index.
  203. // When value is `Indexed`, .spec.completions must be specified and
  204. // `.spec.parallelism` must be less than or equal to 10^5.
  205. //
  206. // This field is alpha-level and is only honored by servers that enable the
  207. // IndexedJob feature gate. More completion modes can be added in the future.
  208. // If the Job controller observes a mode that it doesn't recognize, the
  209. // controller skips updates for the Job.
  210. // +optional
  211. optional string completionMode = 9;
  212. // Suspend specifies whether the Job controller should create Pods or not. If
  213. // a Job is created with suspend set to true, no Pods are created by the Job
  214. // controller. If a Job is suspended after creation (i.e. the flag goes from
  215. // false to true), the Job controller will delete all active Pods associated
  216. // with this Job. Users must design their workload to gracefully handle this.
  217. // Suspending a Job will reset the StartTime field of the Job, effectively
  218. // resetting the ActiveDeadlineSeconds timer too. This is an alpha field and
  219. // requires the SuspendJob feature gate to be enabled; otherwise this field
  220. // may not be set to true. Defaults to false.
  221. // +optional
  222. optional bool suspend = 10;
  223. }
  224. // JobStatus represents the current state of a Job.
  225. message JobStatus {
  226. // The latest available observations of an object's current state. When a Job
  227. // fails, one of the conditions will have type "Failed" and status true. When
  228. // a Job is suspended, one of the conditions will have type "Suspended" and
  229. // status true; when the Job is resumed, the status of this condition will
  230. // become false. When a Job is completed, one of the conditions will have
  231. // type "Complete" and status true.
  232. // More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/
  233. // +optional
  234. // +patchMergeKey=type
  235. // +patchStrategy=merge
  236. // +listType=atomic
  237. repeated JobCondition conditions = 1;
  238. // Represents time when the job controller started processing a job. When a
  239. // Job is created in the suspended state, this field is not set until the
  240. // first time it is resumed. This field is reset every time a Job is resumed
  241. // from suspension. It is represented in RFC3339 form and is in UTC.
  242. // +optional
  243. optional k8s.io.apimachinery.pkg.apis.meta.v1.Time startTime = 2;
  244. // Represents time when the job was completed. It is not guaranteed to
  245. // be set in happens-before order across separate operations.
  246. // It is represented in RFC3339 form and is in UTC.
  247. // The completion time is only set when the job finishes successfully.
  248. // +optional
  249. optional k8s.io.apimachinery.pkg.apis.meta.v1.Time completionTime = 3;
  250. // The number of actively running pods.
  251. // +optional
  252. optional int32 active = 4;
  253. // The number of pods which reached phase Succeeded.
  254. // +optional
  255. optional int32 succeeded = 5;
  256. // The number of pods which reached phase Failed.
  257. // +optional
  258. optional int32 failed = 6;
  259. // CompletedIndexes holds the completed indexes when .spec.completionMode =
  260. // "Indexed" in a text format. The indexes are represented as decimal integers
  261. // separated by commas. The numbers are listed in increasing order. Three or
  262. // more consecutive numbers are compressed and represented by the first and
  263. // last element of the series, separated by a hyphen.
  264. // For example, if the completed indexes are 1, 3, 4, 5 and 7, they are
  265. // represented as "1,3-5,7".
  266. // +optional
  267. optional string completedIndexes = 7;
  268. }
  269. // JobTemplateSpec describes the data a Job should have when created from a template
  270. message JobTemplateSpec {
  271. // Standard object's metadata of the jobs created from this template.
  272. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  273. // +optional
  274. optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  275. // Specification of the desired behavior of the job.
  276. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
  277. // +optional
  278. optional JobSpec spec = 2;
  279. }