Skip to content

KubernetesCluster

This class encapsulates and extends the ROS resource type DATASOURCE::CS::KubernetesCluster, which is used to query the information about a Container Service for Kubernetes (ACK) cluster.

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.
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

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.
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 com.aliyun.ros.cdk.core.IResolvable Attribute ClusterId: Cluster instance ID.
attrClusterSpec com.aliyun.ros.cdk.core.IResolvable Attribute ClusterSpec: The type of the managed Kubernetes cluster.
attrClusterType com.aliyun.ros.cdk.core.IResolvable Attribute ClusterType: The type of the cluster.
attrCreated com.aliyun.ros.cdk.core.IResolvable Attribute Created: The time when the cluster was created.
attrCurrentVersion com.aliyun.ros.cdk.core.IResolvable Attribute CurrentVersion: The current Kubernetes version of the cluster.
attrDeletionProtection com.aliyun.ros.cdk.core.IResolvable Attribute DeletionProtection: Indicates whether deletion protection is enabled.
attrDockerVersion com.aliyun.ros.cdk.core.IResolvable Attribute DockerVersion: The Docker version that is used by the cluster.
attrExternalLoadbalancerId 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 com.aliyun.ros.cdk.core.IResolvable Attribute InitVersion: The Kubernetes version that is initially used by the cluster.
attrMaintenanceWindow com.aliyun.ros.cdk.core.IResolvable Attribute MaintenanceWindow: The maintenance window of the cluster.
attrMasterUrl com.aliyun.ros.cdk.core.IResolvable Attribute MasterUrl: The address of the cluster.
attrMetaData com.aliyun.ros.cdk.core.IResolvable Attribute MetaData: The metadata of the cluster.
attrName com.aliyun.ros.cdk.core.IResolvable Attribute Name: The name of the cluster.
attrNetworkMode com.aliyun.ros.cdk.core.IResolvable Attribute NetworkMode: The network mode of the cluster.
attrNextVersion com.aliyun.ros.cdk.core.IResolvable Attribute NextVersion: The Kubernetes version to which the cluster can be upgraded.
attrParameters com.aliyun.ros.cdk.core.IResolvable Attribute Parameters: A collection of cluster ROS parameters.
attrPrivateZone com.aliyun.ros.cdk.core.IResolvable Attribute PrivateZone: Indicates whether Alibaba Cloud DNS PrivateZone is enabled.
attrProfile com.aliyun.ros.cdk.core.IResolvable Attribute Profile: Indicates the scenario in which the cluster is used.
attrRegionId com.aliyun.ros.cdk.core.IResolvable Attribute RegionId: The ID of the region where the cluster is deployed.
attrResourceGroupId com.aliyun.ros.cdk.core.IResolvable Attribute ResourceGroupId: The ID of the resource group to which the cluster belongs.
attrSecurityGroupId com.aliyun.ros.cdk.core.IResolvable Attribute SecurityGroupId: The ID of the security group to which the instances of the cluster belong.
attrSize com.aliyun.ros.cdk.core.IResolvable Attribute Size: The number of nodes in the cluster.
attrState com.aliyun.ros.cdk.core.IResolvable Attribute State: The state of the cluster.
attrSubnetCidr com.aliyun.ros.cdk.core.IResolvable Attribute SubnetCidr: The pod CIDR block.
attrTags com.aliyun.ros.cdk.core.IResolvable Attribute Tags: The labels of the cluster.
attrUpdated com.aliyun.ros.cdk.core.IResolvable Attribute Updated: The time when the cluster was updated.
attrVpcId com.aliyun.ros.cdk.core.IResolvable Attribute VpcId: The ID of the VPC where the cluster is deployed.
attrVSwitchId com.aliyun.ros.cdk.core.IResolvable Attribute VSwitchId: The IDs of the vSwitches.
attrWorkerRamRoleName com.aliyun.ros.cdk.core.IResolvable Attribute WorkerRamRoleName: The name of the worker RAM role.
attrZoneId com.aliyun.ros.cdk.core.IResolvable Attribute ZoneId: The ID of the zone where the cluster is deployed.

nodeRequired

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

The construct tree node associated with this construct.


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 IResolvable getAttrClusterId();
  • Type: com.aliyun.ros.cdk.core.IResolvable

Attribute ClusterId: Cluster instance ID.


attrClusterSpecRequired

public IResolvable getAttrClusterSpec();
  • Type: 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 IResolvable getAttrClusterType();
  • Type: 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 IResolvable getAttrCreated();
  • Type: com.aliyun.ros.cdk.core.IResolvable

Attribute Created: The time when the cluster was created.


attrCurrentVersionRequired

public IResolvable getAttrCurrentVersion();
  • Type: 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 IResolvable getAttrDeletionProtection();
  • Type: 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 IResolvable getAttrDockerVersion();
  • Type: com.aliyun.ros.cdk.core.IResolvable

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


attrExternalLoadbalancerIdRequired

public IResolvable getAttrExternalLoadbalancerId();
  • Type: 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 IResolvable getAttrInitVersion();
  • Type: com.aliyun.ros.cdk.core.IResolvable

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


attrMaintenanceWindowRequired

public IResolvable getAttrMaintenanceWindow();
  • Type: 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 IResolvable getAttrMasterUrl();
  • Type: com.aliyun.ros.cdk.core.IResolvable

Attribute MasterUrl: The address of the cluster.

It includes an internal endpoint and a public endpoint.


attrMetaDataRequired

public IResolvable getAttrMetaData();
  • Type: com.aliyun.ros.cdk.core.IResolvable

Attribute MetaData: The metadata of the cluster.


attrNameRequired

public IResolvable getAttrName();
  • Type: 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 IResolvable getAttrNetworkMode();
  • Type: 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 IResolvable getAttrNextVersion();
  • Type: com.aliyun.ros.cdk.core.IResolvable

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


attrParametersRequired

public IResolvable getAttrParameters();
  • Type: com.aliyun.ros.cdk.core.IResolvable

Attribute Parameters: A collection of cluster ROS parameters.


attrPrivateZoneRequired

public IResolvable getAttrPrivateZone();
  • Type: 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 IResolvable getAttrProfile();
  • Type: 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 IResolvable getAttrRegionId();
  • Type: com.aliyun.ros.cdk.core.IResolvable

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


attrResourceGroupIdRequired

public IResolvable getAttrResourceGroupId();
  • Type: com.aliyun.ros.cdk.core.IResolvable

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


attrSecurityGroupIdRequired

public IResolvable getAttrSecurityGroupId();
  • Type: com.aliyun.ros.cdk.core.IResolvable

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


attrSizeRequired

public IResolvable getAttrSize();
  • Type: com.aliyun.ros.cdk.core.IResolvable

Attribute Size: The number of nodes in the cluster.

Master nodes and worker nodes are included.


attrStateRequired

public IResolvable getAttrState();
  • Type: 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 IResolvable getAttrSubnetCidr();
  • Type: 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 IResolvable getAttrTags();
  • Type: com.aliyun.ros.cdk.core.IResolvable

Attribute Tags: The labels of the cluster.


attrUpdatedRequired

public IResolvable getAttrUpdated();
  • Type: com.aliyun.ros.cdk.core.IResolvable

Attribute Updated: The time when the cluster was updated.


attrVpcIdRequired

public IResolvable getAttrVpcId();
  • Type: 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 IResolvable getAttrVSwitchId();
  • Type: 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.


attrWorkerRamRoleNameRequired

public IResolvable getAttrWorkerRamRoleName();
  • Type: 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 IResolvable getAttrZoneId();
  • Type: com.aliyun.ros.cdk.core.IResolvable

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