All Products
Search
Document Center

Resource Orchestration Service:DATASOURCE::CS::KubernetesClusters

Last Updated:Nov 01, 2024

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,
    "RefreshOptions": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

ClusterSpec

String

No

Yes

The specification of the cluster.

If you set ClusterType to ManagedKubernetes, you can use ClusterSpec to distinguish the type of the ACK managed cluster. Valid values:

  • ack.pro.small: ACK Pro cluster

  • ack.standard: ACK Basic cluster

  • Null (default): no type

Note

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

ClusterType

String

No

Yes

The cluster type.

Valid values:

  • Kubernetes: ACK dedicated cluster

  • ManagedKubernetes: ACK managed cluster. The cluster can be one of the following categories:

    • ACK managed cluster

    • ACK Serverless 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 ClusterType to ManagedKubernetes, you can use Profile to distinguish the category of the ACK managed cluster. Valid values:

  • Default: ACK managed cluster

  • Serverless: ACK Serverless cluster

  • Edge: ACK Edge cluster

  • Null (default): no category

Note

If you set this property to Null, you cannot use this property to distinguish the category of the ACK managed cluster.

Name

String

No

Yes

The cluster name.

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

RefreshOptions

String

No

Yes

The refresh policy for data source resources when the stack is updated.

Valid values:

  • Never (default): does not refresh data source resources when the stack is updated.

  • Always: refreshes data source resources when the stack is updated.

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

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

ClusterId

String

The cluster ID.

None.

RegionId

String

The region ID of the cluster.

None.

State

String

The status 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 cluster type.

Valid values:

  • Kubernetes: ACK dedicated cluster

  • ManagedKubernetes: ACK managed cluster

  • Ask: ACK Serverless cluster

  • ExternalKubernetes: registered cluster

Created

String

The time 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 create clusters of other Kubernetes versions by calling specific ACK API operations. For more information about the Kubernetes versions 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 this property is empty, the latest Kubernetes version is used by default.

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

None.

VSwitchId

String

The vSwitch ID of the cluster.

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

ZoneId

String

The zone ID of the cluster.

None.

NetworkMode

String

The network mode of the cluster.

Valid values:

  • classic: classic network

  • vpc (default): VPC

  • overlay: overlay network

  • calico: network powered by Calico

SubnetCidr

String

The pod CIDR block.

The pod 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 of the cluster.

The following types of endpoints are supported:

  • internal 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

The status that shows whether the node is ready.

Valid values:

  • Ready

  • NotReady

  • Unknown

  • Offline

ClusterHealthy

String

The health status of the cluster.

None.

DockerVersion

String

The Docker version of the cluster.

None.

SwarmMode

Boolean

Indicates whether Swarm Mode is enabled.

Valid values:

  • true

  • false

GwBridge

String

The docker_gwbridge virtual bridge that connects overlay 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 for the cluster.

Valid values:

  • true

  • false

ServiceDiscoveryTypes

List

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

By default, this property is empty.

Valid values:

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

    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. You must activate Alibaba Cloud DNS PrivateZone before you use it to implement service discovery.

PrivateLink

String

The PrivateLink service that is associated with 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 in the ACK console or by calling specific ACK API operations. Valid values:

  • true

  • false

ClusterSpec

String

The type of the ACK managed cluster.

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

  • ack.pro.small: ACK Pro cluster

  • ack.standard: ACK Basic cluster

MaintenanceWindow

Map

The maintenance window configurations of the cluster.

This property takes effect only for ACK Pro clusters. For more information, see maintenance_window.

Capabilities

Map

The features of the Kubernetes version.

None.

EnabledMigration

Boolean

Indicates whether migration is enabled for the cluster.

Valid values:

  • true

  • false

NeedUpdateAgent

Boolean

Indicates whether the agent 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 parameters of the cluster.

None.

WorkerRamRoleName

String

The name of the Resource Access Management (RAM) role for the worker nodes.

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

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