...

Text file src/k8s.io/api/batch/v1/generated.proto

Documentation: k8s.io/api/batch/v1

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

View as plain text