Get one or many Kubernetes resources of a kind.
type: "io.kestra.plugin.kubernetes.kubectl.Get"
Examples
Get all pods from Kubernetes using YAML (<=> kubectl get pods).
id: get_all_pods
namespace: company.team
tasks:
- id: get
type: io.kestra.plugin.kubernetes.kubectl.Get
namespace: default
resourceType: pods
fetchType: FETCH
Get one deployment named my-deployment from Kubernetes using YAML (<=> kubectl get deployment my-deployment).
id: get_one_deployment
namespace: company.team
tasks:
- id: get
type: io.kestra.plugin.kubernetes.kubectl.Get
namespace: default
resourceType: deployments
resourcesNames:
- my-deployment
fetchType: FETCH_ONE
Get two deployments named my-deployment and my-deployment-2 from Kubernetes using YAML (<=> kubectl get deployment my-deployment) and store them in the internal storage.
id: get_two_deployments
namespace: company.team
tasks:
- id: get
type: io.kestra.plugin.kubernetes.kubectl.Get
namespace: default
resourceType: deployments
resourcesNames:
- my-deployment
- my-deployment-2
fetchType: STORE
Get one custom resource named Shirt from Kubernetes using YAML (<=> kubectl get Shirt).
id: get_one_custom_resource
namespace: company.team
tasks:
- id: get
type: io.kestra.plugin.kubernetes.kubectl.Get
namespace: default
resourceType: shirts # could be Shirt
apiGroup: stable.example.com
apiVersion: v1
fetchType: FETCH_ONE
Properties
namespace *Requiredstring
The Kubernetes namespace
resourceType *Requiredstring
The Kubernetes resource type (= kind) (e.g. pod, service)
apiGroup string
The Kubernetes resource apiGroup
apiVersion string
The Kubernetes resource apiVersion
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.
fetchType string
NONE
STORE
FETCH
FETCH_ONE
NONE
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.
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
..
resourcesNames array
The Kubernetes resources names
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
metadataItem Metadata
The metadata for a single resource.
Only available when fetchType
is set to FETCH_ONE
.
metadataItems array
size integer
The count of the fetched or stored resources.
uri string
uri
The output files URI in Kestra's internal storage.
Only available when fetchType
is set to STORE
.
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.FieldsV1
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
io.fabric8.kubernetes.api.model.ManagedFieldsEntry
apiVersion string
fieldsType string
fieldsV1 FieldsV1
manager string
operation string
subresource string
time string
io.kestra.plugin.kubernetes.models.SideCar
image string
busybox
The image used for the file sidecar container.