Interface ICluster

All Superinterfaces:
IConnectable, software.constructs.IConstruct, software.constructs.IDependable, IResource, software.amazon.jsii.JsiiSerializable
All Known Subinterfaces:
ICluster.Jsii$Default
All Known Implementing Classes:
Cluster, FargateCluster, ICluster.Jsii$Proxy

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-27T16:50:57.380Z") @Stability(Stable) public interface ICluster extends software.amazon.jsii.JsiiSerializable, IResource, IConnectable
An EKS cluster.
  • Method Details

    • getClusterArn

      @Stability(Stable) @NotNull String getClusterArn()
      The unique ARN assigned to the service by AWS in the form of arn:aws:eks:.
    • getClusterCertificateAuthorityData

      @Stability(Stable) @NotNull String getClusterCertificateAuthorityData()
      The certificate-authority-data for your cluster.
    • getClusterEncryptionConfigKeyArn

      @Stability(Stable) @NotNull String getClusterEncryptionConfigKeyArn()
      Amazon Resource Name (ARN) or alias of the customer master key (CMK).
    • getClusterEndpoint

      @Stability(Stable) @NotNull String getClusterEndpoint()
      The API Server endpoint URL.
    • getClusterName

      @Stability(Stable) @NotNull String getClusterName()
      The physical name of the Cluster.
    • getClusterSecurityGroup

      @Stability(Stable) @NotNull ISecurityGroup getClusterSecurityGroup()
      The cluster security group that was created by Amazon EKS for the cluster.
    • getClusterSecurityGroupId

      @Stability(Stable) @NotNull String getClusterSecurityGroupId()
      The id of the cluster security group that was created by Amazon EKS for the cluster.
    • getOpenIdConnectProvider

      @Stability(Stable) @NotNull IOpenIdConnectProvider getOpenIdConnectProvider()
      The Open ID Connect Provider of the cluster used to configure Service Accounts.
    • getPrune

      @Stability(Stable) @NotNull Boolean getPrune()
      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.

    • getVpc

      @Stability(Stable) @NotNull IVpc getVpc()
      The VPC in which this Cluster was created.
    • getAuthenticationMode

      @Stability(Stable) @Nullable default AuthenticationMode getAuthenticationMode()
      The authentication mode for the cluster.

      Default: AuthenticationMode.CONFIG_MAP

    • getAwscliLayer

      @Stability(Stable) @Nullable default ILayerVersion getAwscliLayer()
      An AWS Lambda layer that contains the aws CLI.

      If not defined, a default layer will be used containing the AWS CLI 1.x.

    • getClusterHandlerSecurityGroup

      @Stability(Stable) @Nullable default ISecurityGroup getClusterHandlerSecurityGroup()
      A security group to associate with the Cluster Handler's Lambdas.

      The Cluster Handler's Lambdas are responsible for calling AWS's EKS API.

      Requires placeClusterHandlerInVpc to be set to true.

      Default: - No security group.

    • getEksPodIdentityAgent

      @Stability(Stable) @Nullable default IAddon getEksPodIdentityAgent()
      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.

    • getIpFamily

      @Stability(Stable) @Nullable default IpFamily getIpFamily()
      Specify which IP family is used to assign Kubernetes pod and service IP addresses.

      Default: - IpFamily.IP_V4

      See Also:
    • getKubectlEnvironment

      @Stability(Stable) @Nullable default Map<String,String> getKubectlEnvironment()
      Custom environment variables when running kubectl against this cluster.
    • getKubectlLambdaRole

      @Stability(Stable) @Nullable default IRole getKubectlLambdaRole()
      An IAM role that can perform kubectl operations against this cluster.

      The role should be mapped to the system:masters Kubernetes RBAC role.

      This role is directly passed to the lambda handler that sends Kube Ctl commands to the cluster.

    • getKubectlLayer

      @Stability(Stable) @Nullable default ILayerVersion getKubectlLayer()
      An AWS Lambda layer that includes kubectl and helm.

      If not defined, a default layer will be used containing Kubectl 1.20 and Helm 3.8

    • getKubectlMemory

      @Stability(Stable) @Nullable default Size getKubectlMemory()
      Amount of memory to allocate to the provider's lambda function.
    • getKubectlPrivateSubnets

      @Stability(Stable) @Nullable default List<ISubnet> getKubectlPrivateSubnets()
      Subnets to host the kubectl compute resources.

      If this is undefined, the k8s endpoint is expected to be accessible publicly.

    • getKubectlProvider

      @Stability(Stable) @Nullable default IKubectlProvider getKubectlProvider()
      Kubectl Provider for issuing kubectl commands against it.

      If not defined, a default provider will be used

    • getKubectlRole

      @Stability(Stable) @Nullable default IRole getKubectlRole()
      An IAM role that can perform kubectl operations against this cluster.

      The role should be mapped to the system:masters Kubernetes RBAC role.

    • getKubectlSecurityGroup

      @Stability(Stable) @Nullable default ISecurityGroup getKubectlSecurityGroup()
      A security group to use for kubectl execution.

      If this is undefined, the k8s endpoint is expected to be accessible publicly.

    • getOnEventLayer

      @Stability(Stable) @Nullable default ILayerVersion getOnEventLayer()
      An AWS Lambda layer that includes the NPM dependency proxy-agent.

      If not defined, a default layer will be used.

    • addCdk8sChart

      @Stability(Stable) @NotNull KubernetesManifest addCdk8sChart(@NotNull String id, @NotNull software.constructs.Construct chart, @Nullable KubernetesManifestOptions options)
      Defines a CDK8s chart in this cluster.

      Parameters:
      id - logical id of this chart. This parameter is required.
      chart - the cdk8s chart. This parameter is required.
      options -
      Returns:
      a KubernetesManifest construct representing the chart.
    • addCdk8sChart

      @Stability(Stable) @NotNull KubernetesManifest addCdk8sChart(@NotNull String id, @NotNull software.constructs.Construct chart)
      Defines a CDK8s chart in this cluster.

      Parameters:
      id - logical id of this chart. This parameter is required.
      chart - the cdk8s chart. This parameter is required.
      Returns:
      a KubernetesManifest construct representing the chart.
    • addHelmChart

      @Stability(Stable) @NotNull HelmChart addHelmChart(@NotNull String id, @NotNull HelmChartOptions options)
      Defines a Helm chart in this cluster.

      Parameters:
      id - logical id of this chart. This parameter is required.
      options - options of this chart. This parameter is required.
      Returns:
      a HelmChart construct
    • addManifest

      @Stability(Stable) @NotNull KubernetesManifest addManifest(@NotNull String id, @NotNull @NotNull Map<String,Object>... manifest)
      Defines a Kubernetes resource in this cluster.

      The manifest will be applied/deleted using kubectl as needed.

      Parameters:
      id - logical id of this manifest. This parameter is required.
      manifest - a list of Kubernetes resource specifications. This parameter is required.
      Returns:
      a KubernetesManifest object.
    • addServiceAccount

      @Stability(Stable) @NotNull ServiceAccount addServiceAccount(@NotNull String id, @Nullable ServiceAccountOptions options)
      Creates a new service account with corresponding IAM Role (IRSA).

      Parameters:
      id - logical id of service account. This parameter is required.
      options - service account options.
    • addServiceAccount

      @Stability(Stable) @NotNull ServiceAccount addServiceAccount(@NotNull String id)
      Creates a new service account with corresponding IAM Role (IRSA).

      Parameters:
      id - logical id of service account. This parameter is required.
    • connectAutoScalingGroupCapacity

      @Stability(Stable) void connectAutoScalingGroupCapacity(@NotNull AutoScalingGroup autoScalingGroup, @NotNull AutoScalingGroupOptions 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.

      Parameters:
      autoScalingGroup - [disable-awslint:ref-via-interface]. This parameter is required.
      options - options for adding auto scaling groups, like customizing the bootstrap script. This parameter is required.
      See Also: