KubernetesPatchProps

class aws_cdk.aws_eks_v2_alpha.KubernetesPatchProps(*, apply_patch, cluster, resource_name, restore_patch, patch_type=None, removal_policy=None, resource_namespace=None)

Bases: object

(experimental) Properties for KubernetesPatch.

Parameters:
  • apply_patch (Mapping[str, Any]) – (experimental) The JSON object to pass to kubectl patch when the resource is created/updated.

  • cluster (ICluster) – (experimental) The cluster to apply the patch to. [disable-awslint:ref-via-interface]

  • resource_name (str) – (experimental) The full name of the resource to patch (e.g. deployment/coredns).

  • restore_patch (Mapping[str, Any]) – (experimental) The JSON object to pass to kubectl patch when the resource is removed.

  • patch_type (Optional[PatchType]) – (experimental) The patch type to pass to kubectl patch. The default type used by kubectl patch is “strategic”. Default: PatchType.STRATEGIC

  • removal_policy (Optional[RemovalPolicy]) – (experimental) The removal policy applied to the custom resource that manages the Kubernetes patch. 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 Default: RemovalPolicy.DESTROY

  • resource_namespace (Optional[str]) – (experimental) The kubernetes API namespace. Default: “default”

Stability:

experimental

ExampleMetadata:

infused

Example:

# cluster: eks.Cluster

eks.KubernetesPatch(self, "hello-kub-deployment-label",
    cluster=cluster,
    resource_name="deployment/hello-kubernetes",
    apply_patch={"spec": {"replicas": 5}},
    restore_patch={"spec": {"replicas": 3}}
)

Attributes

apply_patch

(experimental) The JSON object to pass to kubectl patch when the resource is created/updated.

Stability:

experimental

cluster

(experimental) The cluster to apply the patch to.

[disable-awslint:ref-via-interface]

Stability:

experimental

patch_type

(experimental) The patch type to pass to kubectl patch.

The default type used by kubectl patch is “strategic”.

Default:

PatchType.STRATEGIC

Stability:

experimental

removal_policy

(experimental) The removal policy applied to the custom resource that manages the Kubernetes patch.

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

Default:

RemovalPolicy.DESTROY

Stability:

experimental

resource_name

(experimental) The full name of the resource to patch (e.g. deployment/coredns).

Stability:

experimental

resource_namespace

(experimental) The kubernetes API namespace.

Default:

“default”

Stability:

experimental

restore_patch

(experimental) The JSON object to pass to kubectl patch when the resource is removed.

Stability:

experimental