PodCreate
Create a pod on a Kubernetes cluster, wait until the pod stops and collect its logs.
type: "io.kestra.plugin.kubernetes.core.PodCreate"Examples
Launch a Pod
id: kubernetes_pod_create
namespace: company.team
tasks:
- id: pod_create
type: io.kestra.plugin.kubernetes.core.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.
id: kubernetes_pod_create
namespace: company.team
inputs:
- id: file
type: FILE
tasks:
- id: pod_create
type: io.kestra.plugin.kubernetes.core.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
Launch a Pod with input files and gather its output files limiting resources for the init and sidecar containers.
id: kubernetes_pod_create
namespace: company.team
inputs:
- id: file
type: FILE
tasks:
- id: pod_create
type: io.kestra.plugin.kubernetes.core.PodCreate
fileSidecar:
resources:
limits:
cpu: "300m"
memory: "512Mi"
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
spec *Requiredobject
The pod specification
Kubernetes pod specification defining containers, volumes, restart policy, and other pod settings. Must include at least one container. Supports dynamic template expressions including the special variable which resolves to '/kestra/working-dir' when inputFiles or outputFiles are used.
connection Non-dynamicConnection
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:
- System properties
- Environment variables
- Kube config file
- Service account token and a mounted CA certificate.
You can pass a full configuration with all options if needed.
currentConnection Non-dynamicConnection
currentNamespace Non-dynamicstring
currentPodName Non-dynamicAtomicReference
delete booleanstring
trueWhether to delete the pod after task completion
When true (default), the pod is automatically deleted after successful completion or failure. Set to false to keep the pod for debugging purposes. Note that pods are always deleted when the task is killed.
fileSidecar Non-dynamicSideCar
{
"image": "busybox"
}The configuration of the file sidecar container that handles the download and upload of files
inputFiles object
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.
killed Non-dynamicAtomicBoolean
falsemetadata object
The pod metadata configuration
Kubernetes metadata for the pod, including labels, annotations, and name. If name is not specified, it will be auto-generated based on the task execution context. Supports dynamic template expressions.
namespace string
defaultThe namespace where the pod will be created
The Kubernetes namespace in which to create the pod. Defaults to 'default' if not specified.
outputFiles array
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..
resume booleanstring
trueWhether to resume execution of an existing pod
When true (default), attempts to reconnect to an existing pod with matching taskrun ID and attempt count instead of creating a new pod. This enables recovery from interrupted executions. If no matching pod exists or multiple matching pods are found, a new pod is created.
waitForLogInterval string
PT30SdurationAdditional time to wait for late-arriving logs after pod completion
After the pod completes and initial log collection finishes, wait this duration to capture any remaining logs that may still be in transit. Defaults to 30 seconds. Useful as a safety net for high-throughput scenarios where logs may arrive slightly delayed.
waitRunning string
PT1HdurationThe maximum duration to wait for pod completion
Maximum duration allowed for the pod to complete after reaching Running state. If the pod does not complete within this time, the task will fail and the pod will be deleted. Only used by PodCreate task.
waitUntilReady string
PT0SdurationThe maximum duration to wait until the resource becomes ready
When set to a positive duration, waits for the resource to report Ready=True in its status conditions. Set to PT0S (zero, default) to skip waiting. Supports Pods, StatefulSets, and custom resources that use the Ready condition. Note: Deployments are not supported as they use the Available condition instead of Ready.
waitUntilRunning string
PT10MdurationThe maximum duration to wait until the pod is running
Maximum time to wait for the pod to reach Running state, including scheduler assignment, image pull, and container startup. Only used by PodCreate task.
Outputs
Definitions
io.kestra.plugin.kubernetes.models.Connection
apiVersion string
v1The API version
caCertData string
CA certificate as data
caCertFile string
CA certificate as file path
clientCertData string
Client certificate as data
clientCertFile string
Client certificate as a file path
clientKeyAlgo string
RSAClient key encryption algorithm
default is RSA
clientKeyData string
Client key as data
clientKeyFile string
Client key as a file path
clientKeyPassphrase string
Client key passphrase
disableHostnameVerification booleanstring
Disable hostname verification
keyStoreFile string
Key store file
keyStorePassphrase string
Key store passphrase
masterUrl string
https://kubernetes.default.svcThe URL to the Kubernetes API
namespace string
The namespace used
oauthToken string
Oauth token
oauthTokenProvider OAuthTokenProvider
Oauth token provider
password string
Password
trustCerts booleanstring
Trust all certificates
trustStoreFile string
Truststore file
trustStorePassphrase string
Truststore passphrase
username string
Username
io.fabric8.kubernetes.api.model.ContainerState
io.fabric8.kubernetes.api.model.Quantity
amount string
format string
java.util.concurrent.atomic.AtomicBoolean
io.fabric8.kubernetes.api.model.VolumeMountStatus
mountPath string
name string
readOnly boolean
recursiveReadOnly string
io.kestra.plugin.kubernetes.models.OAuthTokenProvider
output string
task Task
io.fabric8.kubernetes.api.model.OwnerReference
apiVersion string
blockOwnerDeletion boolean
controller boolean
kind string
name string
uid string
io.fabric8.kubernetes.api.model.FieldsV1
io.fabric8.kubernetes.api.model.ResourceRequirements
io.kestra.plugin.kubernetes.models.PodStatus
additionalProperties object
hostIP string
message string
nominatedNodeName string
phase string
podIP string
qosClass string
reason string
startTime string
date-timeio.fabric8.kubernetes.api.model.ContainerStateRunning
startedAt string
io.kestra.plugin.kubernetes.models.SideCar
image string
busyboxThe image used for the file sidecar container
resources object
The resource requirements applied to the file sidecar container
io.fabric8.kubernetes.api.model.ContainerStatus
containerID string
image string
imageID string
lastState ContainerState
name string
ready boolean
resources ResourceRequirements
restartCount integer
started boolean
state ContainerState
stopSignal string
user ContainerUser
io.fabric8.kubernetes.api.model.PodCondition
lastProbeTime string
lastTransitionTime string
message string
observedGeneration integer
reason string
status string
type string
io.kestra.plugin.kubernetes.models.Metadata
annotations object
List of all annotations of the resource
clusterName string
Name of the current cluster
creationTimestamp string
date-timeCreation datetime
deletionGracePeriodSeconds integer
Deletetion grace period in seconds
deletionTimestamp string
date-timeDeletion datetime
finalizers array
List of finalizers
generateName string
Generate name of the resource
generation integer
Generation
labels object
List of labels
name string
Name of the resource
namespace string
Namespace of the resource
resourceVersion string
Resource version
selfLink string
Direct link to the API of this resource
uid string
Generated UUID of this resource