Skip to content

KubernetesCluster

  • Implements: com.aliyun.ros.cdk.cs.datasource.IKubernetesCluster

This class encapsulates and extends the ROS resource type DATASOURCE::CS::KubernetesCluster.

Initializers

import com.aliyun.ros.cdk.cs.datasource.KubernetesCluster;
KubernetesCluster.Builder.create(Construct scope, java.lang.String id, java.lang.Boolean enableResourcePropertyConstraint)
//  .clusterId(java.lang.String)
//  .clusterId(IResolvable)
//  .refreshOptions(java.lang.String)
//  .refreshOptions(IResolvable)
    .build();
Name Type Description
scope com.aliyun.ros.cdk.core.Construct No description.
id java.lang.String No description.
enableResourcePropertyConstraint java.lang.Boolean No description.
clusterId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property clusterId: Cluster instance ID.
refreshOptions java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property refreshOptions: The refresh strategy for the datasource resource when the stack is updated.

scopeRequired

  • Type: com.aliyun.ros.cdk.core.Construct

idRequired

  • Type: java.lang.String

enableResourcePropertyConstraintOptional

  • Type: java.lang.Boolean

clusterIdOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property clusterId: Cluster instance ID.


refreshOptionsOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property refreshOptions: The refresh strategy for the datasource resource when the stack is updated.

Valid values:

  • Never: Never refresh the datasource resource when the stack is updated.
  • Always: Always refresh the datasource resource when the stack is updated. Default is Never.

Methods

Name Description
toString Returns a string representation of this construct.
synthesize Allows this construct to emit artifacts into the cloud assembly during synthesis.
addCondition No description.
addCount No description.
addDependency No description.
addResourceDesc No description.
applyRemovalPolicy No description.
fetchCondition No description.
fetchDependency No description.
fetchResourceDesc No description.
getAtt No description.
setMetadata No description.

toString

public java.lang.String toString()

Returns a string representation of this construct.

synthesize

public void synthesize(ISynthesisSession session)

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

sessionRequired

  • Type: com.aliyun.ros.cdk.core.ISynthesisSession

The synthesis session.


addCondition

public void addCondition(RosCondition condition)

conditionRequired

  • Type: com.aliyun.ros.cdk.core.RosCondition

addCount

public void addCount(java.lang.Number OR IResolvable count)

countRequired

  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

addDependency

public void addDependency(Resource resource)

resourceRequired

  • Type: com.aliyun.ros.cdk.core.Resource

addResourceDesc

public void addResourceDesc(java.lang.String desc)

descRequired

  • Type: java.lang.String

applyRemovalPolicy

public void applyRemovalPolicy(RemovalPolicy policy)

policyRequired

  • Type: com.aliyun.ros.cdk.core.RemovalPolicy

fetchCondition

public RosCondition fetchCondition()

fetchDependency

public java.util.List<java.lang.String> fetchDependency()

fetchResourceDesc

public java.lang.String fetchResourceDesc()

getAtt

public IResolvable getAtt(java.lang.String name)

nameRequired

  • Type: java.lang.String

setMetadata

public void setMetadata(java.lang.String key, java.lang.Object value)

keyRequired

  • Type: java.lang.String

valueRequired

  • Type: java.lang.Object

Static Functions

Name Description
isConstruct Return whether the given object is a Construct.

isConstruct

import com.aliyun.ros.cdk.cs.datasource.KubernetesCluster;
KubernetesCluster.isConstruct(java.lang.Object x)

Return whether the given object is a Construct.

xRequired

  • Type: java.lang.Object

Properties

Name Type Description
node com.aliyun.ros.cdk.core.ConstructNode The construct tree node associated with this construct.
env com.aliyun.ros.cdk.core.IResourceEnvironment The environment this resource belongs to.
ref java.lang.String No description.
stack com.aliyun.ros.cdk.core.Stack The stack in which this resource is defined.
resource com.aliyun.ros.cdk.core.RosResource No description.
attrClusterId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute ClusterId: Cluster instance ID.
attrClusterSpec java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute ClusterSpec: The type of the managed Kubernetes cluster.
attrClusterType java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute ClusterType: The type of the cluster.
attrCreated java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute Created: The time when the cluster was created.
attrCurrentVersion java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute CurrentVersion: The current Kubernetes version of the cluster.
attrDeletionProtection java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute DeletionProtection: Indicates whether deletion protection is enabled.
attrDockerVersion java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute DockerVersion: The Docker version that is used by the cluster.
attrExternalLoadbalancerId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute ExternalLoadbalancerId: The ID of the Server Load Balancer (SLB) instance that is used for the Ingress of the cluster.
attrInitVersion java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute InitVersion: The Kubernetes version that is initially used by the cluster.
attrMaintenanceWindow java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute MaintenanceWindow: The maintenance window of the cluster.
attrMasterUrl java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute MasterUrl: The address of the cluster.
attrMetaData java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute MetaData: The metadata of the cluster.
attrName java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute Name: The name of the cluster.
attrNetworkMode java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute NetworkMode: The network mode of the cluster.
attrNextVersion java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute NextVersion: The Kubernetes version to which the cluster can be upgraded.
attrParameters java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute Parameters: A collection of cluster ROS parameters.
attrPrivateZone java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute PrivateZone: Indicates whether Alibaba Cloud DNS PrivateZone is enabled.
attrProfile java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute Profile: Indicates the scenario in which the cluster is used.
attrRegionId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute RegionId: The ID of the region where the cluster is deployed.
attrResourceGroupId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute ResourceGroupId: The ID of the resource group to which the cluster belongs.
attrSecurityGroupId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute SecurityGroupId: The ID of the security group to which the instances of the cluster belong.
attrServiceCidr java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute ServiceCidr: The cluster service cidr.
attrSize java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute Size: The number of nodes in the cluster.
attrState java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute State: The state of the cluster.
attrSubnetCidr java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute SubnetCidr: The pod CIDR block.
attrTags java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute Tags: The labels of the cluster.
attrUpdated java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute Updated: The time when the cluster was updated.
attrVpcId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute VpcId: The ID of the VPC where the cluster is deployed.
attrVSwitchId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute VSwitchId: The IDs of the vSwitches.
attrVSwitchIds java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute VSwitchIds: The list of cluster control plane VSwitch ID.
attrWorkerRamRoleName java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute WorkerRamRoleName: The name of the worker RAM role.
attrZoneId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute ZoneId: The ID of the zone where the cluster is deployed.
props KubernetesClusterProps No description.

nodeRequired

public ConstructNode getNode();
  • Type: com.aliyun.ros.cdk.core.ConstructNode

The construct tree node associated with this construct.


envRequired

public IResourceEnvironment getEnv();
  • Type: com.aliyun.ros.cdk.core.IResourceEnvironment

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.


refRequired

public java.lang.String getRef();
  • Type: java.lang.String

stackRequired

public Stack getStack();
  • Type: com.aliyun.ros.cdk.core.Stack

The stack in which this resource is defined.


resourceOptional

public RosResource getResource();
  • Type: com.aliyun.ros.cdk.core.RosResource

attrClusterIdRequired

public java.lang.Object getAttrClusterId();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute ClusterId: Cluster instance ID.


attrClusterSpecRequired

public java.lang.Object getAttrClusterSpec();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute ClusterSpec: The type of the managed Kubernetes cluster.

This parameter is returned for a managed Kubernetes cluster. Valid values:

  • ack.pro.small: professional managed Kubernetes cluster.
  • ack.standard: standard managed Kubernetes cluster.

attrClusterTypeRequired

public java.lang.Object getAttrClusterType();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute ClusterType: The type of the cluster.

Valid values:

  • Kubernetes: dedicated Kubernetes cluster
  • ManagedKubernetes: managed Kubernetes cluster
  • Ask: ASK cluster
  • ExternalKubernetes: registered external Kubernetes cluster

attrCreatedRequired

public java.lang.Object getAttrCreated();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute Created: The time when the cluster was created.


attrCurrentVersionRequired

public java.lang.Object getAttrCurrentVersion();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute CurrentVersion: The current Kubernetes version of the cluster.

For more information about the Kubernetes versions supported by ACK, see Release notes for Kubernetes versions.


attrDeletionProtectionRequired

public java.lang.Object getAttrDeletionProtection();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute DeletionProtection: Indicates whether deletion protection is enabled.

If deletion protection is enabled, the cluster cannot be deleted in the ACK console or by calling the API. Valid values:

  • true: Deletion protection is enabled. You cannot delete the cluster in the ACK console or by calling the API.
  • false: Deletion protection is not enabled. You can delete the cluster in the ACK console or by calling the API.

attrDockerVersionRequired

public java.lang.Object getAttrDockerVersion();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute DockerVersion: The Docker version that is used by the cluster.


attrExternalLoadbalancerIdRequired

public java.lang.Object getAttrExternalLoadbalancerId();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute ExternalLoadbalancerId: The ID of the Server Load Balancer (SLB) instance that is used for the Ingress of the cluster.


attrInitVersionRequired

public java.lang.Object getAttrInitVersion();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute InitVersion: The Kubernetes version that is initially used by the cluster.


attrMaintenanceWindowRequired

public java.lang.Object getAttrMaintenanceWindow();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute MaintenanceWindow: The maintenance window of the cluster.

This feature is available in only professional managed Kubernetes clusters.


attrMasterUrlRequired

public java.lang.Object getAttrMasterUrl();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute MasterUrl: The address of the cluster.

It includes an internal endpoint and a public endpoint.


attrMetaDataRequired

public java.lang.Object getAttrMetaData();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute MetaData: The metadata of the cluster.


attrNameRequired

public java.lang.Object getAttrName();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute Name: The name of the cluster.

The name must be 1 to 63 characters in length, and can contain digits, letters, and hyphens (-). It cannot start with a hyphen (-).


attrNetworkModeRequired

public java.lang.Object getAttrNetworkMode();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute NetworkMode: The network mode of the cluster.

Valid values:

  • classic: the classic network
  • vpc: virtual private cloud (VPC)
  • overlay: overlay network
  • calico: network powered by Calico Default value: vpc.

attrNextVersionRequired

public java.lang.Object getAttrNextVersion();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute NextVersion: The Kubernetes version to which the cluster can be upgraded.


attrParametersRequired

public java.lang.Object getAttrParameters();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute Parameters: A collection of cluster ROS parameters.


attrPrivateZoneRequired

public java.lang.Object getAttrPrivateZone();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute PrivateZone: Indicates whether Alibaba Cloud DNS PrivateZone is enabled.

  • true: indicates that Alibaba Cloud DNS PrivateZone is enabled.- false: indicates that Alibaba Cloud DNS PrivateZone is not enabled.

attrProfileRequired

public java.lang.Object getAttrProfile();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute Profile: Indicates the scenario in which the cluster is used.

Valid values:

  • Default: indicates that the cluster is used in non-edge computing scenarios.
  • Edge: indicates that the ACK cluster is used in edge computing scenarios.

attrRegionIdRequired

public java.lang.Object getAttrRegionId();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute RegionId: The ID of the region where the cluster is deployed.


attrResourceGroupIdRequired

public java.lang.Object getAttrResourceGroupId();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute ResourceGroupId: The ID of the resource group to which the cluster belongs.


attrSecurityGroupIdRequired

public java.lang.Object getAttrSecurityGroupId();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute SecurityGroupId: The ID of the security group to which the instances of the cluster belong.


attrServiceCidrRequired

public java.lang.Object getAttrServiceCidr();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute ServiceCidr: The cluster service cidr.


attrSizeRequired

public java.lang.Object getAttrSize();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute Size: The number of nodes in the cluster.

Master nodes and worker nodes are included.


attrStateRequired

public java.lang.Object getAttrState();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute State: The state of the cluster.

Valid values:

  • initial: The cluster is being created.
  • failed: The cluster failed to be created.
  • running: The cluster is running.
  • updating: The cluster is being upgraded.
  • updating_failed: The cluster failed to be upgraded.
  • scaling: The cluster is being scaled.
  • waiting: The registered cluster is waiting for connecting.
  • disconnected: The registeredcluster is disconnected.
  • stopped: The cluster is stopped.
  • deleting: The cluster is being deleted.
  • deleted: The cluster is deleted.
  • delete_failed: The cluster failed to be deleted.

attrSubnetCidrRequired

public java.lang.Object getAttrSubnetCidr();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute SubnetCidr: The pod CIDR block.

It must be a valid and private CIDR block, and must be one of the following CIDR blocks or their subnets:

  • 10.0.0.0/8
  • 172.16-31.0.0/12-16
  • 192.168.0.0/16 The pod CIDR block cannot overlap with that of the VPC or those of the ACK clusters that are deployed in the VPC. For more information about the network segmentation of ACK clusters, see Plan CIDR blocks for ACK clusters in a VPC.

attrTagsRequired

public java.lang.Object getAttrTags();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute Tags: The labels of the cluster.


attrUpdatedRequired

public java.lang.Object getAttrUpdated();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute Updated: The time when the cluster was updated.


attrVpcIdRequired

public java.lang.Object getAttrVpcId();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute VpcId: The ID of the VPC where the cluster is deployed.

This parameter is required when you create an ACK cluster.


attrVSwitchIdRequired

public java.lang.Object getAttrVSwitchId();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute VSwitchId: The IDs of the vSwitches.

You can select one to three vSwitches when you create an ACK cluster. vSwitches in different zones are recommended to ensure high availability.


attrVSwitchIdsRequired

public java.lang.Object getAttrVSwitchIds();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute VSwitchIds: The list of cluster control plane VSwitch ID.


attrWorkerRamRoleNameRequired

public java.lang.Object getAttrWorkerRamRoleName();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute WorkerRamRoleName: The name of the worker RAM role.

The RAM role is assigned to the worker nodes of the cluster and allows the worker nodes to manage Elastic Compute Service (ECS) instances.


attrZoneIdRequired

public java.lang.Object getAttrZoneId();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute ZoneId: The ID of the zone where the cluster is deployed.


propsRequired

public KubernetesClusterProps getProps();