# KubernetesNetworkConfigProperty

The Kubernetes network configuration for the cluster.

- Source: Generated at build time
- Type last changed: v2.172.0 · 7 Dec 2024

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_eks as eks } from 'aws-cdk-lib';
const kubernetesNetworkConfigProperty: eks.CfnCluster.KubernetesNetworkConfigProperty = {
  elasticLoadBalancing: {
    enabled: false,
    gatewayApi: {
      crds: {
        managed: false,
      },
    },
  },
  ipFamily: 'ipFamily',
  serviceIpv4Cidr: 'serviceIpv4Cidr',
  serviceIpv6Cidr: 'serviceIpv6Cidr',
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_eks as eks

kubernetes_network_config_property = eks.CfnCluster.KubernetesNetworkConfigProperty(
    elastic_load_balancing=eks.CfnCluster.ElasticLoadBalancingProperty(
        enabled=False,
        gateway_api=eks.CfnCluster.GatewayApiProperty(
            crds=eks.CfnCluster.GatewayApiCrdsProperty(
                managed=False
            )
        )
    ),
    ip_family="ipFamily",
    service_ipv4_cidr="serviceIpv4Cidr",
    service_ipv6_cidr="serviceIpv6Cidr"
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.eks.*;

KubernetesNetworkConfigProperty kubernetesNetworkConfigProperty = KubernetesNetworkConfigProperty.builder()
        .elasticLoadBalancing(ElasticLoadBalancingProperty.builder()
                .enabled(false)
                .gatewayApi(GatewayApiProperty.builder()
                        .crds(GatewayApiCrdsProperty.builder()
                                .managed(false)
                                .build())
                        .build())
                .build())
        .ipFamily("ipFamily")
        .serviceIpv4Cidr("serviceIpv4Cidr")
        .serviceIpv6Cidr("serviceIpv6Cidr")
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EKS;

var kubernetesNetworkConfigProperty = new KubernetesNetworkConfigProperty {
    ElasticLoadBalancing = new ElasticLoadBalancingProperty {
        Enabled = false,
        GatewayApi = new GatewayApiProperty {
            Crds = new GatewayApiCrdsProperty {
                Managed = false
            }
        }
    },
    IpFamily = "ipFamily",
    ServiceIpv4Cidr = "serviceIpv4Cidr",
    ServiceIpv6Cidr = "serviceIpv6Cidr"
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

kubernetesNetworkConfigProperty := &KubernetesNetworkConfigProperty{
	ElasticLoadBalancing: &ElasticLoadBalancingProperty{
		Enabled: jsii.Boolean(false),
		GatewayApi: &GatewayApiProperty{
			Crds: &GatewayApiCrdsProperty{
				Managed: jsii.Boolean(false),
			},
		},
	},
	IpFamily: jsii.String("ipFamily"),
	ServiceIpv4Cidr: jsii.String("serviceIpv4Cidr"),
	ServiceIpv6Cidr: jsii.String("serviceIpv6Cidr"),
}
```

## Properties

- `elasticLoadBalancing`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnCluster.ElasticLoadBalancingProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_eks.CfnCluster.ElasticLoadBalancingProperty.html) — Request to enable or disable the load balancing capability on your EKS Auto Mode cluster.

  For more information, see EKS Auto Mode load balancing capability in the *Amazon EKS User Guide* .

- `ipFamily`: string — Specify which IP family is used to assign Kubernetes pod and service IP addresses.

  If you don't specify a value, `ipv4` is used by default. You can only specify an IP family when you create a cluster and can't change this value once the cluster is created. If you specify `ipv6` , the VPC and subnets that you specify for cluster creation must have both `IPv4` and `IPv6` CIDR blocks assigned to them. You can't specify `ipv6` for clusters in China Regions.

  You can only specify `ipv6` for `1.21` and later clusters that use version `1.10.1` or later of the Amazon VPC CNI add-on. If you specify `ipv6` , then ensure that your VPC meets the requirements listed in the considerations listed in [Assigning IPv6 addresses to pods and services](https://docs.aws.amazon.com/eks/latest/userguide/cni-ipv6.html) in the *Amazon EKS User Guide* . Kubernetes assigns services `IPv6` addresses from the unique local address range `(fc00::/7)` . You can't specify a custom `IPv6` CIDR block. Pod addresses are assigned from the subnet's `IPv6` CIDR.

- `serviceIpv4Cidr`: string — Don't specify a value if you select `ipv6` for *ipFamily* .

  The CIDR block to assign Kubernetes service IP addresses from. If you don't specify a block, Kubernetes assigns addresses from either the `10.100.0.0/16` or `172.20.0.0/16` CIDR blocks. We recommend that you specify a block that does not overlap with resources in other networks that are peered or connected to your VPC. The block must meet the following requirements:

  - Within one of the following private IP address blocks: `10.0.0.0/8` , `172.16.0.0/12` , or `192.168.0.0/16` .
  - Doesn't overlap with any CIDR block assigned to the VPC that you selected for VPC.
  - Between `/24` and `/12` .

  > You can only specify a custom CIDR block when you create a cluster. You can't change this value after the cluster is created.

- `serviceIpv6Cidr`: string — The CIDR block that Kubernetes pod and service IP addresses are assigned from if you created a 1.21 or later cluster with version 1.10.1 or later of the Amazon VPC CNI add-on and specified `ipv6` for *ipFamily* when you created the cluster. Kubernetes assigns service addresses from the unique local address range ( `fc00::/7` ) because you can't specify a custom IPv6 CIDR block when you create the cluster.
