Patch
Patch
yaml
type: "io.kestra.plugin.kubernetes.kubectl.Patch"Examples
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
patch *Requiredstring
resourceName *Requiredstring
resourceType *Requiredstring
apiGroup string
apiVersion string
connection Non-dynamic
Definitions
io.kestra.plugin.kubernetes.models.Connection
apiVersionstring
Default
v1caCertDatastring
caCertFilestring
clientCertDatastring
clientCertFilestring
clientKeyAlgostring
Default
RSAclientKeyDatastring
clientKeyFilestring
clientKeyPassphrasestring
disableHostnameVerificationbooleanstring
keyStoreFilestring
keyStorePassphrasestring
masterUrlstring
Default
https://kubernetes.default.svcnamespacestring
oauthTokenstring
oauthTokenProvider
io.kestra.plugin.kubernetes.models.OAuthTokenProvider
outputstring
task
passwordstring
trustCertsbooleanstring
trustStoreFilestring
trustStorePassphrasestring
usernamestring
containerDefaultSpec object
fileSidecar Non-dynamic
Default
{
"image": "busybox"
} Definitions
io.kestra.plugin.kubernetes.models.SideCar
defaultSpecobject
imagestring
Default
busyboxresourcesobject
inputFiles object
SubTypestring
namespace string
Default
defaultoutputFiles array
SubTypestring
patchStrategy string
Default
STRATEGIC_MERGEPossible Values
STRATEGIC_MERGEJSON_MERGEJSON_PATCHwaitRunning string
Default
PT1HwaitUntilReady string
Default
PT0SwaitUntilRunning string
Default
PT10MOutputs
metadata
Definitions
io.kestra.plugin.kubernetes.models.Metadata
annotationsobject
SubTypestring
clusterNamestring
creationTimestampstring
Format
date-timedeletionGracePeriodSecondsinteger
deletionTimestampstring
Format
date-timefinalizersarray
SubTypestring
generateNamestring
generationinteger
labelsobject
SubTypestring
managedFieldsarray
io.fabric8.kubernetes.api.model.ManagedFieldsEntry
apiVersionstring
fieldsTypestring
fieldsV1
io.fabric8.kubernetes.api.model.FieldsV1
managerstring
operationstring
subresourcestring
timestring
namestring
namespacestring
ownerReferencesarray
io.fabric8.kubernetes.api.model.OwnerReference
apiVersionstring
blockOwnerDeletionboolean
controllerboolean
kindstring
namestring
uidstring
resourceVersionstring
selfLinkstring
uidstring
status
Definitions
io.kestra.plugin.kubernetes.models.ResourceStatus
statusobject