ClusterProps
- class aws_cdk.aws_eks_v2_alpha.ClusterProps(*, version, alb_controller=None, cluster_logging=None, cluster_name=None, core_dns_compute_type=None, endpoint_access=None, ip_family=None, kubectl_provider_options=None, masters_role=None, prune=None, remote_node_networks=None, remote_pod_networks=None, removal_policy=None, role=None, secrets_encryption_key=None, security_group=None, service_ipv4_cidr=None, tags=None, vpc=None, vpc_subnets=None, bootstrap_cluster_creator_admin_permissions=None, bootstrap_self_managed_addons=None, compute=None, default_capacity=None, default_capacity_instance=None, default_capacity_type=None, output_config_command=None)
Bases:
ClusterCommonOptions(experimental) Properties for configuring a standard EKS cluster (non-Fargate).
- Parameters:
version (
KubernetesVersion) – (experimental) The Kubernetes version to run in the cluster.alb_controller (
Union[AlbControllerOptions,Dict[str,Any],None]) – (experimental) Install the AWS Load Balancer Controller onto the cluster. Default: - The controller is not installed.cluster_logging (
Optional[Sequence[ClusterLoggingTypes]]) – (experimental) The cluster log types which you want to enable. Default: - nonecluster_name (
Optional[str]) – (experimental) Name for the cluster. Default: - Automatically generated namecore_dns_compute_type (
Optional[CoreDnsComputeType]) – (experimental) Controls the “eks.amazonaws.com/compute-type” annotation in the CoreDNS configuration on your cluster to determine which compute type to use for CoreDNS. Default: CoreDnsComputeType.EC2 (forFargateClusterthe default is FARGATE)endpoint_access (
Optional[EndpointAccess]) – (experimental) Configure access to the Kubernetes API server endpoint.. Default: EndpointAccess.PUBLIC_AND_PRIVATEip_family (
Optional[IpFamily]) – (experimental) Specify which IP family is used to assign Kubernetes pod and service IP addresses. Default: IpFamily.IP_V4kubectl_provider_options (
Union[KubectlProviderOptions,Dict[str,Any],None]) – (experimental) Options for creating the kubectl provider - a lambda function that executeskubectlandhelmagainst the cluster. If defined,kubectlLayeris a required property. If not defined, kubectl provider will not be created by default.masters_role (
Optional[IRole]) – (experimental) An IAM role that will be added to thesystem:mastersKubernetes RBAC group. Default: - no masters role.prune (
Optional[bool]) – (experimental) Indicates whether Kubernetes resources added throughaddManifest()can be automatically pruned. When this is enabled (default), prune labels will be allocated and injected to each resource. These labels will then be used when issuing thekubectl applyoperation with the--pruneswitch. Default: trueremote_node_networks (
Optional[Sequence[Union[RemoteNodeNetwork,Dict[str,Any]]]]) – (experimental) IPv4 CIDR blocks defining the expected address range of hybrid nodes that will join the cluster. Default: - noneremote_pod_networks (
Optional[Sequence[Union[RemotePodNetwork,Dict[str,Any]]]]) – (experimental) IPv4 CIDR blocks for Pods running Kubernetes webhooks on hybrid nodes. Default: - noneremoval_policy (
Optional[RemovalPolicy]) – (experimental) The removal policy applied to all CloudFormation resources created by this construct when they are no longer 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. This affects the EKS cluster itself, associated IAM roles, node groups, security groups, VPC and any other CloudFormation resources managed by this construct. Default: - Resources will be deleted.role (
Optional[IRole]) – (experimental) Role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf. Default: - A role is automatically created for yousecrets_encryption_key (
Optional[IKeyRef]) – (experimental) KMS secret for envelope encryption for Kubernetes secrets. Default: - By default, Kubernetes stores all secret object data within etcd and all etcd volumes used by Amazon EKS are encrypted at the disk-level using AWS-Managed encryption keys.security_group (
Optional[ISecurityGroup]) – (experimental) Security Group to use for Control Plane ENIs. Default: - A security group is automatically createdservice_ipv4_cidr (
Optional[str]) – (experimental) The CIDR block to assign Kubernetes service IP addresses from. Default: - Kubernetes assigns addresses from either the 10.100.0.0/16 or 172.20.0.0/16 CIDR blockstags (
Optional[Mapping[str,str]]) – (experimental) The tags assigned to the EKS cluster. Default: - nonevpc (
Optional[IVpc]) – (experimental) The VPC in which to create the Cluster. Default: - a VPC with default configuration will be created and can be accessed throughcluster.vpc.vpc_subnets (
Optional[Sequence[Union[SubnetSelection,Dict[str,Any]]]]) – (experimental) Where to place EKS Control Plane ENIs. For example, to only select private subnets, supply the following:vpcSubnets: [{ subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS }]Default: - All public and private subnetsbootstrap_cluster_creator_admin_permissions (
Optional[bool]) – (experimental) Whether or not IAM principal of the cluster creator was set as a cluster admin access entry during cluster creation time. Changing this value after the cluster has been created will result in the cluster being replaced. Default: truebootstrap_self_managed_addons (
Optional[bool]) – (experimental) If you set this value to False when creating a cluster, the default networking add-ons will not be installed. The default networking addons include vpc-cni, coredns, and kube-proxy. Use this option when you plan to install third-party alternative add-ons or self-manage the default networking add-ons. Changing this value after the cluster has been created will result in the cluster being replaced. Default: true if the mode is not EKS Auto Modecompute (
Union[ComputeConfig,Dict[str,Any],None]) – (experimental) Configuration for compute settings in Auto Mode. When enabled, EKS will automatically manage compute resources. Default: - Auto Mode compute disableddefault_capacity (
Union[int,float,None]) – (experimental) Number of instances to allocate as an initial capacity for this cluster. Instance type can be configured throughdefaultCapacityInstanceType, which defaults tom5.large. Usecluster.addAutoScalingGroupCapacityto add additional customized capacity. Set this to0is you wish to avoid the initial capacity allocation. Default: 2default_capacity_instance (
Optional[InstanceType]) – (experimental) The instance type to use for the default capacity. This will only be taken into account ifdefaultCapacityis > 0. Default: m5.largedefault_capacity_type (
Optional[DefaultCapacityType]) – (experimental) The default capacity type for the cluster. Default: AUTOMODEoutput_config_command (
Optional[bool]) – (experimental) Determines whether a CloudFormation output with theaws eks update-kubeconfigcommand will be synthesized. This command will include the cluster name and, if applicable, the ARN of the masters IAM role. Default: true
- Stability:
experimental
- ExampleMetadata:
infused
Example:
cluster = eks.Cluster(self, "ManagedNodeCluster", version=eks.KubernetesVersion.V1_34, default_capacity_type=eks.DefaultCapacityType.NODEGROUP ) # Add a Fargate Profile for specific workloads (e.g., default namespace) cluster.add_fargate_profile("FargateProfile", selectors=[eks.Selector(namespace="default") ] )
Attributes
- alb_controller
(experimental) Install the AWS Load Balancer Controller onto the cluster.
- Default:
The controller is not installed.
- See:
https://kubernetes-sigs.github.io/aws-load-balancer-controller
- Stability:
experimental
- bootstrap_cluster_creator_admin_permissions
(experimental) Whether or not IAM principal of the cluster creator was set as a cluster admin access entry during cluster creation time.
Changing this value after the cluster has been created will result in the cluster being replaced.
- Default:
true
- Stability:
experimental
- bootstrap_self_managed_addons
(experimental) If you set this value to False when creating a cluster, the default networking add-ons will not be installed.
The default networking addons include vpc-cni, coredns, and kube-proxy. Use this option when you plan to install third-party alternative add-ons or self-manage the default networking add-ons.
Changing this value after the cluster has been created will result in the cluster being replaced.
- Default:
true if the mode is not EKS Auto Mode
- Stability:
experimental
- cluster_logging
(experimental) The cluster log types which you want to enable.
- Default:
none
- Stability:
experimental
- cluster_name
(experimental) Name for the cluster.
- Default:
Automatically generated name
- Stability:
experimental
- compute
(experimental) Configuration for compute settings in Auto Mode.
When enabled, EKS will automatically manage compute resources.
- Default:
Auto Mode compute disabled
- Stability:
experimental
- core_dns_compute_type
(experimental) Controls the “eks.amazonaws.com/compute-type” annotation in the CoreDNS configuration on your cluster to determine which compute type to use for CoreDNS.
- Default:
CoreDnsComputeType.EC2 (for
FargateClusterthe default is FARGATE)- Stability:
experimental
- default_capacity
(experimental) Number of instances to allocate as an initial capacity for this cluster.
Instance type can be configured through
defaultCapacityInstanceType, which defaults tom5.large.Use
cluster.addAutoScalingGroupCapacityto add additional customized capacity. Set this to0is you wish to avoid the initial capacity allocation.- Default:
2
- Stability:
experimental
- default_capacity_instance
(experimental) The instance type to use for the default capacity.
This will only be taken into account if
defaultCapacityis > 0.- Default:
m5.large
- Stability:
experimental
- default_capacity_type
(experimental) The default capacity type for the cluster.
- Default:
AUTOMODE
- Stability:
experimental
- endpoint_access
(experimental) Configure access to the Kubernetes API server endpoint..
- Default:
EndpointAccess.PUBLIC_AND_PRIVATE
- See:
https://docs.aws.amazon.com/eks/latest/userguide/cluster-endpoint.html
- Stability:
experimental
- ip_family
(experimental) Specify which IP family is used to assign Kubernetes pod and service IP addresses.
- Default:
IpFamily.IP_V4
- See:
- Stability:
experimental
- kubectl_provider_options
(experimental) Options for creating the kubectl provider - a lambda function that executes
kubectlandhelmagainst the cluster.If defined,
kubectlLayeris a required property.If not defined, kubectl provider will not be created by default.
- Stability:
experimental
- masters_role
(experimental) An IAM role that will be added to the
system:mastersKubernetes RBAC group.- Default:
no masters role.
- See:
https://kubernetes.io/docs/reference/access-authn-authz/rbac/#default-roles-and-role-bindings
- Stability:
experimental
- output_config_command
(experimental) Determines whether a CloudFormation output with the
aws eks update-kubeconfigcommand will be synthesized.This command will include the cluster name and, if applicable, the ARN of the masters IAM role.
- Default:
true
- Stability:
experimental
- prune
(experimental) Indicates whether Kubernetes resources added through
addManifest()can be automatically pruned.When this is enabled (default), prune labels will be allocated and injected to each resource. These labels will then be used when issuing the
kubectl applyoperation with the--pruneswitch.- Default:
true
- Stability:
experimental
- remote_node_networks
(experimental) IPv4 CIDR blocks defining the expected address range of hybrid nodes that will join the cluster.
- Default:
none
- Stability:
experimental
- remote_pod_networks
(experimental) IPv4 CIDR blocks for Pods running Kubernetes webhooks on hybrid nodes.
- Default:
none
- Stability:
experimental
- removal_policy
(experimental) The removal policy applied to all CloudFormation resources created by this construct when they are no longer 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.
This affects the EKS cluster itself, associated IAM roles, node groups, security groups, VPC and any other CloudFormation resources managed by this construct.
- Default:
Resources will be deleted.
- Stability:
experimental
- role
(experimental) Role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf.
- Default:
A role is automatically created for you
- Stability:
experimental
- secrets_encryption_key
(experimental) KMS secret for envelope encryption for Kubernetes secrets.
- Default:
By default, Kubernetes stores all secret object data within etcd and
all etcd volumes used by Amazon EKS are encrypted at the disk-level using AWS-Managed encryption keys.
- Stability:
experimental
- security_group
(experimental) Security Group to use for Control Plane ENIs.
- Default:
A security group is automatically created
- Stability:
experimental
- service_ipv4_cidr
(experimental) The CIDR block to assign Kubernetes service IP addresses from.
- Default:
Kubernetes assigns addresses from either the
10.100.0.0/16 or 172.20.0.0/16 CIDR blocks
- tags
(experimental) The tags assigned to the EKS cluster.
- Default:
none
- Stability:
experimental
- version
(experimental) The Kubernetes version to run in the cluster.
- Stability:
experimental
- vpc
(experimental) The VPC in which to create the Cluster.
- Default:
a VPC with default configuration will be created and can be accessed through
cluster.vpc.
- Stability:
experimental
- vpc_subnets
(experimental) Where to place EKS Control Plane ENIs.
For example, to only select private subnets, supply the following:
vpcSubnets: [{ subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS }]- Default:
All public and private subnets
- Stability:
experimental