すべてのプロダクト
Search
ドキュメントセンター

Resource Orchestration Service:ALIYUN::EDAS::K8sCluster

最終更新日:Jan 16, 2025

ALIYUN::EDAS::K8sCluster は、Container Service for Kubernetes(ACK)のクラスターを作成するために使用されます。

構文

{
  "Type": "ALIYUN::EDAS::K8sCluster",
  "Properties": {
    "EnableAsm": String,
    "NamespaceId": String,
    "CsClusterId": String
  }
}

プロパティ

プロパティ

タイプ

必須

編集可能

説明

制約

EnableAsm

String

いいえ

いいえ

Alibaba Cloud Service Mesh(ASM)をアクティブにするかどうかを指定します。

有効な値:

  • true:ASM をアクティブにします。

  • false:ASM をアクティブにしません。

NamespaceId

String

いいえ

いいえ

名前空間の ID です。

形式は <Region ID>:<Microservice namespace identifier> です。

例: cn-hangzhou:doc

CsClusterId

String

はい

いいえ

クラスターの ID です。

GetK8sCluster オペレーションを呼び出して、クラスター ID をクエリできます。

戻り値

Fn::GetAtt

  • VpcId:仮想プライベートクラウド(VPC)の ID です。

  • NodeNum:ノードの数です。

  • ClusterId:クラスターの ID です。

  • ClusterName:クラスターの名前です。

  • SubNetCidr:サブネットの CIDR ブロックです。

  • NetworkMode:クラスターのネットワークタイプです。値 1 はクラシックネットワークを示します。値 2 は VPC を示します。

  • ClusterType:クラスターのタイプです。値 2 は Elastic Compute Service(ECS)クラスターを示します。値 5 は ACK クラスターまたは ACK Serverless クラスター を示します。

  • CsClusterId:ACK のクラスターの ID です。

  • VSwitchId:vSwitch の ID です。

JSON 形式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "EnableAsm": {
      "Type": "String",
      // ASM を有効にするかどうか。
      "Description": "Whether enable ASM."
    },
    "NamespaceId": {
      "Type": "String",
      // インポートするクラスターが属する名前空間の ID。
      "Description": "The ID of the namespace to which the cluster that you want to import belongs."
    },
    "CsClusterId": {
      "Type": "String",
      // CS クラスターの ID。
      "Description": "The ID of the CS cluster."
    }
  },
  "Resources": {
    "K8sCluster": {
      "Type": "ALIYUN::EDAS::K8sCluster",
      "Properties": {
        "EnableAsm": {
          "Ref": "EnableAsm"
        },
        "NamespaceId": {
          "Ref": "NamespaceId"
        },
        "CsClusterId": {
          "Ref": "CsClusterId"
        }
      }
    }
  },
  "Outputs": {
    "VpcId": {
      // クラスターの ID。
      "Description": "The ID of the cluster.",
      "Value": {
        "Fn::GetAtt": [
          "K8sCluster",
          "VpcId"
        ]
      }
    },
    "NodeNum": {
      // ノード数。
      "Description": "Number of nodes.",
      "Value": {
        "Fn::GetAtt": [
          "K8sCluster",
          "NodeNum"
        ]
      }
    },
    "ClusterId": {
      // クラスターの ID。
      "Description": "The ID of the cluster.",
      "Value": {
        "Fn::GetAtt": [
          "K8sCluster",
          "ClusterId"
        ]
      }
    },
    "ClusterName": {
      // クラスターの名前。
      "Description": "The name of the cluster.",
      "Value": {
        "Fn::GetAtt": [
          "K8sCluster",
          "ClusterName"
        ]
      }
    },
    "SubNetCidr": {
      // サブネット CIDR。
      "Description": "Sub net CIDR.",
      "Value": {
        "Fn::GetAtt": [
          "K8sCluster",
          "SubNetCidr"
        ]
      }
    },
    "NetworkMode": {
      // ネットワークノード:
      // 1:クラシックネットワーク
      // 2:VPC
      "Description": "Network node:\n1: Classic network\n2: VPC",
      "Value": {
        "Fn::GetAtt": [
          "K8sCluster",
          "NetworkMode"
        ]
      }
    },
    "ClusterType": {
      // クラスターのタイプ:
      // 2:ECS クラスター
      // 5:Container Service K8s クラスターまたは Serverless K8s クラスター
      "Description": "The type of the cluster:\n2: ECS cluster\n5: Container Service K8s cluster or Serverless K8s cluster",
      "Value": {
        "Fn::GetAtt": [
          "K8sCluster",
          "ClusterType"
        ]
      }
    },
    "CsClusterId": {
      // K8s クラスターの ID。
      "Description": "The ID of the K8s cluster.",
      "Value": {
        "Fn::GetAtt": [
          "K8sCluster",
          "CsClusterId"
        ]
      }
    },
    "VswitchId": {
      // クラスターの ID。
      "Description": "The ID of the cluster.",
      "Value": {
        "Fn::GetAtt": [
          "K8sCluster",
          "VswitchId"
        ]
      }
    }
  }
}

YAML 形式

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  CsClusterId:
    # CS クラスターの ID。
    Description: The ID of the CS cluster.
    Type: String
  EnableAsm:
    # ASM を有効にするかどうか。
    Description: Whether enable ASM.
    Type: String
  NamespaceId:
    # インポートするクラスターが属する名前空間の ID。
    Description: The ID of the namespace to which the cluster that you want to import
      belongs.
    Type: String
Resources:
  K8sCluster:
    Properties:
      CsClusterId:
        Ref: CsClusterId
      EnableAsm:
        Ref: EnableAsm
      NamespaceId:
        Ref: NamespaceId
    Type: ALIYUN::EDAS::K8sCluster
Outputs:
  ClusterId:
    # クラスターの ID。
    Description: The ID of the cluster.
    Value:
      Fn::GetAtt:
      - K8sCluster
      - ClusterId
  ClusterName:
    # クラスターの名前。
    Description: The name of the cluster.
    Value:
      Fn::GetAtt:
      - K8sCluster
      - ClusterName
  ClusterType:
    # クラスターのタイプ:
    # 2:ECS クラスター
    # 5:Container Service K8s クラスターまたは Serverless K8s クラスター
    Description: 'The type of the cluster:

      2: ECS cluster

      5: Container Service K8s cluster or Serverless K8s cluster'
    Value:
      Fn::GetAtt:
      - K8sCluster
      - ClusterType
  CsClusterId:
    # K8s クラスターの ID。
    Description: The ID of the K8s cluster.
    Value:
      Fn::GetAtt:
      - K8sCluster
      - CsClusterId
  NetworkMode:
    # ネットワークノード:
    # 1:クラシックネットワーク
    # 2:VPC
    Description: 'Network node:

      1: Classic network

      2: VPC'
    Value:
      Fn::GetAtt:
      - K8sCluster
      - NetworkMode
  NodeNum:
    # ノード数。
    Description: Number of nodes.
    Value:
      Fn::GetAtt:
      - K8sCluster
      - NodeNum
  SubNetCidr:
    # サブネット CIDR。
    Description: Sub net CIDR.
    Value:
      Fn::GetAtt:
      - K8sCluster
      - SubNetCidr
  VpcId:
    # クラスターの ID。
    Description: The ID of the cluster.
    Value:
      Fn::GetAtt:
      - K8sCluster
      - VpcId
  VswitchId:
    # クラスターの ID。
    Description: The ID of the cluster.
    Value:
      Fn::GetAtt:
      - K8sCluster
      - VswitchId