ALIYUN::CS::AnyCluster类型用于创建任意类型的Kubernetes集群实例。

语法

{
  "Type": "ALIYUN::CS::AnyCluster",
  "Properties": {
    "ClusterConfig": Map
  }
}

属性

属性名称 类型 必须 允许更新 描述 约束
ClusterConfig Map 集群配置 更多信息,请参见创建Kubernetes集群的API。例如:创建一个Kubernetes托管版集群实例,请参见创建Kubernetes托管版集群

返回值

Fn::GetAtt

  • ClusterId:集群ID。
  • TaskId:任务ID。系统自动分配,用于查询任务状态。
  • WorkerRamRoleName:Worker节点RAM角色名称。
  • DefaultUserKubeConfig:用户默认的Kubernetes配置,用于配置集群凭据。
  • ScalingRuleId:伸缩规则ID。
  • ScalingGroupId:伸缩组ID。
  • PrivateUserKubConfig:用户专有的Kubernetes配置,用于配置集群凭据。
  • ScalingConfigurationId:伸缩配置ID。
  • Nodes:集群节点列表。

示例

JSON格式

{
  "Parameters": {
    "ClusterConfig": {
      "Type": "Json",
      "Description": "Cluster config."
    }
  },
  "ROSTemplateFormatVersion": "2015-09-01",
  "Outputs": {
    "TaskId": {
      "Description": "Task ID. Automatically assigned by the system, the user queries the task status.",
      "Value": {
        "Fn::GetAtt": [
          "AnyCluster",
          "TaskId"
        ]
      }
    },
    "ClusterId": {
      "Description": "Cluster instance ID.",
      "Value": {
        "Fn::GetAtt": [
          "AnyCluster",
          "ClusterId"
        ]
      }
    },
    "ScalingGroupId": {
      "Description": "Scaling group id",
      "Value": {
        "Fn::GetAtt": [
          "AnyCluster",
          "ScalingGroupId"
        ]
      }
    },
    "ScalingRuleId": {
      "Description": "Scaling rule id",
      "Value": {
        "Fn::GetAtt": [
          "AnyCluster",
          "ScalingRuleId"
        ]
      }
    },
    "DefaultUserKubeConfig": {
      "Description": "Default user kubernetes config which is used for configuring cluster credentials.",
      "Value": {
        "Fn::GetAtt": [
          "AnyCluster",
          "DefaultUserKubeConfig"
        ]
      }
    },
    "WorkerRamRoleName": {
      "Description": "Worker ram role name.",
      "Value": {
        "Fn::GetAtt": [
          "AnyCluster",
          "WorkerRamRoleName"
        ]
      }
    },
    "ScalingConfigurationId": {
      "Description": "Scaling configuration id",
      "Value": {
        "Fn::GetAtt": [
          "AnyCluster",
          "ScalingConfigurationId"
        ]
      }
    },
    "PrivateUserKubConfig": {
      "Description": "Private user kubernetes config which is used for configuring cluster credentials.",
      "Value": {
        "Fn::GetAtt": [
          "AnyCluster",
          "PrivateUserKubConfig"
        ]
      }
    },
    "Nodes": {
      "Description": "The list of cluster nodes.",
      "Value": {
        "Fn::GetAtt": [
          "AnyCluster",
          "Nodes"
        ]
      }
    }
  },
  "Resources": {
    "AnyCluster": {
      "Type": "ALIYUN::CS::AnyCluster",
      "Properties": {
        "ClusterConfig": {
          "Ref": "ClusterConfig"
        }
      }
    }
  }
}

YAML格式

Parameters:
  ClusterConfig:
    Type: Json
    Description: Cluster config.
ROSTemplateFormatVersion: '2015-09-01'
Outputs:
  TaskId:
    Description: >-
      Task ID. Automatically assigned by the system, the user queries the task
      status.
    Value:
      'Fn::GetAtt':
        - AnyCluster
        - TaskId
  ClusterId:
    Description: Cluster instance ID.
    Value:
      'Fn::GetAtt':
        - AnyCluster
        - ClusterId
  ScalingGroupId:
    Description: Scaling group id
    Value:
      'Fn::GetAtt':
        - AnyCluster
        - ScalingGroupId
  ScalingRuleId:
    Description: Scaling rule id
    Value:
      'Fn::GetAtt':
        - AnyCluster
        - ScalingRuleId
  DefaultUserKubeConfig:
    Description: >-
      Default user kubernetes config which is used for configuring cluster
      credentials.
    Value:
      'Fn::GetAtt':
        - AnyCluster
        - DefaultUserKubeConfig
  WorkerRamRoleName:
    Description: Worker ram role name.
    Value:
      'Fn::GetAtt':
        - AnyCluster
        - WorkerRamRoleName
  ScalingConfigurationId:
    Description: Scaling configuration id
    Value:
      'Fn::GetAtt':
        - AnyCluster
        - ScalingConfigurationId
  PrivateUserKubConfig:
    Description: >-
      Private user kubernetes config which is used for configuring cluster
      credentials.
    Value:
      'Fn::GetAtt':
        - AnyCluster
        - PrivateUserKubConfig
  Nodes:
    Description: The list of cluster nodes.
    Value:
      'Fn::GetAtt':
        - AnyCluster
        - Nodes
Resources:
  AnyCluster:
    Type: 'ALIYUN::CS::AnyCluster'
    Properties:
      ClusterConfig:
        Ref: ClusterConfig

更多示例,请参见:JSON示例YAML示例