Trigger a rolling restart of one or multiple Kubernetes resources (Deployment, DaemonSet, StatefulSet).

yaml
type: "io.kestra.plugin.kubernetes.kubectl.Restart"

Trigger a rolling restart of a StatefulSet named 'api' (equivalent to kubectl rollout restart statefulset api).

yaml
id: restart_api
namespace: company.team

tasks:
  - id: restart
    type: io.kestra.plugin.kubernetes.kubectl.Restart
    namespace: api
    resourceType: StatefulSet
    resourcesNames:
      - api
    connection:
      masterUrl: "{{ secret('MASTER_URL') }}"
      caCertData: "{{ secret('CA_CERT_DATA') }}"
      oauthToken: "{{ secret('OAUTH_TOKEN') }}"
Properties

The Kubernetes namespace

Possible Values
DeploymentDaemonSetStatefulSet

The Kubernetes resource type (Deployment, DaemonSet, StatefulSet).

SubType string

The Kubernetes resources names

Default apps

The Kubernetes resource apiGroup

Default v1

The Kubernetes resource apiVersion

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:

  1. System properties
  2. Environment variables
  3. Kube config file
  4. Service account token and a mounted CA certificate.

You can pass a full configuration with all options if needed.

Default { "image": "busybox" }

The configuration of the file sidecar container that handles the download and upload of files

SubType string

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.

SubType string

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..

Default PT1H
Format duration

The maximum duration to wait for the job completion

Default PT10M
Format 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.
Default v1

The API version

CA certificate as data

CA certificate as file path

Client certificate as data

Client certificate as a file path

Default RSA

Client key encryption algorithm

default is RSA

Client key as data

Client key as a file path

Client key passphrase

Disable hostname verification

Key store file

Key store passphrase

Default https://kubernetes.default.svc

The URL to the Kubernetes API

The namespace used

Oauth token

Oauth token provider

Password

Trust all certificates

Truststore file

Truststore passphrase

Username

Default busybox

The image used for the file sidecar container

The resource requirements applied to the file sidecar container