interface ICluster
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Eks.V2.Alpha.ICluster |
![]() | github.com/aws/aws-cdk-go/awscdkeks-v2alpha/v2#ICluster |
![]() | software.amazon.awscdk.services.eks.v2.alpha.ICluster |
![]() | aws_cdk.aws_eks_v2_alpha.ICluster |
![]() | @aws-cdk/aws-eks-v2-alpha ยป ICluster |
Implemented by
Cluster
, Fargate
Obtainable from
Cluster
.fromClusterAttributes()
An EKS cluster.
Properties
Name | Type | Description |
---|---|---|
cluster | string | The unique ARN assigned to the service by AWS in the form of arn:aws:eks:. |
cluster | string | The certificate-authority-data for your cluster. |
cluster | string | Amazon Resource Name (ARN) or alias of the customer master key (CMK). |
cluster | string | The API Server endpoint URL. |
cluster | string | The physical name of the Cluster. |
cluster | ISecurity | The cluster security group that was created by Amazon EKS for the cluster. |
cluster | string | The id of the cluster security group that was created by Amazon EKS for the cluster. |
connections | Connections | The network connections associated with this resource. |
env | Resource | The environment this resource belongs to. |
node | Node | The tree node. |
open | IOpen | The Open ID Connect Provider of the cluster used to configure Service Accounts. |
prune | boolean | Indicates whether Kubernetes resources can be automatically pruned. |
stack | Stack | The stack in which this resource is defined. |
vpc | IVpc | The VPC in which this Cluster was created. |
eks | IAddon | The EKS Pod Identity Agent addon for the EKS cluster. |
ip | Ip | Specify which IP family is used to assign Kubernetes pod and service IP addresses. |
kubectl | IKubectl | Kubectl Provider for issuing kubectl commands against it. |
kubectl | Kubectl | Options for creating the kubectl provider - a lambda function that executes kubectl and helm against the cluster. |
clusterArn
Type:
string
The unique ARN assigned to the service by AWS in the form of arn:aws:eks:.
clusterCertificateAuthorityData
Type:
string
The certificate-authority-data for your cluster.
clusterEncryptionConfigKeyArn
Type:
string
Amazon Resource Name (ARN) or alias of the customer master key (CMK).
clusterEndpoint
Type:
string
The API Server endpoint URL.
clusterName
Type:
string
The physical name of the Cluster.
clusterSecurityGroup
Type:
ISecurity
The cluster security group that was created by Amazon EKS for the cluster.
clusterSecurityGroupId
Type:
string
The id of the cluster security group that was created by Amazon EKS for the cluster.
connections
Type:
Connections
The network connections associated with this resource.
env
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
node
Type:
Node
The tree node.
openIdConnectProvider
Type:
IOpen
The Open ID Connect Provider of the cluster used to configure Service Accounts.
prune
Type:
boolean
Indicates whether Kubernetes resources 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 apply
operation with the --prune
switch.
stack
Type:
Stack
The stack in which this resource is defined.
vpc
Type:
IVpc
The VPC in which this Cluster was created.
eksPodIdentityAgent?
Type:
IAddon
(optional)
The EKS Pod Identity Agent addon for the EKS cluster.
The EKS Pod Identity Agent is responsible for managing the temporary credentials used by pods in the cluster to access AWS resources. It runs as a DaemonSet on each node and provides the necessary credentials to the pods based on their associated service account.
This property returns the CfnAddon
resource representing the EKS Pod Identity
Agent addon. If the addon has not been created yet, it will be created and
returned.
ipFamily?
Type:
Ip
(optional, default: IpFamily.IP_V4)
Specify which IP family is used to assign Kubernetes pod and service IP addresses.
kubectlProvider?
Type:
IKubectl
(optional)
Kubectl Provider for issuing kubectl commands against it.
If not defined, a default provider will be used
kubectlProviderOptions?
Type:
Kubectl
(optional)
Options for creating the kubectl provider - a lambda function that executes kubectl
and helm
against the cluster.
If defined, kubectlLayer
is a required property.
If not defined, kubectl provider will not be created by default.
Methods
Name | Description |
---|---|
add | Defines a CDK8s chart in this cluster. |
add | Defines a Helm chart in this cluster. |
add | Defines a Kubernetes resource in this cluster. |
add | Creates a new service account with corresponding IAM Role (IRSA). |
apply | Apply the given removal policy to this resource. |
connect | Connect capacity in the form of an existing AutoScalingGroup to the EKS cluster. |
addCdk8sChart(id, chart, options?)
public addCdk8sChart(id: string, chart: Construct, options?: KubernetesManifestOptions): KubernetesManifest
Parameters
- id
string
โ logical id of this chart. - chart
Construct
โ the cdk8s chart. - options
Kubernetes
Manifest Options
Returns
Defines a CDK8s chart in this cluster.
addHelmChart(id, options)
public addHelmChart(id: string, options: HelmChartOptions): HelmChart
Parameters
- id
string
โ logical id of this chart. - options
Helm
โ options of this chart.Chart Options
Returns
Defines a Helm chart in this cluster.
addManifest(id, ...manifest)
public addManifest(id: string, ...manifest: { [string]: any }[]): KubernetesManifest
Parameters
- id
string
โ logical id of this manifest. - manifest
{ [string]: any }
โ a list of Kubernetes resource specifications.
Returns
Defines a Kubernetes resource in this cluster.
The manifest will be applied/deleted using kubectl as needed.
addServiceAccount(id, options?)
public addServiceAccount(id: string, options?: ServiceAccountOptions): ServiceAccount
Parameters
- id
string
โ logical id of service account. - options
Service
โ service account options.Account Options
Returns
Creates a new service account with corresponding IAM Role (IRSA).
applyRemovalPolicy(policy)
public applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
Removal
Policy
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY
), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN
).
connectAutoScalingGroupCapacity(autoScalingGroup, options)
public connectAutoScalingGroupCapacity(autoScalingGroup: AutoScalingGroup, options: AutoScalingGroupOptions): void
Parameters
- autoScalingGroup
Auto
โ [disable-awslint:ref-via-interface].Scaling Group - options
Auto
โ options for adding auto scaling groups, like customizing the bootstrap script.Scaling Group Options
Connect capacity in the form of an existing AutoScalingGroup to the EKS cluster.
The AutoScalingGroup must be running an EKS-optimized AMI containing the /etc/eks/bootstrap.sh script. This method will configure Security Groups, add the right policies to the instance role, apply the right tags, and add the required user data to the instance's launch configuration.
Spot instances will be labeled lifecycle=Ec2Spot
and tainted with PreferNoSchedule
.
If kubectl is enabled, the
spot interrupt handler
daemon will be installed on all spot instances to handle
EC2 Spot Instance Termination Notices.
Prefer to use addAutoScalingGroupCapacity
if possible.
See also: https://docs.aws.amazon.com/eks/latest/userguide/launch-workers.html