Skip to content
v2.274.0

KubernetesPatchProps Struct ​

Properties for KubernetesPatch.

Example ​

ts
declare const cluster: eks.Cluster;
new eks.KubernetesPatch(this, 'hello-kub-deployment-label', {
  cluster,
  resourceName: "deployment/hello-kubernetes",
  applyPatch: { spec: { replicas: 5 } },
  restorePatch: { spec: { replicas: 3 } },
})

Properties ​

applyPatch{ [key: string]: any }apply_patchtyping.Mapping[str, Any]applyPatchMap<String, Object>ApplyPatchIDictionary<string, object>ApplyPatch*map[string]interface{}required#
The JSON object to pass to `kubectl patch` when the resource is created/updated.
clusterIClusterclusterIClusterclusterIClusterClusterIClusterClusterIClusterrequired#
The cluster to apply the patch to.

[disable-awslint:ref-via-interface]

patchTypeoptionalPatchTypepatch_typeoptionalPatchTypepatchTypeoptionalPatchTypePatchTypeoptionalPatchTypePatchTypeoptionalPatchType= PatchType.STRATEGIC#
The patch type to pass to `kubectl patch`.

The default type used by kubectl patch is "strategic".

removalPolicyoptionalRemovalPolicyremoval_policyoptionalRemovalPolicyremovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicy= RemovalPolicy.DESTROY#
The removal policy applied to the custom resource that manages the Kubernetes patch.
notes

The removal policy controls what happens to the resource if it stops being managed by CloudFormation. This can happen in one of three situations:

  • The resource is removed from the template, so CloudFormation stops managing it
  • A change to the resource is made that requires it to be replaced, so CloudFormation stops managing it
  • The stack is deleted, so CloudFormation stops managing all resources in it
resourceNamestringresource_namestrresourceNameStringResourceNamestringResourceName*stringrequired#
The full name of the resource to patch (e.g. `deployment/coredns`).
resourceNamespaceoptionalstringresource_namespaceoptionalstrresourceNamespaceoptionalStringResourceNamespaceoptionalstringResourceNamespaceoptional*string= "default"#
The kubernetes API namespace.
restorePatch{ [key: string]: any }restore_patchtyping.Mapping[str, Any]restorePatchMap<String, Object>RestorePatchIDictionary<string, object>RestorePatch*map[string]interface{}required#
The JSON object to pass to `kubectl patch` when the resource is removed.