# BootstrapOptions

EKS node bootstrapping options.

- Source: [`aws-eks/lib/cluster.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-eks/lib/cluster.ts#L2640)

## Example

TypeScript:

```ts
declare const cluster: eks.Cluster;
cluster.addAutoScalingGroupCapacity('spot', {
  instanceType: new ec2.InstanceType('t3.large'),
  minCapacity: 2,
  bootstrapOptions: {
    kubeletExtraArgs: '--node-labels foo=bar,goo=far',
    awsApiRetryAttempts: 5,
  },
});
```

Python:

```python
# cluster: eks.Cluster

cluster.add_auto_scaling_group_capacity("spot",
    instance_type=ec2.InstanceType("t3.large"),
    min_capacity=2,
    bootstrap_options=eks.BootstrapOptions(
        kubelet_extra_args="--node-labels foo=bar,goo=far",
        aws_api_retry_attempts=5
    )
)
```

Java:

```java
Cluster cluster;

cluster.addAutoScalingGroupCapacity("spot", AutoScalingGroupCapacityOptions.builder()
        .instanceType(new InstanceType("t3.large"))
        .minCapacity(2)
        .bootstrapOptions(BootstrapOptions.builder()
                .kubeletExtraArgs("--node-labels foo=bar,goo=far")
                .awsApiRetryAttempts(5)
                .build())
        .build());
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
Cluster cluster;

cluster.AddAutoScalingGroupCapacity("spot", new AutoScalingGroupCapacityOptions {
    InstanceType = new InstanceType("t3.large"),
    MinCapacity = 2,
    BootstrapOptions = new BootstrapOptions {
        KubeletExtraArgs = "--node-labels foo=bar,goo=far",
        AwsApiRetryAttempts = 5
    }
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var cluster Cluster

cluster.AddAutoScalingGroupCapacity(jsii.String("spot"), &AutoScalingGroupCapacityOptions{
	InstanceType: ec2.NewInstanceType(jsii.String("t3.large")),
	MinCapacity: jsii.Number(2),
	BootstrapOptions: &BootstrapOptions{
		KubeletExtraArgs: jsii.String("--node-labels foo=bar,goo=far"),
		AwsApiRetryAttempts: jsii.Number(5),
	},
})
```

## Properties

- `additionalArgs`: string = none — Additional command line arguments to pass to the `/etc/eks/bootstrap.sh` command.

- `awsApiRetryAttempts`: number = 3 — Number of retry attempts for AWS API call (DescribeCluster).

- `dnsClusterIp`: string — Overrides the IP address to use for DNS queries within the cluster.

  **Default:** 10.100.0.10 or 172.20.0.10 based on the IP address of the primary interface.

- `dockerConfigJson`: string = none — The contents of the `/etc/docker/daemon.json` file. Useful if you want a custom config differing from the default one in the EKS AMI.

- `enableDockerBridge`: boolean = false — Restores the docker default bridge network.

- `kubeletExtraArgs`: string = none — Extra arguments to add to the kubelet. Useful for adding labels or taints.

  For example, `--node-labels foo=bar,goo=far`.

- `useMaxPods`: boolean = true — Sets `--max-pods` for the kubelet based on the capacity of the EC2 instance.
