avionix.kube.batch

class avionix.kube.batch.CronJob(metadata, spec, api_version=None)
Parameters
class avionix.kube.batch.CronJobList(metadata, items, api_version=None)
Parameters
class avionix.kube.batch.CronJobSpec(job_template, schedule, starting_deadline_seconds=None, concurrency_policy=None, failed_jobs_history_limit=None, successful_jobs_history_limit=None, suspend=None)
Parameters
  • job_template (JobTemplateSpec) – Specifies the job that will be created when executing a CronJob.

  • schedule (str) – The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.

  • starting_deadline_seconds (Optional[int]) – Optional deadline in seconds for starting the job if it misses scheduled time for any reason. Missed jobs executions will be counted as failed ones.

  • concurrency_policy (Optional[str]) – Specifies how to treat concurrent executions of a Job. Valid values are: - “Allow” (default): allows CronJobs to run concurrently; - “Forbid”: forbids concurrent runs, skipping next run if previous run hasn’t finished yet; - “Replace”: cancels currently running job and replaces it with a new one

  • failed_jobs_history_limit (Optional[int]) – The number of failed finished jobs to retain. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1.

  • successful_jobs_history_limit (Optional[int]) – The number of successful finished jobs to retain. This is a pointer to distinguish between explicit zero and not specified. Defaults to 3.

  • suspend (Optional[bool]) – This flag tells the controller to suspend subsequent executions, it does not apply to already started executions. Defaults to false.

class avionix.kube.batch.Job(metadata, spec, api_version=None)
Parameters
class avionix.kube.batch.JobCondition(last_probe_time, last_transition_time, message, reason, type)
Parameters
  • last_probe_time (time) – Last time the condition was checked.

  • last_transition_time (time) – Last time the condition transit from one status to another.

  • message (str) – Human readable message indicating details about last transition.

  • reason (str) – (brief) reason for the condition’s last transition.

  • type (str) – Type of job condition, Complete or Failed.

class avionix.kube.batch.JobList(metadata, items, api_version=None)
Parameters
class avionix.kube.batch.JobSpec(template, completions=None, manual_selector=None, parallelism=None, selector=None, ttl_seconds_after_finished=None, active_deadline_seconds=None, backoff_limit=None)
Parameters
  • template (PodTemplateSpec) – Describes the pod that will be created when executing a job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ # noqa

  • completions (Optional[int]) – Specifies the desired number of successfully finished pods the job should be run with. Setting to nil means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ # noqa

  • manual_selector (Optional[bool]) – manualSelector controls generation of pod labels and pod selectors. Leave manualSelector unset unless you are certain what you are doing. When false or unset, the system pick labels unique to this job and appends those labels to the pod template. When true, the user is responsible for picking unique labels and specifying the selector. Failure to pick a unique label may cause this and other jobs to not function correctly. However, You may see manualSelector=true in jobs that were created with the old extensions/v1beta1 API. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#specifying-your-own-pod-selector # noqa

  • parallelism (Optional[int]) – Specifies the maximum desired number of pods the job should run at any given time. The actual number of pods running in steady state will be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism), i.e. when the work left to do is less than max parallelism. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ # noqa

  • selector (Optional[LabelSelector]) – A label query over pods that should match the pod count. Normally, the system sets this field for you. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors # noqa

  • ttl_seconds_after_finished (Optional[int]) – ttlSecondsAfterFinished limits the lifetime of a Job that has finished execution (either Complete or Failed). If this field is set, ttlSecondsAfterFinished after the Job finishes, it is eligible to be automatically deleted. When the Job is being deleted, its lifecycle guarantees (e.g. finalizers) will be honored. If this field is unset, the Job won’t be automatically deleted. If this field is set to zero, the Job becomes eligible to be deleted immediately after it finishes. This field is alpha-level and is only honored by servers that enable the TTLAfterFinished feature.

  • active_deadline_seconds (Optional[int]) – Specifies the duration in seconds relative to the startTime that the job may be active before the system tries to terminate it; value must be positive integer

  • backoff_limit (Optional[int]) – Specifies the number of retries before marking this job failed. Defaults to 6

class avionix.kube.batch.JobTemplateSpec(spec, metadata=None)
Parameters