All Products
Search
Document Center

Resource Orchestration Service:DATASOURCE::CS::KubernetesClusters

Last Updated:Aug 29, 2023

DATASOURCE::CS::KubernetesClusters is used to query Container Service for Kubernetes (ACK) clusters.

Syntax

{
  "Type": "DATASOURCE::CS::KubernetesClusters",
  "Properties": {
    "ClusterSpec": String,
    "ClusterType": String,
    "Profile": String,
    "Name": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

ClusterSpec

String

No

Yes

The specification of the cluster.

If you set the ClusterType property to ManagedKubernetes, you can use this property to distinguish the type of the cluster. Valid values:

  • ack.pro.small: ACK Pro cluster.

  • ack.standard: ACK standard cluster.

  • Null: This is the default value.

Note

If you set this property to Null, you cannot use this property to distinguish the type of the cluster.

ClusterType

String

No

Yes

The type of the cluster.

Valid values:

  • Kubernetes: ACK dedicated cluster

  • ManagedKubernetes: The cluster can be one of the following types:

    • ACK managed cluster

    • Serverless Kubernetes (ASK) cluster

    • ACK edge cluster

  • Ask: ACK Serverless cluster

  • ExternalKubernetes: registered cluster

Note

When you query an ACK Serverless cluster, the value of this property is determined by the cluster type that you specified when you created the cluster.

Profile

String

No

Yes

The profile of the cluster.

If you set the ClusterType property to ManagedKubernetes, you can use this property to distinguish the type of the cluster. Valid values:

  • Default: ACK managed cluster.

  • Serverless: ACK Serverless cluster.

  • Edge: ACK edge cluster.

  • Null: This is the default value.

Note

If you set this property to Null, you cannot use this property to distinguish the type of the cluster.

Name

String

No

Yes

The name of the cluster.

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

Return values (Fn::GetAtt)

  • ClusterIds: the IDs of the clusters.

  • Clusters: details of the clusters.

Property

Type

Description

Constraint

ClusterIds

List

The IDs of the clusters.

None.

Clusters

List

Details of the clusters.

None.

Name

String

The name of the cluster.

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

ClusterId

String

The ID of the cluster.

None.

RegionId

String

The ID of the region in which the cluster is deployed.

None.

State

String

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

  • updating_failed: The cluster failed to be updated.

  • scaling: The cluster is being scaled.

  • stopped: The cluster is stopped.

  • deleting: The cluster is being deleted.

  • deleted: The cluster is deleted.

  • delete_failed: The cluster failed to be deleted.

ClusterType

String

The type of the cluster.

Valid values:

  • Kubernetes: ACK dedicated cluster

  • ManagedKubernetes: ACK managed cluster

  • Ask: ACK Serverless cluster

  • ExternalKubernetes: registered cluster

Created

String

The when the cluster was created.

None.

Updated

String

The time when the cluster was updated.

None.

InitVersion

String

The initial Kubernetes version of the cluster.

ACK provides clusters of the latest two Kubernetes versions in the console. You can call specific ACK API operations to create clusters of other Kubernetes versions. For more information about Kubernetes versions that are supported by ACK, see Overview of Kubernetes versions supported by ACK.

Note

ACK supports all open source Kubernetes versions. We recommend that you use the latest Kubernetes version. If you leave this property empty, the latest Kubernetes version is used.

CurrentVersion

String

The current Kubernetes version of the cluster.

None.

MetaData

String

The metadata of the cluster.

None.

ResourceGroupId

String

The ID of the resource group to which the cluster belongs.

None.

InstanceType

String

The instance type of the node in the cluster.

None.

VpcId

String

The ID of the virtual private cloud (VPC) in which the cluster is deployed.

None.

VSwitchId

String

The ID of the vSwitch to which the cluster is connected.

None.

VSwitchCidr

String

The vSwitch CIDR block of the cluster.

None.

DataDiskSize

String

The data disk size of the cluster.

None.

DataDiskCategory

String

The data disk category of the cluster.

None.

SecurityGroupId

String

The ID of the security group to which the cluster belongs.

None.

Tags

List

The labels of the cluster.

For more information about labels, see the tag section of the "Commonly used parameters" topic.

ZoneId

String

The ID of the zone in which the cluster is deployed.

None.

NetworkMode

String

The network type of the cluster.

Default value: vpc. Valid values:

  • classic: classic network

  • vpc: VPC

  • overlay: overlay network

  • calico: network powered by Calico

SubnetCidr

String

The pod CIDR block of the cluster.

The CIDR block must be one of the following CIDR blocks of the VPC or their subnets:

  • 10.0.0.0/8

  • 172.16-31.0.0/12-16

  • 192.168.0.0/16

Note

The pod CIDR block cannot overlap with the CIDR block of the VPC in which the cluster is deployed and the CIDR blocks of existing ACK clusters in the VPC. You cannot modify the pod CIDR block after you create the cluster.

MasterUrl

String

The endpoint that is used to access the cluster.

Valid values:

  • VPC endpoint

  • public endpoint

ExternalLoadbalancerId

String

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

None.

Port

String

The port of the node.

None.

NodeStatus

String

Indicates whether the node is ready.

Valid values:

  • Ready

  • NotReady

  • Unknown

  • Offline

ClusterHealthy

String

The health state of the cluster.

None.

DockerVersion

String

The Docker version that is used by the cluster.

None.

SwarmMode

Boolean

Indicates whether the swarm mode is enabled.

Valid values:

  • true

  • false

GwBridge

String

The virtual bridge that connects networks.

None.

UpgradeComponents

Map

Details of the components that can be updated in the cluster.

Example: { "Kubernetes": { "ComponentName": "Kubernetes", "Version": "1.14.8-aliyun.1", "NextVersion": "", "Changed": "", "CanUpgrade": false, "Force": false, "Policy": "", "ExtraVars": null, "ReadyToUpgrade": "", "Message": "", "Exist": false, "Required": false }}.

NextVersion

String

The Kubernetes version to which the cluster can be updated.

None.

PrivateZone

Boolean

Indicates whether Alibaba Cloud DNS PrivateZone is activated.

Valid values:

  • true

  • false

ServiceDiscoveryTypes

List

The types of the service discovery feature that is implemented in an ACK Serverless cluster.

By default, this property is empty.

Valid values:

  • CoreDNS: CoreDNS is a standard service discovery plug-in that is provided by open source Kubernetes. To use the Domain Name System (DNS) resolution, you must provision pods.

    Note

    By default, two elastic container instances are used. The specifications of each instance are 0.25 vCPUs and 512 MiB of memory.

  • PrivateZone: Alibaba Cloud DNS PrivateZone is a service that is provided by Alibaba Cloud. You must activate Alibaba Cloud DNS PrivateZone before you use it to implement service discovery.

PrivateLink

String

Indicates whether PrivateLink is activated for the cluster.

None.

Profile

String

The profile that is specified for the cluster in a specific scenario.

Valid values:

  • Default: The cluster is not an ACK edge cluster.

  • Edge: The cluster is an ACK edge cluster.

DeletionProtection

Boolean

Indicates whether deletion protection is enabled for the cluster.

If deletion protection is enabled for the cluster, you cannot delete the cluster by using the ACK console or by calling specific ACK API operations. Valid values:

  • true: Deletion protection is enabled for the cluster. You cannot delete the cluster by using the ACK console or by calling specific ACK API operations.

  • false: Deletion protection is not enabled for the cluster. You can delete the cluster by using the ACK console or by calling specific ACK API operations.

ClusterSpec

String

The specification of the ACK managed cluster.

This property takes effect only for ACK managed clusters. Valid values:

  • ack.pro.small: ACK Pro cluster

  • ack.standard: ACK standard cluster

MaintenanceWindow

Map

The configurations of the maintenance window of the cluster.

This property takes effect only for ACK Pro clusters. For more information, see the maintenance_window section of the "Commonly used parameters" topic.

Capabilities

Map

The features of the current Kubernetes version.

None.

EnabledMigration

Boolean

Indicates whether migration is enabled for the cluster.

Valid values:

  • true

  • false

NeedUpdateAgent

Boolean

Indicates whether the agent in the cluster can be updated.

Valid values:

  • true

  • false

Outputs

List

The output information about the cluster.

Example: [ { "Description": "Log Info Output", "OutputKey": "LastKnownError", "OutputValue": null }, { "Description": "Error msg of ess scaling instance", "OutputKey": "NodesScalingErrorInfo", "OutputValue": null }, { "Description": "The mode we use in kube-proxy.", "OutputKey": "ProxyMode", "OutputValue": "ipvs" }, { "Description": "ScalingGroup ID", "OutputKey": "ScalingGroupID", "OutputValue": "asg-2zebrr08gt5uluh7****" }, { "Description": "Ids of worker node", "OutputKey": "NodeInstanceIDs", "OutputValue": [ "i-2ze4ymrjuocpbc0c****", "i-2ze4ymrjuocpbc0c****", "i-2ze4ymrjuocpbc0c****" ] }, { "Description": "Count of ess scaling instance", "OutputKey": "NodesScalingAddedInstances", "OutputValue": 3 } ].

Parameters

Map

The input properties that are specified for the cluster.

None.

WorkerRamRoleName

String

The name of the RAM role for worker nodes.

You can use the RAM role to authorize Elastic Compute Service (ECS) instances to serve as the worker nodes in the cluster.

MaintenanceInfo

Map

The maintenance configurations of the cluster.

None.

Examples

  • JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "ClusterSpec": {
          "Type": "String",
          "Description": "The specification of the cluster. If you set the cluster type to ManagedKubernetes, you can use cluster specifications to distinguish clusters. Valid values:\nack.pro.small: professional managed Kubernetes cluster\nack.standard: standard managed Kubernetes cluster\nBy default, this parameter is empty. This indicates that the parameter is not used to filter clusters."
        },
        "ClusterType": {
          "Type": "String",
          "Description": "The type of the cluster. Valid values:\nKubernetes: dedicated Kubernetes cluster\nManagedKubernetes: managed Kubernetes cluster, serverless Kubernetes (ASK) cluster, or edge Kubernetes cluster\nAsk: ASK cluster\nExternalKubernetes: registered external cluster\nWhen you query an ASK cluster, the value specified when the cluster was created is returned."
        },
        "Profile": {
          "Type": "String",
          "Description": "The identifier of the cluster. If you set the cluster type to ManagedKubernetes, you can use cluster identifiers to distinguish clusters. Valid values:\nDefault: managed Kubernetes cluster\nServerless: ASK cluster\nEdge: edge Kubernetes cluster\nBy default, this parameter is empty. This indicates that the parameter is not used to filter clusters."
        },
        "Name": {
          "Type": "String",
          "Description": "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 (-)."
        }
      },
      "Resources": {
        "KubernetesClusters": {
          "Type": "DATASOURCE::CS::KubernetesClusters",
          "Properties": {
            "ClusterSpec": {
              "Ref": "ClusterSpec"
            },
            "ClusterType": {
              "Ref": "ClusterType"
            },
            "Profile": {
              "Ref": "Profile"
            },
            "Name": {
              "Ref": "Name"
            }
          }
        }
      },
      "Outputs": {
        "Clusters": {
          "Description": "The list of clusters.",
          "Value": {
            "Fn::GetAtt": [
              "KubernetesClusters",
              "Clusters"
            ]
          }
        },
        "ClusterIds": {
          "Description": "The list of cluster IDs.",
          "Value": {
            "Fn::GetAtt": [
              "KubernetesClusters",
              "ClusterIds"
            ]
          }
        }
      }
    }
  • YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      ClusterSpec:
        Type: String
        Description: |-
          The specification of the cluster. If you set the cluster type to ManagedKubernetes, you can use cluster specifications to distinguish clusters. Valid values:
          ack.pro.small: professional managed Kubernetes cluster
          ack.standard: standard managed Kubernetes cluster
          By default, this parameter is empty. This indicates that the parameter is not used to filter clusters.
      ClusterType:
        Type: String
        Description: |-
          The type of the cluster. Valid values:
          Kubernetes: dedicated Kubernetes cluster
          ManagedKubernetes: managed Kubernetes cluster, serverless Kubernetes (ASK) cluster, or edge Kubernetes cluster
          Ask: ASK cluster
          ExternalKubernetes: registered external cluster
          When you query an ASK cluster, the value specified when the cluster was created is returned.
      Profile:
        Type: String
        Description: |-
          The identifier of the cluster. If you set the cluster type to ManagedKubernetes, you can use cluster identifiers to distinguish clusters. Valid values:
          Default: managed Kubernetes cluster
          Serverless: ASK cluster
          Edge: edge Kubernetes cluster
          By default, this parameter is empty. This indicates that the parameter is not used to filter clusters.
      Name:
        Type: String
        Description: 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 (-).
    Resources:
      KubernetesClusters:
        Type: DATASOURCE::CS::KubernetesClusters
        Properties:
          ClusterSpec:
            Ref: ClusterSpec
          ClusterType:
            Ref: ClusterType
          Profile:
            Ref: Profile
          Name:
            Ref: Name
    Outputs:
      Clusters:
        Description: The list of clusters.
        Value:
          Fn::GetAtt:
            - KubernetesClusters
            - Clusters
      ClusterIds:
        Description: The list of cluster IDs.
        Value:
          Fn::GetAtt:
            - KubernetesClusters
            - ClusterIds