PodCreate​Pod​Create

yaml
type: "io.kestra.plugin.kubernetes.PodCreate"

Create a pod on a Kubernetes cluster, wait until the pod stops and collect its logs.

Examples

Launch a Pod

yaml
id: kubernetes_pod_create
namespace: company.team

tasks:
  - id: pod_create
    type: io.kestra.plugin.kubernetes.PodCreate
    namespace: default
    metadata:
      labels:
        my-label: my-value
    spec:
      containers:
      - name: unittest
        image: debian:stable-slim
        command:
          - 'bash'
          - '-c'
          - 'for i in {1..10}; do echo $i; sleep 0.1; done'
    restartPolicy: Never

Launch a Pod with input files and gather its output files.

yaml
id: kubernetes
namespace: company.team

inputs:
  - id: file
    type: FILE

tasks:
  - id: kubernetes
    type: io.kestra.plugin.kubernetes.PodCreate
    spec:
      containers:
      - name: unittest
        image: centos
        command:
          - cp
          - "{{workingDir}}/data.txt"
          - "{{workingDir}}/out.txt"
      restartPolicy: Never
    waitUntilRunning: PT3M
    inputFiles:
      data.txt: "{{inputs.file}}"
    outputFiles:
      - out.txt

Properties

delete

  • Type: boolean
  • Dynamic:
  • Required: ✔️
  • Default: true

Whether the pod should be deleted upon completion.

namespace

  • Type: string
  • Dynamic: ✔️
  • Required: ✔️
  • Default: default

The namespace where the pod will be created

resume

  • Type: boolean
  • Dynamic:
  • Required: ✔️
  • Default: true

Whether to reconnect to the current pod if it already exists.

spec

  • Type: object
  • Dynamic: ✔️
  • Required: ✔️

The YAML spec of the pod.

waitRunning

  • Type: string
  • Dynamic:
  • Required: ✔️
  • Default: 3600
  • Format: duration

The maximum duration to wait for the job completion.

waitUntilRunning

  • Type: string
  • Dynamic:
  • Required: ✔️
  • Default: 600
  • Format: duration

The maximum duration to wait until the job and the pod is created.

This timeout is the maximum time that Kubernetes scheduler will take to

  • schedule the job
  • pull the pod image
  • and start the pod.

connection

The connection parameters to the Kubernetes cluster

If no connection is defined, we try to load the connection from the current context in the following order:

  1. System properties
  2. Environment variables
  3. Kube config file
  4. Service account token and a mounted CA certificate.

You can pass a full configuration with all options if needed.

fileSidecar

  • Type: SideCar
  • Dynamic:
  • Required:
  • Default: { "image": "busybox" }

The configuration of the file sidecar container that handle download and upload of files.

inputFiles

  • Type: object
  • SubType: string
  • Dynamic: ✔️
  • Required:

The files to create on the local filesystem. It can be a map or a JSON object.

The files will be available inside the kestra/working-dir directory of the container. You can use the special variable in your command to refer to it.

metadata

  • Type: object
  • Dynamic: ✔️
  • Required:

The YAML metadata of the pod.

outputFiles

  • Type: array
  • SubType: string
  • Dynamic:
  • Required:

The files from the container filesystem to send to Kestra's internal storage.

Only files created inside the kestra/working-dir directory of the container can be retrieved. Must be a list of glob) expressions relative to the current working directory, some examples: my-dir/, my-dir/*/ or my-dir/my-file.txt..

waitForLogInterval

  • Type: string
  • Dynamic:
  • Required:
  • Default: 2
  • Format: duration

Additional time after the pod ends to wait for late logs.

Outputs

metadata

outputFiles

  • Type: object
  • SubType: string
  • Required:

status

vars

  • Type: object
  • Required:

Definitions

io.kestra.plugin.kubernetes.models.Connection

  • apiVersion
    • Type: string
    • Dynamic: ✔️
    • Required:
    • Default: v1
  • caCertData
    • Type: string
    • Dynamic: ✔️
    • Required:
  • caCertFile
    • Type: string
    • Dynamic: ✔️
    • Required:
  • clientCertData
    • Type: string
    • Dynamic: ✔️
    • Required:
  • clientCertFile
    • Type: string
    • Dynamic: ✔️
    • Required:
  • clientKeyAlgo
    • Type: string
    • Dynamic: ✔️
    • Required:
    • Default: RSA
  • clientKeyData
    • Type: string
    • Dynamic: ✔️
    • Required:
  • clientKeyFile
    • Type: string
    • Dynamic: ✔️
    • Required:
  • clientKeyPassphrase
    • Type: string
    • Dynamic: ✔️
    • Required:
  • disableHostnameVerification
    • Type: boolean
    • Dynamic:
    • Required:
  • keyStoreFile
    • Type: string
    • Dynamic: ✔️
    • Required:
  • keyStorePassphrase
    • Type: string
    • Dynamic: ✔️
    • Required:
  • masterUrl
    • Type: string
    • Dynamic: ✔️
    • Required:
    • Default: https://kubernetes.default.svc
  • namespace
    • Type: string
    • Dynamic: ✔️
    • Required:
  • oauthToken
    • Type: string
    • Dynamic: ✔️
    • Required:
  • oauthTokenProvider
  • password
    • Type: string
    • Dynamic: ✔️
    • Required:
  • trustCerts
    • Type: boolean
    • Dynamic:
    • Required:
  • trustStoreFile
    • Type: string
    • Dynamic: ✔️
    • Required:
  • trustStorePassphrase
    • Type: string
    • Dynamic: ✔️
    • Required:
  • username
    • Type: string
    • Dynamic: ✔️
    • Required:

io.fabric8.kubernetes.api.model.ContainerState

io.fabric8.kubernetes.api.model.PodCondition

  • lastProbeTime
    • Type: string
    • Dynamic:
    • Required:
  • lastTransitionTime
    • Type: string
    • Dynamic:
    • Required:
  • message
    • Type: string
    • Dynamic:
    • Required:
  • reason
    • Type: string
    • Dynamic:
    • Required:
  • status
    • Type: string
    • Dynamic:
    • Required:
  • type
    • Type: string
    • Dynamic:
    • Required:

io.fabric8.kubernetes.api.model.Quantity

  • amount
    • Type: string
    • Dynamic:
    • Required:
  • format
    • Type: string
    • Dynamic:
    • Required:

io.kestra.plugin.kubernetes.models.Metadata

  • annotations
    • Type: object
    • SubType: string
    • Dynamic:
    • Required:
  • clusterName
    • Type: string
    • Dynamic:
    • Required:
  • creationTimestamp
    • Type: string
    • Dynamic:
    • Required:
    • Format: date-time
  • deletionGracePeriodSeconds
    • Type: integer
    • Dynamic:
    • Required:
  • deletionTimestamp
    • Type: string
    • Dynamic:
    • Required:
    • Format: date-time
  • finalizers
    • Type: array
    • SubType: string
    • Dynamic:
    • Required:
  • generateName
    • Type: string
    • Dynamic:
    • Required:
  • generation
    • Type: integer
    • Dynamic:
    • Required:
  • labels
    • Type: object
    • SubType: string
    • Dynamic:
    • Required:
  • managedFields
  • name
    • Type: string
    • Dynamic:
    • Required:
  • namespace
    • Type: string
    • Dynamic:
    • Required:
  • ownerReferences
  • resourceVersion
    • Type: string
    • Dynamic:
    • Required:
    • Type: string
    • Dynamic:
    • Required:
  • uid
    • Type: string
    • Dynamic:
    • Required:

io.fabric8.kubernetes.api.model.VolumeMountStatus

  • mountPath
    • Type: string
    • Dynamic:
    • Required:
  • name
    • Type: string
    • Dynamic:
    • Required:
  • readOnly
    • Type: boolean
    • Dynamic:
    • Required:
  • recursiveReadOnly
    • Type: string
    • Dynamic:
    • Required:

io.kestra.plugin.kubernetes.models.OAuthTokenProvider

  • output
    • Type: string
    • Dynamic:
    • Required:
  • task
    • Type: Task
    • Dynamic:
    • Required:

io.fabric8.kubernetes.api.model.OwnerReference

  • apiVersion
    • Type: string
    • Dynamic:
    • Required:
  • blockOwnerDeletion
    • Type: boolean
    • Dynamic:
    • Required:
  • controller
    • Type: boolean
    • Dynamic:
    • Required:
  • kind
    • Type: string
    • Dynamic:
    • Required:
  • name
    • Type: string
    • Dynamic:
    • Required:
  • uid
    • Type: string
    • Dynamic:
    • Required:

io.fabric8.kubernetes.api.model.FieldsV1

io.fabric8.kubernetes.api.model.ResourceRequirements

  • claims
  • limits
    • Type: object
    • SubType: Quantity
    • Dynamic:
    • Required:
  • requests
    • Type: object
    • SubType: Quantity
    • Dynamic:
    • Required:

io.fabric8.kubernetes.api.model.ContainerStateTerminated

  • containerID
    • Type: string
    • Dynamic:
    • Required:
  • exitCode
    • Type: integer
    • Dynamic:
    • Required:
  • finishedAt
    • Type: string
    • Dynamic:
    • Required:
  • message
    • Type: string
    • Dynamic:
    • Required:
  • reason
    • Type: string
    • Dynamic:
    • Required:
  • signal
    • Type: integer
    • Dynamic:
    • Required:
  • startedAt
    • Type: string
    • Dynamic:
    • Required:

io.fabric8.kubernetes.api.model.ManagedFieldsEntry

  • apiVersion
    • Type: string
    • Dynamic:
    • Required:
  • fieldsType
    • Type: string
    • Dynamic:
    • Required:
  • fieldsV1
  • manager
    • Type: string
    • Dynamic:
    • Required:
  • operation
    • Type: string
    • Dynamic:
    • Required:
  • subresource
    • Type: string
    • Dynamic:
    • Required:
  • time
    • Type: string
    • Dynamic:
    • Required:

io.kestra.plugin.kubernetes.models.PodStatus

  • additionalProperties
    • Type: object
    • Dynamic:
    • Required:
  • conditions
  • containerStatuses
  • ephemeralContainerStatuses
  • hostIP
    • Type: string
    • Dynamic:
    • Required:
  • initContainerStatuses
  • message
    • Type: string
    • Dynamic:
    • Required:
  • nominatedNodeName
    • Type: string
    • Dynamic:
    • Required:
  • phase
    • Type: string
    • Dynamic:
    • Required:
  • podIP
    • Type: string
    • Dynamic:
    • Required:
  • podIPs
    • Type: array
    • SubType: PodIP
    • Dynamic:
    • Required:
  • qosClass
    • Type: string
    • Dynamic:
    • Required:
  • reason
    • Type: string
    • Dynamic:
    • Required:
  • startTime
    • Type: string
    • Dynamic:
    • Required:
    • Format: date-time

io.fabric8.kubernetes.api.model.ContainerStateRunning

  • startedAt
    • Type: string
    • Dynamic:
    • Required:

io.kestra.plugin.kubernetes.models.SideCar

  • image
    • Type: string
    • Dynamic: ✔️
    • Required:
    • Default: busybox

io.fabric8.kubernetes.api.model.ContainerStatus

  • allocatedResources
    • Type: object
    • SubType: Quantity
    • Dynamic:
    • Required:
  • containerID
    • Type: string
    • Dynamic:
    • Required:
  • image
    • Type: string
    • Dynamic:
    • Required:
  • imageID
    • Type: string
    • Dynamic:
    • Required:
  • lastState
  • name
    • Type: string
    • Dynamic:
    • Required:
  • ready
    • Type: boolean
    • Dynamic:
    • Required:
  • resources
  • restartCount
    • Type: integer
    • Dynamic:
    • Required:
  • started
    • Type: boolean
    • Dynamic:
    • Required:
  • state
  • volumeMounts

io.fabric8.kubernetes.api.model.ContainerStateWaiting

  • message
    • Type: string
    • Dynamic:
    • Required:
  • reason
    • Type: string
    • Dynamic:
    • Required:

io.fabric8.kubernetes.api.model.PodIP

  • ip
    • Type: string
    • Dynamic:
    • Required:

io.fabric8.kubernetes.api.model.ResourceClaim

  • name
    • Type: string
    • Dynamic:
    • Required: