yaml
type: "io.kestra.plugin.kubernetes.kubectl.Patch"
yaml
id: patch_pod_with_wait
namespace: company.team

tasks:
  - id: patch
    type: io.kestra.plugin.kubernetes.kubectl.Patch
    namespace: production
    resourceType: pod
    resourceName: my-pod
    waitUntilReady: PT5M
    patch: |
      {
        "spec": {
          "containers": [
            {
              "name": "app",
              "resources": {
                "limits": {"memory": "512Mi", "cpu": "500m"},
                "requests": {"memory": "256Mi", "cpu": "250m"}
              }
            }
          ]
        }
      }

yaml
id: patch_deployment_resources
namespace: company.team

tasks:
  - id: patch
    type: io.kestra.plugin.kubernetes.kubectl.Patch
    namespace: production
    resourceType: deployment
    resourceName: my-api
    apiGroup: apps
    patch: |
      {
        "spec": {
          "template": {
            "spec": {
              "containers": [
                {
                  "name": "api",
                  "resources": {
                    "limits": {"memory": "2Gi", "cpu": "1000m"},
                    "requests": {"memory": "1Gi", "cpu": "500m"}
                  }
                }
              ]
            }
          }
        }
      }

yaml
id: scale_deployment
namespace: company.team

tasks:
  - id: scale
    type: io.kestra.plugin.kubernetes.kubectl.Patch
    namespace: production
    resourceType: deployment
    resourceName: my-api
    apiGroup: apps
    patchStrategy: JSON_PATCH
    patch: |
      [
        {"op": "replace", "path": "/spec/replicas", "value": 5}
      ]

yaml
id: remove_annotation
namespace: company.team

tasks:
  - id: patch
    type: io.kestra.plugin.kubernetes.kubectl.Patch
    namespace: production
    resourceType: deployment
    resourceName: my-api
    apiGroup: apps
    patchStrategy: JSON_MERGE
    patch: |
      {
        "metadata": {
          "annotations": {
            "deprecated-annotation": null
          }
        }
      }

yaml
id: patch_custom_resource
namespace: company.team

tasks:
  - id: patch
    type: io.kestra.plugin.kubernetes.kubectl.Patch
    namespace: production
    resourceType: shirts
    resourceName: my-shirt
    apiGroup: stable.example.com
    apiVersion: v1
    patch: |
      {
        "spec": {
          "color": "blue",
          "size": "L"
        }
      }

yaml
id: conditional_scale
namespace: company.team

tasks:
  - id: scale
    type: io.kestra.plugin.kubernetes.kubectl.Patch
    namespace: production
    resourceType: deployment
    resourceName: my-api
    apiGroup: apps
    patchStrategy: JSON_PATCH
    patch: |
      [
        {"op": "test", "path": "/spec/replicas", "value": 3},
        {"op": "replace", "path": "/spec/replicas", "value": 10}
      ]
Properties
Definitions
apiVersionstring
Defaultv1
caCertDatastring
caCertFilestring
clientCertDatastring
clientCertFilestring
clientKeyAlgostring
DefaultRSA
clientKeyDatastring
clientKeyFilestring
clientKeyPassphrasestring
disableHostnameVerificationbooleanstring
keyStoreFilestring
keyStorePassphrasestring
masterUrlstring
Defaulthttps://kubernetes.default.svc
namespacestring
oauthTokenstring
oauthTokenProvider
outputstring
task
passwordstring
trustCertsbooleanstring
trustStoreFilestring
trustStorePassphrasestring
usernamestring
Default{ "image": "busybox" }
Definitions
defaultSpecobject
imagestring
Defaultbusybox
resourcesobject
SubTypestring
Defaultdefault
SubTypestring
DefaultSTRATEGIC_MERGE
Possible Values
STRATEGIC_MERGEJSON_MERGEJSON_PATCH
DefaultPT1H
DefaultPT0S
DefaultPT10M
Definitions
annotationsobject
SubTypestring
clusterNamestring
creationTimestampstring
Formatdate-time
deletionGracePeriodSecondsinteger
deletionTimestampstring
Formatdate-time
finalizersarray
SubTypestring
generateNamestring
generationinteger
labelsobject
SubTypestring
managedFieldsarray
apiVersionstring
fieldsTypestring
fieldsV1
managerstring
operationstring
subresourcestring
timestring
namestring
namespacestring
ownerReferencesarray
apiVersionstring
blockOwnerDeletionboolean
controllerboolean
kindstring
namestring
uidstring
resourceVersionstring
selfLinkstring
uidstring
Definitions
statusobject