Version: v1.0

Task

Description

Describes jobs that run code or a script to completion.

Samples

  1. apiVersion: core.oam.dev/v1beta1
  2. kind: Application
  3. metadata:
  4. name: app-worker
  5. spec:
  6. components:
  7. - name: mytask
  8. type: task
  9. properties:
  10. image: perl
  11. count: 10
  12. cmd: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]

Specification

  1. # Properties
  2. +---------+--------------------------------------------------------------------------------------------------+----------+----------+---------+
  3. | NAME | DESCRIPTION | TYPE | REQUIRED | DEFAULT |
  4. +---------+--------------------------------------------------------------------------------------------------+----------+----------+---------+
  5. | cmd | Commands to run in the container | []string | false | |
  6. | count | specify number of tasks to run in parallel | int | true | 1 |
  7. | restart | Define the job restart policy, the value can only be Never or OnFailure. By default, it's Never. | string | true | Never |
  8. | image | Which image would you like to use for your service | string | true | |
  9. +---------+--------------------------------------------------------------------------------------------------+----------+----------+---------+