Apply
Apply a Kubernetes resource
type: "io.kestra.plugin.kubernetes.kubectl.Apply"
Apply a Kubernetes resource, using YAML.
id: create_or_replace_deployment
namespace: company.team
tasks:
- id: apply
type: io.kestra.plugin.kubernetes.kubectl.Apply
namespace: default
spec: |-
apiVersion: apps/v1
kind: Deployment
metadata:
name: mypod
Apply a Kubernetes resource, using a namespace file.
id: create_or_replace_deployment
namespace: company.team
tasks:
- id: apply
type: io.kestra.plugin.kubernetes.kubectl.Apply
namespaceFiles:
enabled: true
namespace: default
spec: "{{ read('deployment.yaml') }}"
YES
The Kubernetes resource spec
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.
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 Kubernetes namespace
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
PT1H
duration
The maximum duration to wait for the job completion.
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
Disable hostname verification
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
Trust all certificates
YES
Truststore file
YES
Truststore passphrase
YES
Username
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
YES
busybox
The image used for the file sidecar container.
NO
NO
NO
NO
NO
NO
NO
NO