@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-07T23:47:06.272Z") @Stability(value=Experimental) public class Cluster extends Resource implements ICluster
This is a fully managed cluster of API Servers (control-plane) The user is still required to create the worker nodes.
Example:
Cluster cluster;
// option 1: use a construct
// option 1: use a construct
HelmChart.Builder.create(this, "NginxIngress")
.cluster(cluster)
.chart("nginx-ingress")
.repository("https://helm.nginx.com/stable")
.namespace("kube-system")
.build();
// or, option2: use `addChart`
cluster.addChart("NginxIngress", HelmChartOptions.builder()
.chart("nginx-ingress")
.repository("https://helm.nginx.com/stable")
.namespace("kube-system")
.build());
| Modifier and Type | Class and Description |
|---|---|
static class |
Cluster.Builder
(experimental) A fluent builder for
Cluster. |
software.amazon.jsii.JsiiObject.InitializationModeICluster.Jsii$Default, ICluster.Jsii$Proxy| Modifier | Constructor and Description |
|---|---|
|
Cluster(Construct scope,
String id)
(experimental) Initiates an EKS Cluster with the supplied arguments.
|
|
Cluster(Construct scope,
String id,
ClusterProps props)
(experimental) Initiates an EKS Cluster with the supplied arguments.
|
protected |
Cluster(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Cluster(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAutoScalingGroup(AutoScalingGroup autoScalingGroup,
AutoScalingGroupOptions options)
(experimental) Add compute capacity to this EKS cluster in the form of an AutoScalingGroup.
|
AutoScalingGroup |
addCapacity(String id,
CapacityOptions options)
(experimental) Add nodes to this EKS cluster.
|
HelmChart |
addChart(String id,
HelmChartOptions options)
(experimental) Defines a Helm chart in this cluster.
|
KubernetesResource |
addResource(String id,
Object... manifest)
(experimental) Defines a Kubernetes resource in this cluster.
|
static ICluster |
fromClusterAttributes(Construct scope,
String id,
ClusterAttributes attrs)
(experimental) Import an existing cluster.
|
AwsAuth |
getAwsAuth()
(experimental) Lazily creates the AwsAuth resource, which manages AWS authentication mapping.
|
String |
getClusterArn()
(experimental) The AWS generated ARN for the Cluster resource.
|
String |
getClusterCertificateAuthorityData()
(experimental) The certificate-authority-data for your cluster.
|
String |
getClusterEndpoint()
(experimental) The endpoint URL for the Cluster.
|
String |
getClusterName()
(experimental) The Name of the created EKS Cluster.
|
Connections |
getConnections()
(experimental) Manages connection rules (Security Group Rules) for the cluster.
|
AutoScalingGroup |
getDefaultCapacity()
(experimental) The auto scaling group that hosts the default capacity for this cluster.
|
Boolean |
getKubectlEnabled()
(experimental) Indicates if `kubectl` related operations can be performed on this cluster.
|
IRole |
getRole()
(experimental) IAM role assumed by the EKS Control Plane.
|
IVpc |
getVpc()
(experimental) The VPC in which this Cluster was created.
|
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResourcegetNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validatejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitapplyRemovalPolicy, getEnv, getStackgetNodeprotected Cluster(software.amazon.jsii.JsiiObjectRef objRef)
protected Cluster(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Experimental)
public Cluster(@NotNull
Construct scope,
@NotNull
String id,
@Nullable
ClusterProps props)
scope - a Construct, most likely a cdk.Stack created. This parameter is required.id - This parameter is required.props - properties in the IClusterProps interface.@Stability(value=Experimental) @NotNull public static ICluster fromClusterAttributes(@NotNull Construct scope, @NotNull String id, @NotNull ClusterAttributes attrs)
scope - the construct scope, in most cases 'this'. This parameter is required.id - the id or name to import as. This parameter is required.attrs - the cluster properties to use for importing information. This parameter is required.@Stability(value=Experimental)
public void addAutoScalingGroup(@NotNull
AutoScalingGroup autoScalingGroup,
@NotNull
AutoScalingGroupOptions options)
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 addCapacity if possible.
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.@Stability(value=Experimental) @NotNull public AutoScalingGroup addCapacity(@NotNull String id, @NotNull CapacityOptions options)
The nodes will automatically be configured with the right VPC and AMI for the instance type and Kubernetes version.
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.
id - This parameter is required.options - This parameter is required.@Stability(value=Experimental) @NotNull public HelmChart addChart(@NotNull String id, @NotNull HelmChartOptions options)
id - logical id of this chart. This parameter is required.options - options of this chart. This parameter is required.@Stability(value=Experimental) @NotNull public KubernetesResource addResource(@NotNull String id, @NotNull Object... manifest)
The manifest will be applied/deleted using kubectl as needed.
id - logical id of this manifest. This parameter is required.manifest - a list of Kubernetes resource specifications. This parameter is required.@Stability(value=Experimental) @NotNull public AwsAuth getAwsAuth()
@Stability(value=Experimental) @NotNull public String getClusterArn()
For example, arn:aws:eks:us-west-2:666666666666:cluster/prod
getClusterArn in interface ICluster@Stability(value=Experimental) @NotNull public String getClusterCertificateAuthorityData()
getClusterCertificateAuthorityData in interface ICluster@Stability(value=Experimental) @NotNull public String getClusterEndpoint()
This is the URL inside the kubeconfig file to use with kubectl
For example, https://5E1D0CEXAMPLEA591B746AFC5AB30262.yl4.us-west-2.eks.amazonaws.com
getClusterEndpoint in interface ICluster@Stability(value=Experimental) @NotNull public String getClusterName()
getClusterName in interface ICluster@Stability(value=Experimental) @NotNull public Connections getConnections()
getConnections in interface IConnectable@Stability(value=Experimental) @NotNull public Boolean getKubectlEnabled()
@Stability(value=Experimental) @NotNull public IRole getRole()
@Stability(value=Experimental) @NotNull public IVpc getVpc()
@Stability(value=Experimental) @Nullable public AutoScalingGroup getDefaultCapacity()
This will be undefined if the default capacity is set to 0.
Copyright © 2022. All rights reserved.