Skip to content
v2.278.0

TaintEffect Enum ​

Effect types of kubernetes node taint.

Note: These values are specifically for AWS EKS NodeGroups and use the AWS API format. When using AWS CLI or API, taint effects must be NO_SCHEDULE, PREFER_NO_SCHEDULE, or NO_EXECUTE. When using Kubernetes directly or kubectl, taint effects must be NoSchedule, PreferNoSchedule, or NoExecute.

For Kubernetes manifests (like Karpenter NodePools), use string literals with PascalCase format:

  • 'NoSchedule' instead of TaintEffect.NO_SCHEDULE
  • 'PreferNoSchedule' instead of TaintEffect.PREFER_NO_SCHEDULE
  • 'NoExecute' instead of TaintEffect.NO_EXECUTE

Example ​

ts
declare const cluster: eks.Cluster;
cluster.addNodegroupCapacity('custom-node-group', {
  instanceTypes: [new ec2.InstanceType('m5.large')],
  taints: [
    {
      effect: eks.TaintEffect.NO_SCHEDULE,
      key: 'foo',
      value: 'bar',
    },
  ],
});
python
# cluster: eks.Cluster

cluster.add_nodegroup_capacity("custom-node-group",
    instance_types=[ec2.InstanceType("m5.large")],
    taints=[eks.TaintSpec(
        effect=eks.TaintEffect.NO_SCHEDULE,
        key="foo",
        value="bar"
    )
    ]
)
java
Cluster cluster;

cluster.addNodegroupCapacity("custom-node-group", NodegroupOptions.builder()
        .instanceTypes(List.of(new InstanceType("m5.large")))
        .taints(List.of(TaintSpec.builder()
                .effect(TaintEffect.NO_SCHEDULE)
                .key("foo")
                .value("bar")
                .build()))
        .build());
csharp
// Install: dotnet add package Amazon.CDK.Lib
Cluster cluster;

cluster.AddNodegroupCapacity("custom-node-group", new NodegroupOptions {
    InstanceTypes = new [] { new InstanceType("m5.large") },
    Taints = new [] { new TaintSpec {
        Effect = TaintEffect.NO_SCHEDULE,
        Key = "foo",
        Value = "bar"
    } }
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var cluster Cluster

cluster.AddNodegroupCapacity(jsii.String("custom-node-group"), &NodegroupOptions{
	InstanceTypes: []InstanceType{
		ec2.NewInstanceType(jsii.String("m5.large")),
	},
	Taints: []TaintSpec{
		&TaintSpec{
			Effect: eks.TaintEffect_NO_SCHEDULE,
			Key: jsii.String("foo"),
			Value: jsii.String("bar"),
		},
	},
})

Members ​

MemberDescription
NO_SCHEDULENoSchedule.
PREFER_NO_SCHEDULEPreferNoSchedule.
NO_EXECUTENoExecute.

Referenced by ​