PodCreate PodCreate

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.000000000
  • Format: duration

The maximum duration to wait for the job completion.

waitUntilRunning

  • Type: string
  • Dynamic:
  • Required: ✔️
  • Default: 600.000000000
  • 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 {{ workingDir }} 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.000000000
  • Format: duration

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

Outputs

metadata

The pod metadata.

outputFiles

  • Type: object
  • SubType: string
  • Required:

The output files URI in Kestra's internal storage

status

The pod status.

vars

  • Type: object
  • Required:

The output variables extracted from the logs of the commands

Definitions

io.kestra.plugin.kubernetes.models.Connection

Properties

apiVersion
  • Type: string
  • Dynamic: ✔️
  • Required:
  • Default: v1

The API version

caCertData
  • Type: string
  • Dynamic: ✔️
  • Required:

CA certificate as data

caCertFile
  • Type: string
  • Dynamic: ✔️
  • Required:

CA certificate as file path

clientCertData
  • Type: string
  • Dynamic: ✔️
  • Required:

Client certificate as data

clientCertFile
  • Type: string
  • Dynamic: ✔️
  • Required:

Client certificate as a file path

clientKeyAlgo
  • Type: string
  • Dynamic: ✔️
  • Required:
  • Default: RSA

Client key encryption algorithm

default is RSA

clientKeyData
  • Type: string
  • Dynamic: ✔️
  • Required:

Client key as data

clientKeyFile
  • Type: string
  • Dynamic: ✔️
  • Required:

Client key as a file path

clientKeyPassphrase
  • Type: string
  • Dynamic: ✔️
  • Required:

Client key passphrase

disableHostnameVerification
  • Type: boolean
  • Dynamic:
  • Required:

Disable hostname verification

keyStoreFile
  • Type: string
  • Dynamic: ✔️
  • Required:

Key store file

keyStorePassphrase
  • Type: string
  • Dynamic: ✔️
  • Required:

Key store passphrase

masterUrl
  • Type: string
  • Dynamic: ✔️
  • Required:
  • Default: https://kubernetes.default.svc

The url to the Kubernetes API

namespace
  • Type: string
  • Dynamic: ✔️
  • Required:

The namespace used

oauthToken
  • Type: string
  • Dynamic: ✔️
  • Required:

Oauth token

oauthTokenProvider

Oauth token provider

password
  • Type: string
  • Dynamic: ✔️
  • Required:

Password

trustCerts
  • Type: boolean
  • Dynamic:
  • Required:

Trust all certificates

trustStoreFile
  • Type: string
  • Dynamic: ✔️
  • Required:

Truststore file

trustStorePassphrase
  • Type: string
  • Dynamic: ✔️
  • Required:

Truststore passphrase

username
  • Type: string
  • Dynamic: ✔️
  • Required:

Username

io.fabric8.kubernetes.api.model.ContainerState

Properties

running
terminated
waiting

io.fabric8.kubernetes.api.model.PodCondition

Properties

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

Properties

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

io.kestra.plugin.kubernetes.models.Metadata

Properties

annotations
  • Type: object
  • SubType: string
  • Dynamic:
  • Required:

List of all annotations of the resource

clusterName
  • Type: string
  • Dynamic:
  • Required:

Name of the current cluster

creationTimestamp
  • Type: string
  • Dynamic:
  • Required:
  • Format: date-time

Creation datetime

deletionGracePeriodSeconds
  • Type: integer
  • Dynamic:
  • Required:

Deletetion grace period in seconds

deletionTimestamp
  • Type: string
  • Dynamic:
  • Required:
  • Format: date-time

Deletetion datetime

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

List of finalizers

generateName
  • Type: string
  • Dynamic:
  • Required:

Generate name of the resource

generation
  • Type: integer
  • Dynamic:
  • Required:

Generation

labels
  • Type: object
  • SubType: string
  • Dynamic:
  • Required:

List of labels

managedFields

List of managed fields

name
  • Type: string
  • Dynamic:
  • Required:

Name of the resource

namespace
  • Type: string
  • Dynamic:
  • Required:

Namespace of the resource

ownerReferences

List of owner reference

resourceVersion
  • Type: string
  • Dynamic:
  • Required:

Resource version

  • Type: string
  • Dynamic:
  • Required:

Direct link on the api of this resource

uid
  • Type: string
  • Dynamic:
  • Required:

Generated Uid of this resource

io.fabric8.kubernetes.api.model.VolumeMountStatus

Properties

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

Properties

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

io.fabric8.kubernetes.api.model.OwnerReference

Properties

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

Properties

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

io.fabric8.kubernetes.api.model.ContainerStateTerminated

Properties

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

Properties

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

Properties

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

Properties

startedAt
  • Type: string
  • Dynamic:
  • Required:

io.kestra.plugin.kubernetes.models.SideCar

Properties

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

The image used for the file sidecar container.

io.fabric8.kubernetes.api.model.ContainerStatus

Properties

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

Properties

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

io.fabric8.kubernetes.api.model.PodIP

Properties

ip
  • Type: string
  • Dynamic:
  • Required:

io.fabric8.kubernetes.api.model.ResourceClaim

Properties

name
  • Type: string
  • Dynamic:
  • Required:

Was this page helpful?