PodCreate
Create a pod on a Kubernetes cluster, wait until the pod stops and collect its logs.
type: "io.kestra.plugin.kubernetes.PodCreate"
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
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
YES
default
The namespace where the pod will be created
YES
The YAML spec of the pod.
YES
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.
NO
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.
YES
true
NO
{
"image": "busybox"
}
The configuration of the file sidecar container that handle download and upload of files.
YES
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.
YES
The YAML metadata of the pod.
YES
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
..
YES
true
YES
PT2S
duration
Additional time after the pod ends to wait for late logs.
YES
PT1H
duration
The maximum duration to wait for the job completion.
The pod metadata.
The output files URI in Kestra's internal storage
The pod status.
The output variables extracted from the logs of the commands
YES
v1
The API version
YES
CA certificate as data
YES
CA certificate as file path
YES
Client certificate as data
YES
Client certificate as a file path
YES
RSA
Client key encryption algorithm
default is RSA
YES
Client key as data
YES
Client key as a file path
YES
Client key passphrase
YES
YES
Key store file
YES
Key store passphrase
YES
https://kubernetes.default.svc
The url to the Kubernetes API
YES
The namespace used
YES
Oauth token
NO
Oauth token provider
YES
Password
YES
YES
Truststore file
YES
Truststore passphrase
YES
Username
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
List of all annotations of the resource
NO
Name of the current cluster
NO
date-time
Creation datetime
NO
Deletetion grace period in seconds
NO
date-time
Deletetion datetime
NO
List of finalizers
NO
Generate name of the resource
NO
Generation
NO
List of labels
NO
Name of the resource
NO
Namespace of the resource
NO
Resource version
NO
Direct link on the api of this resource
NO
Generated Uid of this resource
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
busybox
The image used for the file sidecar container.
NO
NO
NO
NO