PodCreate
Create a pod on a Kubernetes cluster, wait until the pod stops and collect its logs.
type: "io.kestra.plugin.kubernetes.PodCreate"
Examples
Launch a Pod
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.
id: kubernetes_pod_create
namespace: company.team
inputs:
- id: file
type: FILE
tasks:
- id: pod_create
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
spec *Requiredobject
The YAML spec of the pod.
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
true
Whether the pod should be deleted upon completion.
fileSidecar Non-dynamicSideCar
{
"image": "busybox"
}
The configuration of the file sidecar container that handle 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
false
metadata object
The YAML metadata of the pod.
namespace string
default
The namespace where the pod will be created
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
true
Whether to reconnect to the current pod if it already exists.
waitForLogInterval string
PT2S
duration
Additional time after the pod ends to wait for late logs.
waitRunning string
PT1H
duration
The maximum duration to wait for the job completion.
waitUntilRunning string
PT10M
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.
Outputs
Definitions
io.kestra.plugin.kubernetes.models.Connection
apiVersion string
v1
The 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
RSA
Client 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.svc
The 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-time
io.fabric8.kubernetes.api.model.ContainerStateRunning
startedAt string
io.kestra.plugin.kubernetes.models.SideCar
image string
busybox
The image used for 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-time
Creation datetime
deletionGracePeriodSeconds integer
Deletetion grace period in seconds
deletionTimestamp string
date-time
Deletetion 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 on the api of this resource
uid string
Generated Uid of this resource